Program: 116896
Project: 116896
Buggy source:
/** 
 * Sets up the given   {@link org.apache.commons.httpclient.methods.PostMethod} to send the same standard POST dataas was sent in the given  {@link HttpServletRequest}
 * @param methodProxyRequest The {@link org.apache.commons.httpclient.methods.PostMethod} that we are configuring to send astandard POST request
 * @param httpServletRequest The {@link HttpServletRequest} that contains the POST data tobe sent via the  {@link org.apache.commons.httpclient.methods.PostMethod}
 * @param history            The {@link com.groupon.odo.proxylib.models.History} log for this request
 */
@SuppressWarnings("String_Node_Str") public static void handleStandardPost(EntityEnclosingMethod methodProxyRequest,HttpServletRequest httpServletRequest,History history) throws Exception {
  String deserialisedMessages="String_Node_Str";
  byte[] requestByteArray=null;
  StringBuilder requestBody=new StringBuilder();
  InputStream body=httpServletRequest.getInputStream();
  java.util.Scanner s=new java.util.Scanner(body).useDelimiter("String_Node_Str");
  if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_FORM_URLENCODED)) {
    Map<String,String[]> mapPostParameters=HttpUtilities.mapUrlEncodedParameters(httpServletRequest);
    for (    String stringParameterName : mapPostParameters.keySet()) {
      String[] stringArrayParameterValues=mapPostParameters.get(stringParameterName);
      for (      String stringParameterValue : stringArrayParameterValues) {
        if (requestBody.length() > 0) {
          requestBody.append("String_Node_Str");
        }
        requestBody.append(stringParameterName);
        if (stringParameterValue.length() > 0) {
          requestBody.append("String_Node_Str");
          requestBody.append(stringParameterValue);
        }
      }
    }
  }
 else   if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_MESSAGEPACK)) {
    MessagePack msgpack=new MessagePack();
    requestByteArray=IOUtils.toByteArray(body);
    ByteArrayInputStream byteArrayIS=new ByteArrayInputStream(requestByteArray);
    Unpacker unpacker=msgpack.createUnpacker(byteArrayIS);
    for (    Value message : unpacker) {
      deserialisedMessages+=message;
      deserialisedMessages+="String_Node_Str";
    }
  }
 else {
    if (s.hasNext()) {
      requestBody.append(s.next());
    }
  }
  StringRequestEntity stringEntity=new StringRequestEntity(requestBody.toString(),null,null);
  history.setRequestPostData(requestBody.toString());
  methodProxyRequest.setRequestEntity(stringEntity);
  if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_MESSAGEPACK)) {
    history.setRequestPostData(deserialisedMessages);
    ByteArrayRequestEntity byteRequestEntity=new ByteArrayRequestEntity(requestByteArray);
    methodProxyRequest.setRequestEntity(byteRequestEntity);
  }
}

Fixed version (ground truth):
/** 
 * Sets up the given   {@link org.apache.commons.httpclient.methods.PostMethod} to send the same standard POST dataas was sent in the given  {@link HttpServletRequest}
 * @param methodProxyRequest The {@link org.apache.commons.httpclient.methods.PostMethod} that we are configuring to send astandard POST request
 * @param httpServletRequest The {@link HttpServletRequest} that contains the POST data tobe sent via the  {@link org.apache.commons.httpclient.methods.PostMethod}
 * @param history            The {@link com.groupon.odo.proxylib.models.History} log for this request
 */
@SuppressWarnings("String_Node_Str") public static void handleStandardPost(EntityEnclosingMethod methodProxyRequest,HttpServletRequest httpServletRequest,History history) throws Exception {
  String deserialisedMessages="String_Node_Str";
  byte[] requestByteArray=null;
  StringBuilder requestBody=new StringBuilder();
  InputStream body=httpServletRequest.getInputStream();
  RequestEntity requestEntity=null;
  if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_FORM_URLENCODED) && httpServletRequest.getHeader("String_Node_Str") == null) {
    java.util.Scanner s=new java.util.Scanner(body).useDelimiter("String_Node_Str");
    Map<String,String[]> mapPostParameters=HttpUtilities.mapUrlEncodedParameters(httpServletRequest);
    for (    String stringParameterName : mapPostParameters.keySet()) {
      String[] stringArrayParameterValues=mapPostParameters.get(stringParameterName);
      for (      String stringParameterValue : stringArrayParameterValues) {
        if (requestBody.length() > 0) {
          requestBody.append("String_Node_Str");
        }
        requestBody.append(stringParameterName);
        if (stringParameterValue.length() > 0) {
          requestBody.append("String_Node_Str");
          requestBody.append(stringParameterValue);
        }
      }
    }
    StringRequestEntity stringEntity=new StringRequestEntity(requestBody.toString(),null,null);
    requestEntity=stringEntity;
  }
 else   if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_MESSAGEPACK)) {
    MessagePack msgpack=new MessagePack();
    requestByteArray=IOUtils.toByteArray(body);
    ByteArrayInputStream byteArrayIS=new ByteArrayInputStream(requestByteArray);
    Unpacker unpacker=msgpack.createUnpacker(byteArrayIS);
    for (    Value message : unpacker) {
      deserialisedMessages+=message;
      deserialisedMessages+="String_Node_Str";
    }
  }
 else   if (httpServletRequest.getHeader("String_Node_Str") != null) {
    InputStreamRequestEntity ire=new InputStreamRequestEntity(body);
    requestEntity=ire;
    requestBody.append("String_Node_Str");
  }
 else {
    java.util.Scanner s=new java.util.Scanner(body).useDelimiter("String_Node_Str");
    if (s.hasNext()) {
      requestBody.append(s.next());
    }
    StringRequestEntity stringEntity=new StringRequestEntity(requestBody.toString(),null,null);
    requestEntity=stringEntity;
  }
  history.setRequestPostData(requestBody.toString());
  methodProxyRequest.setRequestEntity(requestEntity);
  if (httpServletRequest.getContentType() != null && httpServletRequest.getContentType().contains(STRING_CONTENT_TYPE_MESSAGEPACK)) {
    history.setRequestPostData(deserialisedMessages);
    ByteArrayRequestEntity byteRequestEntity=new ByteArrayRequestEntity(requestByteArray);
    methodProxyRequest.setRequestEntity(byteRequestEntity);
  }
}