Program: 35769
Project: 35769
Buggy source:
public HttpClient wrapCachingHttpClient(final HttpClient wrapped){
  return new HttpClientWrapper(wrapped){
    /** 
 * Removes client http cache directives like "Cache-control" and "Pragma". Users must not be able to bypass the cache just by making a refresh in the browser.
 */
    @Override boolean transformRequest(    HttpRequest httpRequest,    HttpContext context){
      return true;
    }
    /** 
 * Restores the real http status code if it has been hidden to HttpCache
 */
    @Override void transformResponse(    HttpRequest httpRequest,    HttpResponse httpResponse,    HttpContext context){
      if (httpRequest.getRequestLine().getMethod().equalsIgnoreCase("String_Node_Str") && (staleWhileRevalidate > 0 || staleIfError > 0)) {
        httpResponse.removeHeader(httpResponse.getLastHeader("String_Node_Str"));
      }
      if (xCacheHeader) {
        if (context != null) {
          CacheResponseStatus cacheResponseStatus=(CacheResponseStatus)context.getAttribute(CachingHttpClient.CACHE_RESPONSE_STATUS);
          HttpHost host=(HttpHost)context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
          String xCacheString;
          if (cacheResponseStatus.equals(CacheResponseStatus.CACHE_HIT))           xCacheString="String_Node_Str";
 else           if (cacheResponseStatus.equals(CacheResponseStatus.VALIDATED))           xCacheString="String_Node_Str";
 else           xCacheString="String_Node_Str";
          xCacheString+="String_Node_Str" + host.toHostString();
          xCacheString+="String_Node_Str" + httpRequest.getRequestLine().getMethod() + "String_Node_Str"+ httpRequest.getRequestLine().getUri()+ "String_Node_Str";
          httpResponse.addHeader("String_Node_Str",xCacheString);
        }
      }
      HttpEntity entity=httpResponse.getEntity();
      if (entity != null && entity.getContentLength() == 0) {
        try {
          EntityUtils.consume(entity);
        }
 catch (        IOException e) {
        }
        httpResponse.setEntity(null);
      }
      if (!viaHeader && httpResponse.containsHeader("String_Node_Str")) {
        httpResponse.removeHeaders("String_Node_Str");
      }
    }
  }
;
}

Fixed version (ground truth):
public HttpClient wrapCachingHttpClient(final HttpClient wrapped){
  return new HttpClientWrapper(wrapped){
    /** 
 * Removes client http cache directives like "Cache-control" and "Pragma". Users must not be able to bypass the cache just by making a refresh in the browser.
 */
    @Override boolean transformRequest(    HttpRequest httpRequest,    HttpContext context){
      return true;
    }
    /** 
 * Restores the real http status code if it has been hidden to HttpCache
 */
    @Override void transformResponse(    HttpRequest httpRequest,    HttpResponse httpResponse,    HttpContext context){
      if (httpRequest.getRequestLine().getMethod().equalsIgnoreCase("String_Node_Str") && (staleWhileRevalidate > 0 || staleIfError > 0)) {
        httpResponse.removeHeader(httpResponse.getLastHeader("String_Node_Str"));
      }
      if (xCacheHeader) {
        if (context != null) {
          CacheResponseStatus cacheResponseStatus=(CacheResponseStatus)context.getAttribute(CachingHttpClient.CACHE_RESPONSE_STATUS);
          HttpHost host=(HttpHost)context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
          String xCacheString;
          if (cacheResponseStatus.equals(CacheResponseStatus.CACHE_HIT))           xCacheString="String_Node_Str";
 else           if (cacheResponseStatus.equals(CacheResponseStatus.VALIDATED))           xCacheString="String_Node_Str";
 else           xCacheString="String_Node_Str";
          xCacheString+="String_Node_Str" + host.toHostString();
          xCacheString+="String_Node_Str" + httpRequest.getRequestLine().getMethod() + "String_Node_Str"+ httpRequest.getRequestLine().getUri()+ "String_Node_Str";
          httpResponse.addHeader("String_Node_Str",xCacheString);
        }
      }
      if (!viaHeader && httpResponse.containsHeader("String_Node_Str")) {
        httpResponse.removeHeaders("String_Node_Str");
      }
    }
  }
;
}