Program: 63055
Project: 63055
Buggy source:
@Override public HttpResponse execute(HttpRequest request) throws HttpClientException {
  HttpResponse response=null;
  try {
    URI uri=new URI(request.getURI().toString(),false,Consts.UTF_8.name());
    org.apache.commons.httpclient.HttpMethod httpMethod=method2method(request.getMethod());
    if (request.getMethod() == HttpMethod.TRACE) {
      httpMethod=new TraceMethod(uri.getEscapedURI());
    }
 else {
      httpMethod.setURI(uri);
    }
    boolean useSSL="String_Node_Str".equals(uri.getScheme());
    SSLContext sslContext=null;
    HttpParams params=request.getParams();
    if (params != null) {
      Proxy proxy=params.getProxy();
      if (proxy != null) {
        InetSocketAddress socketAddress=(InetSocketAddress)proxy.address();
        httpClient.getHostConfiguration().setProxy(socketAddress.getHostName(),socketAddress.getPort());
        useSSL=false;
      }
      sslContext=params.getSSLContext();
      httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(params.getConnectTimeout());
      httpClient.getHttpConnectionManager().getParams().setSendBufferSize(params.getChunkSize());
      httpMethod.getParams().setUriCharset(Consts.UTF_8.name());
      httpMethod.getParams().setSoTimeout(params.getSocketTimeout());
      httpMethod.getParams().setContentCharset(Consts.UTF_8.name());
    }
    if (useSSL) {
      if (sslContext == null) {
        sslContext=HttpClientFactory.allowSSLContext();
      }
      Protocol.registerProtocol("String_Node_Str",new Protocol("String_Node_Str",new SSLProtocolSocketFactory(sslContext),443));
    }
    com.foxinmy.weixin4j.http.HttpHeaders headers=request.getHeaders();
    if (headers == null) {
      headers=new HttpHeaders();
    }
    if (!headers.containsKey(HttpHeaders.HOST)) {
      headers.set(HttpHeaders.HOST,uri.getHost());
    }
    if (!headers.containsKey(HttpHeaders.ACCEPT)) {
      headers.set(HttpHeaders.ACCEPT,"String_Node_Str");
    }
    if (!headers.containsKey(HttpHeaders.USER_AGENT)) {
      headers.set(HttpHeaders.USER_AGENT,"String_Node_Str");
    }
    for (Iterator<Entry<String,List<String>>> headerIterator=headers.entrySet().iterator(); headerIterator.hasNext(); ) {
      Entry<String,List<String>> header=headerIterator.next();
      if (HttpHeaders.COOKIE.equalsIgnoreCase(header.getKey())) {
        httpMethod.setRequestHeader(header.getKey(),StringUtil.join(header.getValue(),';'));
      }
 else {
        for (        String headerValue : header.getValue()) {
          httpMethod.addRequestHeader(header.getKey(),headerValue != null ? headerValue : "String_Node_Str");
        }
      }
    }
    HttpEntity entity=request.getEntity();
    if (entity != null) {
      if (entity.getContentLength() > 0l) {
        httpMethod.addRequestHeader(HttpHeaders.CONTENT_LENGTH,Long.toString(entity.getContentLength()));
      }
      if (entity.getContentType() != null) {
        httpMethod.addRequestHeader(HttpHeaders.CONTENT_TYPE,entity.getContentType().toString());
      }
      RequestEntity requestEntity=null;
      if (entity instanceof MultipartEntity) {
        ByteArrayOutputStream os=new ByteArrayOutputStream();
        entity.writeTo(os);
        os.flush();
        requestEntity=new ByteArrayRequestEntity(os.toByteArray(),entity.getContentType().toString());
        os.close();
      }
 else {
        requestEntity=new InputStreamRequestEntity(entity.getContent(),entity.getContentType().toString());
      }
      ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
    }
    httpClient.executeMethod(httpMethod);
    response=new HttpComponent3Response(httpMethod);
    handleResponse(response);
  }
 catch (  IOException e) {
    throw new HttpClientException("String_Node_Str" + request.getMethod().name() + "String_Node_Str"+ request.getURI().toString()+ "String_Node_Str"+ e.getMessage(),e);
  }
 finally {
    if (response != null) {
      response.close();
    }
  }
  return response;
}

