Program: 94602
Project: 94602
Buggy source:
private boolean openStreamsForResume(){
  final URL theURL=getRemoteFileURL();
  try {
    remoteFileURL=new URL(theURL.toString());
    final String urlString=getRemoteFileURL().toString();
    httpClient.getHttpConnectionManager().getParams().setSoTimeout(DEFAULT_CONNECTION_TIMEOUT);
    httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
    setupAuthentication(urlString);
    setupHostAndPort(urlString);
    getMethod=new GzipGetMethod(urlString);
    getMethod.setFollowRedirects(true);
    setResumeRequestHeaderValues();
    final int code=httpClient.executeMethod(getMethod);
    if (code == HttpURLConnection.HTTP_PARTIAL || code == HttpURLConnection.HTTP_OK) {
      getResumeResponseHeaderValues();
      setInputStream(((GzipGetMethod)getMethod).getResponseBodyAsUnzippedStream());
      this.paused=false;
      fireReceiveResumedEvent();
    }
 else     if (code == HttpURLConnection.HTTP_NOT_FOUND) {
      getMethod.releaseConnection();
      throw new FileNotFoundException(urlString);
    }
 else     if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) {
      getMethod.getResponseBody();
      getMethod.releaseConnection();
      throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized);
    }
 else     if (code == HttpURLConnection.HTTP_PROXY_AUTH) {
      getMethod.releaseConnection();
      throw new LoginException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required);
    }
 else {
      getMethod.releaseConnection();
      throw new IOException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE,new Integer(code)));
    }
    return true;
  }
 catch (  final Exception e) {
    this.exception=e;
    this.done=true;
    hardClose();
    fireTransferReceiveDoneEvent();
    return false;
  }
}

Fixed version (ground truth):
private boolean openStreamsForResume(){
  final URL theURL=getRemoteFileURL();
  try {
    remoteFileURL=new URL(theURL.toString());
    final String urlString=getRemoteFileURL().toString();
    httpClient.getHttpConnectionManager().getParams().setSoTimeout(DEFAULT_CONNECTION_TIMEOUT);
    httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
    setupAuthentication(urlString);
    setupHostAndPort(urlString);
    getMethod=new GzipGetMethod(urlString);
    getMethod.setFollowRedirects(true);
    setResumeRequestHeaderValues();
    final int code=httpClient.executeMethod(getMethod);
    if (code == HttpURLConnection.HTTP_PARTIAL || code == HttpURLConnection.HTTP_OK) {
      getResumeResponseHeaderValues();
      setInputStream(getMethod.getResponseBodyAsUnzippedStream());
      this.paused=false;
      fireReceiveResumedEvent();
    }
 else     if (code == HttpURLConnection.HTTP_NOT_FOUND) {
      getMethod.releaseConnection();
      throw new FileNotFoundException(urlString);
    }
 else     if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) {
      getMethod.getResponseBody();
      getMethod.releaseConnection();
      throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized);
    }
 else     if (code == HttpURLConnection.HTTP_PROXY_AUTH) {
      getMethod.releaseConnection();
      throw new LoginException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required);
    }
 else {
      getMethod.releaseConnection();
      throw new IOException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE,new Integer(code)));
    }
    return true;
  }
 catch (  final Exception e) {
    this.exception=e;
    this.done=true;
    hardClose();
    fireTransferReceiveDoneEvent();
    return false;
  }
}