Program: 3921
Project: 3921
Buggy source:
/** 
 * Creates an HttpWebRequest instance and initialises it with the appropriate parameters, based on the configuration of this service object.
 * @param url                The URL that the HttpWebRequest should target.
 * @param acceptGzipEncoding If true, ask server for GZip compressed content.
 * @param allowAutoRedirect  If true, redirection response will be automatically followed.
 * @return An initialised instance of HttpWebRequest.
 * @throws microsoft.exchange.webservices.data.exception.ServiceLocalException       the service local exception
 * @throws java.net.URISyntaxException the uRI syntax exception
 */
protected HttpWebRequest prepareHttpWebRequestForUrl(URI url,boolean acceptGzipEncoding,boolean allowAutoRedirect) throws ServiceLocalException, URISyntaxException {
  String scheme=url.getScheme();
  if (!scheme.equalsIgnoreCase(EWSConstants.HTTP_SCHEME) && !scheme.equalsIgnoreCase(EWSConstants.HTTPS_SCHEME)) {
    String strErr=String.format("String_Node_Str",scheme);
    throw new ServiceLocalException(strErr);
  }
  request=new HttpClientWebRequest(httpClient,httpContext);
  try {
    request.setUrl(url.toURL());
  }
 catch (  MalformedURLException e) {
    String strErr=String.format("String_Node_Str",url);
    throw new ServiceLocalException(strErr);
  }
  request.setPreAuthenticate(preAuthenticate);
  request.setTimeout(timeout);
  request.setContentType("String_Node_Str");
  request.setAccept("String_Node_Str");
  request.setUserAgent(userAgent);
  request.setAllowAutoRedirect(allowAutoRedirect);
  request.setAcceptGzipEncoding(acceptGzipEncoding);
  request.setHeaders(getHttpHeaders());
  prepareCredentials(request);
  request.prepareConnection();
  httpResponseHeaders.clear();
  return request;
}

Fixed version (ground truth):
/** 
 * Creates an HttpWebRequest instance and initialises it with the appropriate parameters, based on the configuration of this service object.
 * @param url                The URL that the HttpWebRequest should target.
 * @param acceptGzipEncoding If true, ask server for GZip compressed content.
 * @param allowAutoRedirect  If true, redirection response will be automatically followed.
 * @return An initialised instance of HttpWebRequest.
 * @throws microsoft.exchange.webservices.data.exception.ServiceLocalException       the service local exception
 * @throws java.net.URISyntaxException the uRI syntax exception
 */
protected HttpWebRequest prepareHttpWebRequestForUrl(URI url,boolean acceptGzipEncoding,boolean allowAutoRedirect) throws ServiceLocalException, URISyntaxException {
  String scheme=url.getScheme();
  if (!scheme.equalsIgnoreCase(EWSConstants.HTTP_SCHEME) && !scheme.equalsIgnoreCase(EWSConstants.HTTPS_SCHEME)) {
    String strErr=String.format("String_Node_Str",scheme);
    throw new ServiceLocalException(strErr);
  }
  request=new HttpClientWebRequest(httpClient,httpContext);
  request.setProxy(getWebProxy());
  try {
    request.setUrl(url.toURL());
  }
 catch (  MalformedURLException e) {
    String strErr=String.format("String_Node_Str",url);
    throw new ServiceLocalException(strErr);
  }
  request.setPreAuthenticate(preAuthenticate);
  request.setTimeout(timeout);
  request.setContentType("String_Node_Str");
  request.setAccept("String_Node_Str");
  request.setUserAgent(userAgent);
  request.setAllowAutoRedirect(allowAutoRedirect);
  request.setAcceptGzipEncoding(acceptGzipEncoding);
  request.setHeaders(getHttpHeaders());
  prepareCredentials(request);
  request.prepareConnection();
  httpResponseHeaders.clear();
  return request;
}