Buggy code:
public class SimpleMapper extends BaseInterceptor { int debug = 0 ; ContextManager cm ; Hashtable contextPaths = new Hashtable ( ) ; Hashtable securityConstraints = new Hashtable ( ) ; class Mappings { Context ctx ; Container defaultContainer ; Hashtable prefixMappedServlets ; Hashtable extensionMappedServlets ; Hashtable pathMappedServlets ; } public SimpleMapper ( ) { } public void setContextManager ( ContextManager cm ) { } public void setDebug ( int level ) { } void log ( String msg ) { } public int contextMap ( Request rrequest ) { } public int requestMap ( Request req ) { Context context = req . getContext ( ) ; String path = req . getLookupPath ( ) ; Container container = null ; String ctxP = context . getPath ( ) ; SimpleMapper . Mappings m = ( ( SimpleMapper . Mappings ) ( contextPaths . get ( ctxP ) ) ) ; if ( ( debug ) > 0 ) context . log ( ( "Mapping:<seq2seq4repair_space>" + req ) ) ; container = findContainer ( m , path , context , req ) ; if ( container == null ) { container = m . defaultContainer ; if ( ( m . defaultContainer . getHandler ( ) ) == null ) { ServletWrapper sw = context . getDefaultServlet ( ) ; m . defaultContainer . setHandler ( sw ) ; } req . setWrapper ( m . defaultContainer . getHandler ( ) ) ; req . setServletPath ( "" ) ; req . setPathInfo ( path ) ; if ( ( debug ) > 0 ) context . log ( ( ( "Default<seq2seq4repair_space>mapper<seq2seq4repair_space>" + "\n<seq2seq4repair_space>" ) + req ) ) ; } else { req . setWrapper ( container . getHandler ( ) ) ; if ( ( debug ) > 0 ) context . log ( ( ( "Found<seq2seq4repair_space>wrapper<seq2seq4repair_space>using<seq2seq4repair_space>getMapPath<seq2seq4repair_space>" + "\n<seq2seq4repair_space>" ) + req ) ) ; } req . setContainer ( container ) ; if ( ( container . getRoles ( ) ) != null ) { if ( ( debug ) > 0 ) context . log ( ( ( "Existing<seq2seq4repair_space>security<seq2seq4repair_space>constraint<seq2seq4repair_space>" + "\n<seq2seq4repair_space>" ) + ( container . getRoles ( ) ) ) ) ; return OK ; } m = ( ( SimpleMapper . Mappings ) ( securityConstraints . get ( ctxP ) ) ) ; if ( m == null ) return OK ; Container scontainer = findContainer ( m , path , context , req ) ; <START_BUG> if ( m == null ) { <END_BUG> return OK ; } if ( ( debug ) > 0 ) context . log ( ( ( "Found<seq2seq4repair_space>security<seq2seq4repair_space>constraing<seq2seq4repair_space>" + "\n<seq2seq4repair_space>" ) + ( scontainer . getRoles ( ) ) ) ) ; container . setRoles ( scontainer . getRoles ( ) ) ; container . setTransport ( scontainer . getTransport ( ) ) ; return OK ; } private Container findContainer ( SimpleMapper . Mappings m , String path , Context context , Request req ) { } public void removeContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public void removeContainer ( Container ct ) throws TomcatException { } private Container getPathMatch ( SimpleMapper . Mappings m , Context context , String path , Request req ) { } private Container getPrefixMatch ( SimpleMapper . Mappings m , Context context , String path , Request req ) { } private Container getExtensionMatch ( SimpleMapper . Mappings m , Context context , String path , Request req ) { } private String getExtension ( String path ) { } private String removeLast ( String s ) { } String getFirst ( String path ) { } Context getContextByPath ( String path ) { } }

Fix:
if ( scontainer == null ) {