Program: 35158
Project: 35158
Buggy source:
/** 
 * Posts the given String to the given TestRails end-point
 * @param apiCall The end-point that expects to receive the entities (e.g. "add_result")
 * @param urlParams The remainder of the URL required for the POST. It is up to you to get this part right
 * @param entity The BaseEntity object to use at the POST body
 * @param returnEntityType The Class of the return type you wish to receive (helps avoid casting from the calling method)
 * @return The Content of the HTTP Response
 */
private <T extends BaseEntity>T postRESTBodyReturn(String apiCall,String urlParams,BaseEntity entity,Class<T> returnEntityType){
  HttpClient httpClient=new DefaultHttpClient();
  String completeUrl=buildRequestURL(apiCall,urlParams);
  try {
    HttpPost request=new HttpPost(completeUrl);
    String authentication=HTTPUtils.encodeAuthenticationBase64(username,password);
    request.addHeader("String_Node_Str","String_Node_Str" + authentication);
    request.addHeader("String_Node_Str","String_Node_Str");
    ObjectMapper mapper=new ObjectMapper();
    mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
    String body=mapper.writeValueAsString(entity);
    request.setEntity(new StringEntity(body));
    HttpResponse response=httpClient.execute(request);
    if (response.getStatusLine().getStatusCode() != 200) {
      Error error=JSONUtils.getMappedJsonObject(Error.class,utils.getContentsFromHttpResponse(response));
      log.error("String_Node_Str",response.getStatusLine().getStatusCode());
      log.error("String_Node_Str",error.getError());
    }
 else     if (response.getStatusLine().getStatusCode() == 200) {
      log.info("String_Node_Str");
      return JSONUtils.getMappedJsonObject(returnEntityType,utils.getContentsFromHttpResponse(response));
    }
 else {
      log.error("String_Node_Str");
    }
  }
 catch (  IOException e) {
    log.error(String.format("String_Node_Str",completeUrl),e);
    throw new RuntimeException(String.format("String_Node_Str",completeUrl),e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Posts the given String to the given TestRails end-point
 * @param apiCall The end-point that expects to receive the entities (e.g. "add_result")
 * @param urlParams The remainder of the URL required for the POST. It is up to you to get this part right
 * @param entity The BaseEntity object to use at the POST body
 * @param returnEntityType The Class of the return type you wish to receive (helps avoid casting from the calling method)
 * @return The Content of the HTTP Response
 */
private <T extends BaseEntity>T postRESTBodyReturn(String apiCall,String urlParams,BaseEntity entity,Class<T> returnEntityType){
  HttpClient httpClient=new DefaultHttpClient();
  String completeUrl=buildRequestURL(apiCall,urlParams);
  try {
    HttpPost request=new HttpPost(completeUrl);
    String authentication=HTTPUtils.encodeAuthenticationBase64(username,password);
    request.addHeader("String_Node_Str","String_Node_Str" + authentication);
    request.addHeader("String_Node_Str","String_Node_Str");
    request.addHeader("String_Node_Str","String_Node_Str");
    ObjectMapper mapper=new ObjectMapper();
    mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
    byte[] body=mapper.writeValueAsBytes(entity);
    request.setEntity(new ByteArrayEntity(body));
    HttpResponse response=httpClient.execute(request);
    if (response.getStatusLine().getStatusCode() != 200) {
      Error error=JSONUtils.getMappedJsonObject(Error.class,utils.getContentsFromHttpResponse(response));
      log.error("String_Node_Str",response.getStatusLine().getStatusCode());
      log.error("String_Node_Str",error.getError());
    }
 else     if (response.getStatusLine().getStatusCode() == 200) {
      log.info("String_Node_Str");
      return JSONUtils.getMappedJsonObject(returnEntityType,utils.getContentsFromHttpResponse(response));
    }
 else {
      log.error("String_Node_Str");
    }
  }
 catch (  IOException e) {
    log.error(String.format("String_Node_Str",completeUrl),e);
    throw new RuntimeException(String.format("String_Node_Str",completeUrl),e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
  return null;
}