Program: 94278
Project: 94278
Buggy source:
/** 
 * Calls the Rest service with given URL of IRestCall. The returned value is the response body as an InputStream.
 * @param call The remote call to make.  Must not be <code>null</code>.
 * @param callable The callable with default parameters to use to make the call.
 * @return The InputStream of the response body or <code>null</code> if anerror occurs.
 */
protected Object invokeRemoteCall(final IRemoteCall call,final IRemoteCallable callable) throws ECFException {
  String uri=prepareEndpointAddress(call,callable);
  HttpMethod httpMethod=createAndPrepareHttpMethod(uri,call,callable);
  String responseBody=null;
  int responseCode=-1;
  try {
    responseCode=httpClient.executeMethod(httpMethod);
    if (responseCode == HttpStatus.SC_OK) {
      byte[] responseBytes=httpMethod.getResponseBody();
      String responseCharSet=null;
      if (httpMethod instanceof HttpMethodBase) {
        HttpMethodBase methodBase=(HttpMethodBase)httpMethod;
        responseCharSet=methodBase.getRequestCharSet();
      }
      responseBody=getResponseAsString(responseBytes,responseCharSet);
    }
 else     handleException("String_Node_Str" + uri + "String_Node_Str"+ new Integer(responseCode),null,responseCode);
  }
 catch (  HttpException e) {
    handleException("String_Node_Str",e,responseCode);
  }
catch (  IOException e) {
    handleException("String_Node_Str",e,responseCode);
  }
  Object result=null;
  try {
    result=processResponse(uri,call,callable,convertResponseHeaders(httpMethod.getResponseHeaders()),responseBody);
  }
 catch (  NotSerializableException e) {
    handleException("String_Node_Str" + uri + "String_Node_Str"+ new Integer(responseCode),e,responseCode);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Calls the Rest service with given URL of IRestCall. The returned value is the response body as an InputStream.
 * @param call The remote call to make.  Must not be <code>null</code>.
 * @param callable The callable with default parameters to use to make the call.
 * @return The InputStream of the response body or <code>null</code> if anerror occurs.
 */
protected Object invokeRemoteCall(final IRemoteCall call,final IRemoteCallable callable) throws ECFException {
  String uri=prepareEndpointAddress(call,callable);
  HttpMethod httpMethod=createAndPrepareHttpMethod(uri,call,callable);
  String responseBody=null;
  int responseCode=-1;
  try {
    responseCode=httpClient.executeMethod(httpMethod);
    if (isResponseOk(responseCode)) {
      byte[] responseBytes=httpMethod.getResponseBody();
      String responseCharSet=null;
      if (httpMethod instanceof HttpMethodBase) {
        HttpMethodBase methodBase=(HttpMethodBase)httpMethod;
        responseCharSet=methodBase.getRequestCharSet();
      }
      responseBody=getResponseAsString(responseBytes,responseCharSet);
    }
 else     handleException("String_Node_Str" + uri + "String_Node_Str"+ new Integer(responseCode),null,responseCode);
  }
 catch (  HttpException e) {
    handleException("String_Node_Str",e,responseCode);
  }
catch (  IOException e) {
    handleException("String_Node_Str",e,responseCode);
  }
  Object result=null;
  try {
    result=processResponse(uri,call,callable,convertResponseHeaders(httpMethod.getResponseHeaders()),responseBody);
  }
 catch (  NotSerializableException e) {
    handleException("String_Node_Str" + uri + "String_Node_Str"+ new Integer(responseCode),e,responseCode);
  }
  return result;
}