Program: 116793
Project: 116793
Buggy source:
/** 
 * Handle http post request. Return String
 * @param resourcePath This should be REST endpoint
 * @param jsonParamString The json string which should be executed from the post request
 * @param userName User name for basic auth
 * @param passWord Password for basic auth
 * @return The status of the executed request
 * @throws org.apache.http.client.ClientProtocolException and IOExceptionif any errors occur when executing the request
 */
public String doPost(String resourcePath,String jsonParamString,String userName,String passWord) throws Exception {
  try {
    DefaultHttpClient httpClient=new DefaultHttpClient();
    HttpPost postRequest=new HttpPost(resourcePath);
    StringEntity input=new StringEntity(jsonParamString);
    input.setContentType("String_Node_Str");
    postRequest.setEntity(input);
    String userPass=userName + "String_Node_Str" + passWord;
    String basicAuth="String_Node_Str" + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("String_Node_Str"));
    postRequest.addHeader("String_Node_Str",basicAuth);
    httpClient=(DefaultHttpClient)WebClientWrapper.wrapClient(httpClient);
    HttpResponse response=httpClient.execute(postRequest);
    int responseCode=response.getStatusLine().getStatusCode();
    if (responseCode == CliConstants.RESPONSE_AUTHORIZATION_FAIL) {
      return "String_Node_Str" + CliConstants.RESPONSE_AUTHORIZATION_FAIL;
    }
 else     if (responseCode == CliConstants.RESPONSE_NO_CONTENT) {
      return "String_Node_Str" + CliConstants.RESPONSE_NO_CONTENT;
    }
 else     if (responseCode == CliConstants.RESPONSE_INTERNAL_SERVER_ERROR) {
      return "String_Node_Str" + CliConstants.RESPONSE_INTERNAL_SERVER_ERROR;
    }
 else     if (response.getStatusLine().getStatusCode() != 200) {
      throw new RuntimeException("String_Node_Str" + response.getStatusLine().getStatusCode());
    }
    BufferedReader br=new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
    String output;
    String result="String_Node_Str";
    while ((output=br.readLine()) != null) {
      result+=output;
    }
    httpClient.getConnectionManager().shutdown();
    return result;
  }
 catch (  ClientProtocolException e) {
    throw new ClientProtocolException();
  }
catch (  ConnectException e) {
    throw new ConnectException();
  }
catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Handle http post request. Return String
 * @param resourcePath This should be REST endpoint
 * @param jsonParamString The json string which should be executed from the post request
 * @param userName User name for basic auth
 * @param passWord Password for basic auth
 * @return The status of the executed request
 * @throws org.apache.http.client.ClientProtocolException and IOExceptionif any errors occur when executing the request
 */
public HttpResponse doPost(String resourcePath,String jsonParamString,String userName,String passWord) throws Exception {
  try {
    DefaultHttpClient httpClient=new DefaultHttpClient();
    HttpPost postRequest=new HttpPost(resourcePath);
    StringEntity input=new StringEntity(jsonParamString);
    input.setContentType("String_Node_Str");
    postRequest.setEntity(input);
    String userPass=userName + "String_Node_Str" + passWord;
    String basicAuth="String_Node_Str" + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("String_Node_Str"));
    postRequest.addHeader("String_Node_Str",basicAuth);
    httpClient=(DefaultHttpClient)WebClientWrapper.wrapClient(httpClient);
    HttpResponse response=httpClient.execute(postRequest);
    httpClient.getConnectionManager().shutdown();
    return response;
  }
 catch (  ClientProtocolException e) {
    throw new ClientProtocolException();
  }
catch (  ConnectException e) {
    throw new ConnectException();
  }
catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}