Program: 13664
Project: 13664
Buggy source:
private String sendRequest(String httpMethod,String action,Request request) throws QingCloudClientException, QingCloudServiceException, IOException {
  Map<String,String> parameters=request.toMap();
  addCommonParams(httpMethod,action,parameters);
  for (  Map.Entry<String,String> entry : parameters.entrySet()) {
    String key=entry.getKey();
    String value=entry.getValue();
    if (DEBUG)     System.out.println(String.format("String_Node_Str",key,value));
  }
  InputStream content=null;
  HttpURLConnection connection=null;
  try {
    String query=paramsToQueryString(parameters);
    URL url=new URL(ENDPOINT + "String_Node_Str" + query);
    if (DEBUG)     System.out.println("String_Node_Str" + url);
    connection=(HttpURLConnection)url.openConnection();
    connection.connect();
    int code=connection.getResponseCode();
    if (DEBUG)     System.out.println("String_Node_Str" + code);
    if (code >= 400) {
      content=connection.getErrorStream();
      String message=readContent(content);
      QingCloudServiceException exception=new QingCloudServiceException(message);
      exception.setServiceName(action);
      exception.setStatusCode(code);
      throw exception;
    }
 else {
      content=connection.getInputStream();
      String message=readContent(content);
      if (DEBUG)       System.out.println("String_Node_Str" + message);
      Response response=Response.fromJson(message);
      int retCode=response.getRet_code();
      if (retCode != 0) {
        String errorMessage=response.getMessage();
        if (retCode >= 5000) {
          QingCloudServiceException exception=new QingCloudServiceException(errorMessage);
          exception.setServiceName(action);
          exception.setStatusCode(code);
          exception.setErrorCode(retCode);
          exception.setErrorMessage(errorMessage);
          throw exception;
        }
 else {
          QingCloudClientException exception=new QingCloudClientException(errorMessage);
          exception.setServiceName(action);
          exception.setErrorCode(retCode);
          exception.setErrorMessage(errorMessage);
          throw exception;
        }
      }
      return message;
    }
  }
 catch (  IOException e) {
    throw e;
  }
 finally {
    safeClose(content);
    connection.disconnect();
  }
}

Fixed version (ground truth):
private String sendRequest(String httpMethod,String action,Request request) throws QingCloudClientException, QingCloudServiceException, IOException {
  Map<String,String> parameters=request.toMap();
  addCommonParams(httpMethod,action,parameters);
  for (  Map.Entry<String,String> entry : parameters.entrySet()) {
    String key=entry.getKey();
    String value=entry.getValue();
    if (DEBUG)     System.out.println(String.format("String_Node_Str",key,value));
  }
  InputStream content=null;
  HttpURLConnection connection=null;
  try {
    String query=paramsToQueryString(parameters);
    URL url=new URL(ENDPOINT + "String_Node_Str" + query);
    if (DEBUG)     System.out.println("String_Node_Str" + url);
    connection=(HttpURLConnection)url.openConnection();
    connection.connect();
    int code=connection.getResponseCode();
    if (DEBUG)     System.out.println("String_Node_Str" + code);
    if (code >= 400) {
      content=connection.getErrorStream();
      String message=readContent(content);
      QingCloudServiceException exception=new QingCloudServiceException(message);
      exception.setServiceName(action);
      exception.setStatusCode(code);
      throw exception;
    }
 else {
      content=connection.getInputStream();
      String message=readContent(content);
      if (DEBUG)       System.out.println("String_Node_Str" + message);
      Response response=Response.fromJson(message);
      int retCode=response.getRet_code();
      if (retCode != 0) {
        String errorMessage=response.getMessage();
        if (retCode >= 5000) {
          QingCloudServiceException exception=new QingCloudServiceException(errorMessage);
          exception.setServiceName(action);
          exception.setStatusCode(code);
          exception.setErrorCode(retCode);
          exception.setErrorMessage(errorMessage);
          throw exception;
        }
 else {
          QingCloudClientException exception=new QingCloudClientException(errorMessage);
          exception.setServiceName(action);
          exception.setErrorCode(retCode);
          exception.setErrorMessage(errorMessage);
          throw exception;
        }
      }
      return message;
    }
  }
 catch (  IOException e) {
    throw e;
  }
 finally {
    safeClose(content);
  }
}