Program: 33254
Project: 33254
Buggy source:
protected Document request(Document document) throws GerbilException {
  document.setDocumentURI(DOCUMENT_URI + documentCount);
  ++documentCount;
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  String nifDocument=nifCreator.getDocumentAsNIFString(document);
  HttpEntity entity=new StringEntity(nifDocument,"String_Node_Str");
  HttpPost request=createPostRequest(url);
  request.setEntity(entity);
  request.addHeader("String_Node_Str",nifCreator.getHttpContentType() + "String_Node_Str");
  request.addHeader("String_Node_Str",nifParser.getHttpContentType() + "String_Node_Str");
  entity=null;
  CloseableHttpResponse response=null;
  try {
    try {
      response=client.execute(request);
    }
 catch (    java.net.SocketException e) {
      if (e.getMessage().contains(CONNECTION_ABORT_INDICATING_EXCPETION_MSG)) {
        LOGGER.error("String_Node_Str");
        throw new GerbilException("String_Node_Str",e,ErrorTypes.ANNOTATOR_NEEDED_TOO_MUCH_TIME);
      }
 else {
        LOGGER.error("String_Node_Str",e);
        throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
      }
    }
catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    StatusLine status=response.getStatusLine();
    if ((status.getStatusCode() < 200) || (status.getStatusCode() >= 300)) {
      LOGGER.error("String_Node_Str" + status.toString());
      throw new GerbilException("String_Node_Str" + status.toString(),ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    entity=response.getEntity();
    try {
      document=nifParser.getDocumentFromNIFStream(entity.getContent());
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  return document;
}

Fixed version (ground truth):
protected Document request(Document document) throws GerbilException {
  document.setDocumentURI(DOCUMENT_URI + documentCount);
  ++documentCount;
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  String nifDocument=nifCreator.getDocumentAsNIFString(document);
  HttpEntity entity=new StringEntity(nifDocument,"String_Node_Str");
  HttpPost request=createPostRequest(url);
  request.setEntity(entity);
  request.addHeader(HttpHeaders.CONTENT_TYPE,nifCreator.getHttpContentType() + "String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT,nifParser.getHttpContentType());
  request.addHeader(HttpHeaders.ACCEPT_CHARSET,"String_Node_Str");
  entity=null;
  CloseableHttpResponse response=null;
  try {
    try {
      response=client.execute(request);
    }
 catch (    java.net.SocketException e) {
      if (e.getMessage().contains(CONNECTION_ABORT_INDICATING_EXCPETION_MSG)) {
        LOGGER.error("String_Node_Str");
        throw new GerbilException("String_Node_Str",e,ErrorTypes.ANNOTATOR_NEEDED_TOO_MUCH_TIME);
      }
 else {
        LOGGER.error("String_Node_Str",e);
        throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
      }
    }
catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    StatusLine status=response.getStatusLine();
    if ((status.getStatusCode() < 200) || (status.getStatusCode() >= 300)) {
      LOGGER.error("String_Node_Str" + status.toString());
      throw new GerbilException("String_Node_Str" + status.toString(),ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    entity=response.getEntity();
    try {
      document=nifParser.getDocumentFromNIFStream(entity.getContent());
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  return document;
}