Program: 83951
Project: 83951
Buggy source:
public void sendResponse(HttpExchange exchange,int errorCode,String response,boolean internalCall,JSONObject internalResp){
  OutputStream responseBody=null;
  GZIPOutputStream gzipos=null;
  try {
    if (internalCall) {
      copyResponse(response,internalResp);
      return;
    }
    logger.info("String_Node_Str" + response);
    JSONObject header=exchangeJSON.getJSONObject("String_Node_Str");
    boolean gzipResp=header.containsKey("String_Node_Str") && header.getJSONArray("String_Node_Str").getString(0).contains("String_Node_Str");
    Headers responseHeaders=exchange.getResponseHeaders();
    responseHeaders.set("String_Node_Str","String_Node_Str");
    responseHeaders.set("String_Node_Str","String_Node_Str");
    if (gzipResp)     responseHeaders.set("String_Node_Str","String_Node_Str");
    exchange.sendResponseHeaders(errorCode,0);
    responseBody=exchange.getResponseBody();
    if (response != null) {
      if (gzipResp) {
        gzipos=new GZIPOutputStream(responseBody);
        gzipos.write(response.getBytes());
        gzipos.close();
      }
 else {
        responseBody.write(response.getBytes());
        responseBody.close();
      }
    }
    sfsStats.docSent(response);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
 finally {
    if (!internalCall) {
      try {
        if (responseBody != null) {
          responseBody.close();
          logger.info("String_Node_Str");
        }
        if (exchange != null) {
          exchange.getResponseBody().close();
          logger.info("String_Node_Str" + exchange.getLocalAddress().getHostName() + "String_Node_Str"+ exchange.getLocalAddress().getPort()+ "String_Node_Str"+ exchange.getRemoteAddress());
          exchange.close();
        }
        exchange=null;
      }
 catch (      Exception e) {
        logger.log(Level.WARNING,"String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
public void sendResponse(HttpExchange exchange,int errorCode,String response,boolean internalCall,JSONObject internalResp){
  OutputStream responseBody=null;
  GZIPOutputStream gzipos=null;
  try {
    if (internalCall) {
      copyResponse(response,internalResp);
      return;
    }
    logger.info("String_Node_Str" + response);
    logger.info(exchangeJSON.toString());
    JSONObject header=exchangeJSON.getJSONObject("String_Node_Str");
    boolean gzipResp=header.containsKey("String_Node_Str") && header.getJSONArray("String_Node_Str").getString(0).contains("String_Node_Str");
    Headers responseHeaders=exchange.getResponseHeaders();
    responseHeaders.set("String_Node_Str","String_Node_Str");
    responseHeaders.set("String_Node_Str","String_Node_Str");
    if (gzipResp)     responseHeaders.set("String_Node_Str","String_Node_Str");
    exchange.sendResponseHeaders(errorCode,0);
    responseBody=exchange.getResponseBody();
    if (response != null) {
      if (gzipResp) {
        gzipos=new GZIPOutputStream(responseBody);
        gzipos.write(response.getBytes());
        gzipos.close();
      }
 else {
        responseBody.write(response.getBytes());
        responseBody.close();
      }
    }
    sfsStats.docSent(response);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
 finally {
    if (!internalCall) {
      try {
        if (responseBody != null) {
          responseBody.close();
          logger.info("String_Node_Str");
        }
        if (exchange != null) {
          exchange.getResponseBody().close();
          logger.info("String_Node_Str" + exchange.getLocalAddress().getHostName() + "String_Node_Str"+ exchange.getLocalAddress().getPort()+ "String_Node_Str"+ exchange.getRemoteAddress());
          exchange.close();
        }
        exchange=null;
      }
 catch (      Exception e) {
        logger.log(Level.WARNING,"String_Node_Str",e);
      }
    }
    exchangeJSON.clear();
  }
}