Program: 33253
Project: 33253
Buggy source:
protected Document requestAnnotations(Document document) throws GerbilException {
  Document resultDoc=new DocumentImpl(document.getText(),document.getDocumentURI());
  HttpEntity entity=new StringEntity(new JSONObject().put("String_Node_Str",document.getText()).put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString(),ContentType.APPLICATION_JSON);
  HttpPost request=createPostRequest(serviceUrl);
  request.addHeader("String_Node_Str","String_Node_Str");
  request.addHeader("String_Node_Str","String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      String content=IOUtils.toString(entity.getContent(),"String_Node_Str");
      JSONObject outObj=new JSONObject(content);
      if (outObj.has("String_Node_Str")) {
        JSONArray graph=outObj.getJSONArray("String_Node_Str");
        for (int i=0; i < graph.length(); i++) {
          parseType(graph.getJSONObject(i),resultDoc);
        }
      }
 else {
        parseType(outObj,resultDoc);
      }
    }
 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);
  }
  return resultDoc;
}

Fixed version (ground truth):
protected Document requestAnnotations(Document document) throws GerbilException {
  Document resultDoc=new DocumentImpl(document.getText(),document.getDocumentURI());
  HttpEntity entity=new StringEntity(new JSONObject().put("String_Node_Str",document.getText()).put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString(),ContentType.APPLICATION_JSON);
  HttpPost request=createPostRequest(serviceUrl);
  request.addHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT,"String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT_CHARSET,"String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      String content=IOUtils.toString(entity.getContent(),"String_Node_Str");
      JSONObject outObj=new JSONObject(content);
      if (outObj.has("String_Node_Str")) {
        JSONArray graph=outObj.getJSONArray("String_Node_Str");
        for (int i=0; i < graph.length(); i++) {
          parseType(graph.getJSONObject(i),resultDoc);
        }
      }
 else {
        parseType(outObj,resultDoc);
      }
    }
 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);
  }
  return resultDoc;
}