Program: 33169
Project: 33169
Buggy source:
protected Document request(Document document) throws GerbilException {
  document.setDocumentURI(DOCUMENT_URI + documentCount);
  ++documentCount;
  LOGGER.info("String_Node_Str",document.getDocumentURI(),document.getText().length() > 20 ? (document.getText().substring(0,20) + "String_Node_Str") : document.getText());
  String nifDocument=nifCreator.getDocumentAsNIFString(document);
  HttpEntity entity=new StringEntity(nifDocument,"String_Node_Str");
  HttpPost request=null;
  try {
    request=createPostRequest(url);
  }
 catch (  IllegalArgumentException e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  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");
  for (  Header header : getAdditionalHeader()) {
    request.addHeader(header);
  }
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request,true);
    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 {
    closeRequest(request);
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    IOUtils.closeQuietly(response);
  }
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  return document;
}

Fixed version (ground truth):
public Document request(Document document) throws GerbilException {
  document.setDocumentURI(DOCUMENT_URI + documentCount);
  ++documentCount;
  LOGGER.info("String_Node_Str",document.getDocumentURI(),document.getText().length() > 20 ? (document.getText().substring(0,20) + "String_Node_Str") : document.getText());
  String nifDocument=nifCreator.getDocumentAsNIFString(document);
  HttpEntity entity=new StringEntity(nifDocument,"String_Node_Str");
  HttpPost request=null;
  try {
    request=createPostRequest(url);
  }
 catch (  IllegalArgumentException e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  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");
  for (  Header header : getAdditionalHeader()) {
    request.addHeader(header);
  }
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request,true);
    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 {
    closeRequest(request);
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    IOUtils.closeQuietly(response);
  }
  LOGGER.info("String_Node_Str",document.getDocumentURI());
  return document;
}