Fixed version (ground truth):
@Override public HttpResponse execute(HttpRequest request) throws HttpClientException {
  HttpResponse response=null;
  try {
    org.apache.commons.httpclient.HttpMethod httpMethod=createHttpMethod(request.getMethod(),request.getURI());
    boolean useSSL="String_Node_Str".equals(request.getURI().getScheme());
    SSLContext sslContext=null;
    HttpParams params=request.getParams();
    if (params != null) {
      Proxy proxy=params.getProxy();
      if (proxy != null) {
        InetSocketAddress socketAddress=(InetSocketAddress)proxy.address();
        httpClient.getHostConfiguration().setProxy(socketAddress.getHostName(),socketAddress.getPort());
        useSSL=false;
      }
      sslContext=params.getSSLContext();
      httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(params.getConnectTimeout());
      httpClient.getHttpConnectionManager().getParams().setSendBufferSize(params.getChunkSize());
      httpMethod.getParams().setUriCharset(Consts.UTF_8.name());
      httpMethod.getParams().setSoTimeout(params.getSocketTimeout());
      httpMethod.getParams().setContentCharset(Consts.UTF_8.name());
    }
    if (useSSL) {
      if (sslContext == null) {
        sslContext=HttpClientFactory.allowSSLContext();
      }
      Protocol.registerProtocol("String_Node_Str",new Protocol("String_Node_Str",new SSLProtocolSocketFactory(sslContext),443));
    }
    com.foxinmy.weixin4j.http.HttpHeaders headers=request.getHeaders();
    if (headers == null) {
      headers=new HttpHeaders();
    }
    if (!headers.containsKey(HttpHeaders.HOST)) {
      headers.set(HttpHeaders.HOST,request.getURI().getHost());
    }
    if (!headers.containsKey(HttpHeaders.ACCEPT)) {
      headers.set(HttpHeaders.ACCEPT,"String_Node_Str");
    }
    if (!headers.containsKey(HttpHeaders.USER_AGENT)) {
      headers.set(HttpHeaders.USER_AGENT,"String_Node_Str");
    }
    for (Iterator<Entry<String,List<String>>> headerIterator=headers.entrySet().iterator(); headerIterator.hasNext(); ) {
      Entry<String,List<String>> header=headerIterator.next();
      if (HttpHeaders.COOKIE.equalsIgnoreCase(header.getKey())) {
        httpMethod.setRequestHeader(header.getKey(),StringUtil.join(header.getValue(),';'));
      }
 else {
        for (        String headerValue : header.getValue()) {
          httpMethod.addRequestHeader(header.getKey(),headerValue != null ? headerValue : "String_Node_Str");
        }
      }
    }
    HttpEntity entity=request.getEntity();
    if (entity != null) {
      if (entity.getContentLength() > 0l) {
        httpMethod.addRequestHeader(HttpHeaders.CONTENT_LENGTH,Long.toString(entity.getContentLength()));
      }
      if (entity.getContentType() != null) {
        httpMethod.addRequestHeader(HttpHeaders.CONTENT_TYPE,entity.getContentType().toString());
      }
      RequestEntity requestEntity=null;
      if (entity instanceof MultipartEntity) {
        ByteArrayOutputStream os=new ByteArrayOutputStream();
        entity.writeTo(os);
        os.flush();
        requestEntity=new ByteArrayRequestEntity(os.toByteArray(),entity.getContentType().toString());
        os.close();
      }
 else {
        requestEntity=new InputStreamRequestEntity(entity.getContent(),entity.getContentType().toString());
      }
      ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
    }
    httpClient.executeMethod(httpMethod);
    response=new HttpComponent3Response(httpMethod);
    handleResponse(response);
  }
 catch (  IOException e) {
    throw new HttpClientException("String_Node_Str" + request.getMethod().name() + "String_Node_Str"+ request.getURI().toString()+ "String_Node_Str"+ e.getMessage(),e);
  }
 finally {
    if (response != null) {
      response.close();
    }
  }
  return response;
}