Buggy code:
public class ContextManager { private StringManager sm = StringManager . getManager ( "org.apache.tomcat.core" ) ; private Vector requestInterceptors = new Vector ( ) ; private Vector contextInterceptors = new Vector ( ) ; ContextInterceptor [ ] cInterceptors ; RequestInterceptor [ ] rInterceptors ; private Object permissions ; Vector connectors = new Vector ( ) ; private Vector contextsV = new Vector ( ) ; int debug = 0 ; String workDir ; String home ; String installDir ; public static final String DEFAULT_WORK_DIR = "work" ; public ContextManager ( ) { } public void setHome ( String home ) { } public String getHome ( ) { } public String getInstallDir ( ) { } public void setInstallDir ( String tH ) { } public void setWorkDir ( String wd ) { } public String getWorkDir ( ) { } public Object getPermissions ( ) { } public void setPermissions ( Object permissions ) { } public void setDefaults ( ) { } public void init ( ) throws TomcatException { } public void shutdown ( ) throws TomcatException { } public void initContext ( Context ctx ) throws TomcatException { } public void shutdownContext ( Context ctx ) throws TomcatException { } public void start ( ) throws Exception { } public void stop ( ) throws Exception { } public Enumeration getContexts ( ) { } public void addContext ( Context ctx ) throws TomcatException { } public void removeContext ( Context context ) throws TomcatException { } void doReload ( Request req , Context context ) throws TomcatException { } public void addContainer ( Container container ) throws TomcatException { } public void removeContainer ( Container container ) throws TomcatException { } public synchronized void addServerConnector ( ServerConnector con ) { } public Enumeration getConnectors ( ) { } public void addRequestInterceptor ( RequestInterceptor ri ) { } public RequestInterceptor [ ] getRequestInterceptors ( Request req ) { } public RequestInterceptor [ ] getRequestInterceptors ( ) { } public void addContextInterceptor ( ContextInterceptor ci ) { } public ContextInterceptor [ ] getContextInterceptors ( ) { } public void initRequest ( Request req , Response resp ) { } public void service ( Request req , Response res ) { } private void internalService ( Request req , Response res ) { } public int processRequest ( Request req ) { } public int doAuthenticate ( Request req , Response res ) { } public int doAuthorize ( Request req , Response res , String [ ] roles ) { } int doBeforeBody ( Request req , Response res ) { } int doBeforeCommit ( Request req , Response res ) { } int doPreService ( Request req , Response res ) { } int doPostService ( Request req , Response res ) { } int doNewSessionRequest ( Request req , Response res ) { } int doAfterBody ( Request req , Response res ) { } public Request createRequest ( Context ctx , String urlPath ) { } public Request createRequest ( String urlPath ) { } public void handleStatus ( Request req , Response res , int code ) { } void handleError ( Request req , Response res , Throwable t ) { } <START_BUG> public Handler getHandlerForPath ( Context ctx , String path ) { <END_BUG> if ( ! ( path . startsWith ( "//" ) ) ) { return ctx . getServletByName ( path ) ; } RequestImpl req1 = new RequestImpl ( ) ; ResponseImpl res1 = new ResponseImpl ( ) ; initRequest ( req1 , res1 ) ; req1 . setRequestURI ( ( ( ctx . getPath ( ) ) + path ) ) ; processRequest ( req1 ) ; return req1 . getWrapper ( ) ; } private boolean errorLoop ( Context ctx , Request req ) { } private int [ ] noteId = new int [ 3 ] ; public static final int MAX_NOTES = 32 ; public static final int RESERVED = 3 ; public static final int SERVER_NOTE = 0 ; public static final int CONTAINER_NOTE = 1 ; public static final int REQUEST_NOTE = 2 ; public static final int REQ_RE_NOTE = 0 ; String [ ] [ ] noteName = new String [ 3 ] [ ContextManager . MAX_NOTES ] ; public synchronized int getNoteId ( int noteType , String name ) throws TomcatException { } public String getNoteName ( int noteType , int noteId ) { } Object [ ] notes = new Object [ ContextManager . MAX_NOTES ] ; public void setNote ( int pos , Object value ) { } public Object getNote ( int pos ) { } boolean firstLog = true ; LogHelper loghelper = new LogHelper ( "tc_log" , "ContextManager" ) ; public void addLogger ( Logger l ) { } public void setDebug ( int level ) { } public int getDebug ( ) { } public final void log ( String msg ) { } private final void logInt ( String msg ) { } public final void doLog ( String msg ) { } public final void doLog ( String msg , Throwable t ) { } public final void doLog ( String msg , Throwable t , int level ) { } public static final int ACC_INIT_START = 0 ; public static final int ACC_INIT_END = 0 ; public static final int ACCOUNTS = 7 ; long [ ] accTable = new long [ ContextManager . ACCOUNTS ] ; public void setAccount ( int pos , long value ) { } public long getAccount ( int pos ) { } public static final String DEFAULT_HOSTNAME = "localhost" ; public static final int DEFAULT_PORT = 8080 ; String hostname ; int port ; public void setPort ( int port ) { } public int getPort ( ) { } public void setHostName ( String host ) { } public String getHostName ( ) { } private Hashtable contexts = new Hashtable ( ) ;

Fix:
public ServletWrapper getHandlerForPath ( Context ctx , String path ) {