Program: 12379
Project: 12379
Buggy source:
/** 
 * <p> Execute request without returning data from server. </p> <p> Call   {@code responseAsString},   {@code responseAsBytes}, or   {@code responseAsInputStream}after   {@code execute} if the response body is required.</p> <P> Note if the URL contains user information it will be encoded in a BasicAuth header. </P>
 * @return An {@link HttpConnection} which can be used to obtain the response body
 * @throws IOException if there was a problem writing data to the server
 */
public HttpConnection execute() throws IOException {
  boolean retry=true;
  int n=numberOfRetries;
  while (retry && n-- > 0) {
    connection=connectionFactory.openConnection(url);
    connection.setRequestProperty("String_Node_Str",USER_AGENT);
    if (url.getUserInfo() != null) {
      requestInterceptors.add(0,new BasicAuthInterceptor(url.getUserInfo()));
    }
    connection.setDoInput(true);
    connection.setRequestMethod(requestMethod);
    if (contentType != null) {
      connection.setRequestProperty("String_Node_Str",contentType);
    }
    HttpConnectionInterceptorContext currentContext=new HttpConnectionInterceptorContext(this);
    for (    HttpConnectionRequestInterceptor requestInterceptor : requestInterceptors) {
      currentContext=requestInterceptor.interceptRequest(currentContext);
    }
    for (    String key : requestProperties.keySet()) {
      connection.setRequestProperty(key,requestProperties.get(key));
    }
    if (input != null) {
      connection.setDoOutput(true);
      if (inputLength != -1) {
        connection.setFixedLengthStreamingMode((int)this.inputLength);
      }
 else {
        connection.setChunkedStreamingMode(1024);
      }
      InputStream is=input.getInputStream();
      OutputStream os=connection.getOutputStream();
      try {
        IOUtils.copy(is,os);
        os.flush();
      }
  finally {
        IOUtils.closeQuietly(is);
        IOUtils.closeQuietly(os);
      }
    }
    for (    HttpConnectionResponseInterceptor responseInterceptor : responseInterceptors) {
      currentContext=responseInterceptor.interceptResponse(currentContext);
    }
    retry=currentContext.replayRequest;
    if (n == 0) {
      logger.info("String_Node_Str");
    }
  }
  return this;
}

Fixed version (ground truth):
/** 
 * <p> Execute request without returning data from server. </p> <p> Call   {@code responseAsString},   {@code responseAsBytes}, or   {@code responseAsInputStream}after   {@code execute} if the response body is required.</p> <P> Note if the URL contains user information it will be encoded in a BasicAuth header. </P>
 * @return An {@link HttpConnection} which can be used to obtain the response body
 * @throws IOException if there was a problem writing data to the server
 */
public HttpConnection execute() throws IOException {
  boolean retry=true;
  int n=numberOfRetries;
  while (retry && n-- > 0) {
    connection=connectionFactory.openConnection(url);
    connection.setRequestProperty("String_Node_Str",USER_AGENT);
    if (url.getUserInfo() != null) {
      requestInterceptors.add(0,new BasicAuthInterceptor(url.getUserInfo()));
    }
    connection.setDoInput(true);
    connection.setRequestMethod(requestMethod);
    if (contentType != null) {
      connection.setRequestProperty("String_Node_Str",contentType);
    }
    HttpConnectionInterceptorContext currentContext=new HttpConnectionInterceptorContext(this);
    for (    HttpConnectionRequestInterceptor requestInterceptor : requestInterceptors) {
      currentContext=requestInterceptor.interceptRequest(currentContext);
    }
    for (    Map.Entry<String,String> property : requestProperties.entrySet()) {
      connection.setRequestProperty(property.getKey(),property.getValue());
    }
    if (input != null) {
      connection.setDoOutput(true);
      if (inputLength != -1) {
        connection.setFixedLengthStreamingMode((int)this.inputLength);
      }
 else {
        connection.setChunkedStreamingMode(1024);
      }
      InputStream is=input.getInputStream();
      OutputStream os=connection.getOutputStream();
      try {
        IOUtils.copy(is,os);
        os.flush();
      }
  finally {
        IOUtils.closeQuietly(is);
        IOUtils.closeQuietly(os);
      }
    }
    for (    HttpConnectionResponseInterceptor responseInterceptor : responseInterceptors) {
      currentContext=responseInterceptor.interceptResponse(currentContext);
    }
    retry=currentContext.replayRequest;
    if (n == 0) {
      logger.info("String_Node_Str");
    }
  }
  return this;
}