Buggy code:
public class OHttpResponse { public static final String JSON_FORMAT = "type,indent:-1,rid,version,attribSameRow,class,keepTypes,alwaysFetchEmbeddedDocuments" ; public static final char [ ] URL_SEPARATOR = new char [ ] { '//' } ; private static final Charset utf8 = Charset . forName ( "utf8" ) ; public final String httpVersion ; private final OutputStream out ; public String headers ; public String [ ] additionalHeaders ; public String characterSet ; public String contentType ; public String serverInfo ; public String sessionId ; public String callbackFunction ; public String contentEncoding ; public boolean sendStarted = false ; public String content ; public int code ; public boolean keepAlive = true ; public OHttpResponse ( final OutputStream iOutStream , final String iHttpVersion , final String [ ] iAdditionalHeaders , final String iResponseCharSet , final String iServerInfo , final String iSessionId , final String iCallbackFunction , final boolean iKeepAlive ) { } public void send ( final int iCode , final String iReason , final String iContentType , final Object iContent , final String iHeaders ) throws IOException { } public void writeStatus ( final int iStatus , final String iReason ) throws IOException { } public void writeHeaders ( final String iContentType ) throws IOException { } public void writeHeaders ( final String iContentType , final boolean iKeepAlive ) throws IOException { } public void writeLine ( final String iContent ) throws IOException { } public void writeContent ( final String iContent ) throws IOException { } public void writeResult ( Object iResult ) throws IOException , InterruptedException { } public void writeResult ( Object iResult , final String iFormat , final String iAccept ) throws IOException , InterruptedException { } public void writeResult ( Object iResult , final String iFormat , final String iAccept , final Map < String , Object > iAdditionalProperties ) throws IOException , InterruptedException { } public void writeRecords ( final Object iRecords ) throws IOException { } public void writeRecords ( final Object iRecords , final String iFetchPlan ) throws IOException { } public void writeRecords ( final Object iRecords , final String iFetchPlan , String iFormat , final String accept ) throws IOException { } public void writeRecords ( final Object iRecords , final String iFetchPlan , String iFormat , final String accept , final Map < String , Object > iAdditionalProperties ) throws IOException { } public void formatMultiValue ( final Iterator < ? > iIterator , final StringWriter buffer , final String format ) throws IOException { } public void writeRecord ( final ORecord iRecord ) throws IOException { } public void writeRecord ( final ORecord iRecord , final String iFetchPlan , String iFormat ) throws IOException { } public void sendStream ( final int iCode , final String iReason , final String iContentType , InputStream iContent , long iSize ) throws IOException { } public void sendStream ( final int iCode , final String iReason , final String iContentType , InputStream iContent , long iSize , final String iFileName ) throws IOException { } public void sendStream ( final int iCode , final String iReason , final String iContentType , final String iFileName , final OCallable < Void , OChunkedResponse > iWriter ) throws IOException { } public byte [ ] compress ( String jsonStr ) { } public void setHeader ( final String iHeader ) { } public OutputStream getOutputStream ( ) { } public void flush ( ) throws IOException { out . flush ( ) ; <START_BUG> if ( keepAlive ) { <END_BUG> out . close ( ) ; } } public String getContentType ( ) { } public void setContentType ( String contentType ) { } public String getContentEncoding ( ) { } public void setContentEncoding ( String contentEncoding ) { } public void setSessionId ( String sessionId ) { } public String getContent ( ) { } public void setContent ( String content ) { } public int getCode ( ) { } public void setCode ( int code ) { } private String keyFromMapObject ( Object key ) { } }

Fix:
if ( ! ( keepAlive ) ) {