Buggy code:
String contextPath = Ajp12 . readString ( ajpin , null ) ; if ( "ROOT" . equalsIgnoreCase ( contextPath ) ) contextPath = null ; dummy = Ajp12 . readString ( ajpin , null ) ; req . serverName ( ) . setString ( Ajp12 . readString ( ajpin , null ) ) ; dummy = Ajp12 . readString ( ajpin , null ) ; req . pathInfo ( ) . setString ( Ajp12 . readString ( ajpin , null ) ) ; dummy = Ajp12 . readString ( ajpin , null ) ; req . queryString ( ) . setString ( Ajp12 . readString ( ajpin , null ) ) ; req . remoteAddr ( ) . setString ( Ajp12 . readString ( ajpin , "" ) ) ; req . remoteHost ( ) . setString ( Ajp12 . readString ( ajpin , "" ) ) ; if ( isTomcatAuthentication ( ) ) dummy = Ajp12 . readString ( ajpin , null ) ; else req . setRemoteUser ( Ajp12 . readString ( ajpin , null ) ) ; req . setAuthType ( Ajp12 . readString ( ajpin , null ) ) ; dummy = Ajp12 . readString ( ajpin , null ) ; req . method ( ) . setString ( Ajp12 . readString ( ajpin , null ) ) ; req . requestURI ( ) . setString ( Ajp12 . readString ( ajpin , "" ) ) ; dummy = Ajp12 . readString ( ajpin , null ) ; dummy = Ajp12 . readString ( ajpin , null ) ; req . serverName ( ) . setString ( Ajp12 . readString ( ajpin , "" ) ) ; int serverPort = 80 ; try { String p = Ajp12 . readString ( ajpin , null ) ; if ( p == null ) p = "80" ; serverPort = Integer . parseInt ( p ) ; } catch ( Exception any ) { any . printStackTrace ( ) ; } req . setServerPort ( serverPort ) ; String proto = Ajp12 . readString ( ajpin , null ) ; if ( proto == null ) proto = "HTTP//1.0" ; req . protocol ( ) . setString ( proto ) ; dummy = Ajp12 . readString ( ajpin , "" ) ; dummy = Ajp12 . readString ( ajpin , "" ) ; req . setJvmRoute ( Ajp12 . readString ( ajpin , null ) ) ; dummy = Ajp12 . readString ( ajpin , "" ) ; dummy = Ajp12 . readString ( ajpin , "" ) ; break ; case 5 : token1 = Ajp12 . readString ( ajpin , null ) ; token2 = Ajp12 . readString ( ajpin , "" ) ; req . setAttribute ( token1 , token2 ) ; if ( ( token1 . equals ( "HTTPS" ) ) && ( token2 . equals ( "on" ) ) ) { req . scheme ( ) . setString ( "https" ) ; } break ; case 3 : token1 = Ajp12 . readString ( ajpin , null ) ; token2 = Ajp12 . readString ( ajpin , "" ) ; req . getMimeHeaders ( ) . addValue ( token1 ) . setString ( token2 ) ; break ; case 254 : signal = ajpin . read ( ) ; if ( signal == 0 ) { try { socket . getOutputStream ( ) . write ( 0 ) ; sin . close ( ) ; } catch ( IOException ignored ) { req . getContextManager ( ) . log ( "Exception<seq2seq4repair_space>closing,<seq2seq4repair_space>ignored" , ignored ) ; } isPing = true ; return ; } else { try { InetAddress serverAddr = socket . getLocalAddress ( ) ; InetAddress clientAddr = socket . getInetAddress ( ) ; if ( ( signal == 15 ) && ( Ajp12 . isSameAddress ( serverAddr , clientAddr ) ) ) { if ( ( secret ) != null ) { String stopMsg = Ajp12 . readString ( ajpin , "" ) ; if ( ! ( secret . equals ( stopMsg ) ) ) { req . getContextManager ( ) . log ( "Attempt<seq2seq4repair_space>to<seq2seq4repair_space>stop<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>wrong<seq2seq4repair_space>secret" ) ; return ; } } ContextManager cm = req . getContextManager ( ) ; cm . shutdown ( ) ; cm . log ( "Exiting" ) ; <START_BUG> cm . getLog ( ) . getLogger ( ) . flush ( ) ; <END_BUG> System . exit ( 0 ) ; shutdown = true ; return ; } sin . close ( ) ; } catch ( Exception ignored ) { req . getContextManager ( ) . log ( ( ( "Ignored<seq2seq4repair_space>exception<seq2seq4repair_space>" + "processing<seq2seq4repair_space>signal<seq2seq4repair_space>" ) + signal ) , ignored ) ; } } return ; case 4 : case 255 : more = false ; break ; case - 1 : throw new IOException ( "Stream<seq2seq4repair_space>closed<seq2seq4repair_space>prematurely" ) ; default : throw new IOException ( "Stream<seq2seq4repair_space>broken" ) ; } } } catch ( IOException ioe ) { throw ioe ; } catch ( Exception e ) { req . getContextManager ( ) . log ( "Uncaught<seq2seq4repair_space>exception<seq2seq4repair_space>handling<seq2seq4repair_space>request" , e ) ; } String requestURI = req . requestURI ( ) . toString ( ) ; int indexQ = requestURI . indexOf ( "?" ) ; int rLen = requestURI . length ( ) ; if ( ( indexQ > ( - 1 ) ) && ( indexQ < rLen ) ) { req . queryString ( ) . setString ( requestURI . substring ( ( indexQ + 1 ) , requestURI . length ( ) ) ) ; req . requestURI ( ) . setString ( requestURI . substring ( 0 , indexQ ) ) ; } } public static boolean isSameAddress ( InetAddress server , InetAddress client ) { } public static int readWord ( InputStream in ) throws IOException { } static final String CHARSET = "UTF8" ; public static String readString ( InputStream in , String def ) throws IOException { }

Fix:
cm . getLog ( ) . flush ( ) ;