Buggy code:
public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer { public class GzipGetMethod extends GetMethod { private static final String CONTENT_ENCODING = "Content-Encoding" ; private static final String ACCEPT_ENCODING = "Accept-encoding" ; private static final String CONTENT_ENCODING_GZIP = "gzip" ; private static final String CONTENT_ENCODING_ACCEPTED = HttpClientRetrieveFileTransfer . GzipGetMethod . CONTENT_ENCODING_GZIP ; private boolean gzipReceived = false ; public GzipGetMethod ( String urlString ) { } private boolean isZippedResponse ( ) { } public int execute ( HttpState state , HttpConnection conn ) throws IOException , HttpException { } public InputStream getResponseBodyAsUnzippedStream ( ) throws IOException { } } static final class HostConfigHelper { private ISocketEventSource source ; private ISocketListener socketListener ; private String targetURL ; private String targetPath ; private HostConfiguration hostConfiguration ; public HostConfigHelper ( ISocketEventSource source , ISocketListener socketListener ) { } public HostConfiguration getHostConfiguration ( ) { } public void setTargetHostByURL ( String url ) { } public String getTargetRelativePath ( ) { } } private static final String USERNAME_PREFIX = Messages . HttpClientRetrieveFileTransfer_Username_Prefix ; protected static final int DEFAULT_CONNECTION_TIMEOUT = 120000 ; protected static final int DEFAULT_READ_TIMEOUT = 60000 ; protected static final int HTTP_PORT = 80 ; protected static final int HTTPS_PORT = 443 ; protected static final int MAX_RETRY = 2 ; protected static final String HTTPS = Messages . FileTransferNamespace_Https_Protocol ; protected static final String HTTP = Messages . FileTransferNamespace_Http_Protocol ; protected static final String [ ] supportedProtocols = new String [ ] { HttpClientRetrieveFileTransfer . HTTP , HttpClientRetrieveFileTransfer . HTTPS } ; private static final String LAST_MODIFIED_HEADER = "Last-Modified" ; private HttpClientRetrieveFileTransfer . GzipGetMethod getMethod = null ; private HttpClient httpClient = null ; private String username ; private String password ; private int responseCode = - 1 ; private volatile boolean doneFired = false ; private String remoteFileName ; protected int httpVersion = 1 ; protected IFileID fileid = null ; protected JREProxyHelper proxyHelper = null ; private HttpClientRetrieveFileTransfer . HostConfigHelper hostConfigHelper ; private SocketEventSource socketEventSource ; private ConnectingSocketMonitor connectingSockets ; private FileTransferJob connectJob ; public HttpClientRetrieveFileTransfer ( HttpClient httpClient ) { } public String getRemoteFileName ( ) { } public synchronized void cancel ( ) { } protected void hardClose ( ) { } protected Credentials getFileRequestCredentials ( ) throws IOException , UnsupportedCallbackException { } protected void setupAuthentication ( String urlString ) throws IOException , UnsupportedCallbackException { } protected void setupHostAndPort ( String urlString ) { } protected void setRequestHeaderValues ( ) throws InvalidFileRangeSpecificationException { } private void setRangeHeader ( String value ) { } private boolean isHTTP11 ( ) { } public int getResponseCode ( ) { } public ID getID ( ) { } private long getLastModifiedTimeFromHeader ( ) throws IOException { } protected void getResponseHeaderValues ( ) throws IOException { } final class ECFCredentialsProvider implements CredentialsProvider { public Credentials getCredentials ( AuthScheme scheme , String host , int port , boolean isProxyAuthenticating ) throws CredentialsNotAvailableException { } } Proxy getProxy ( ) { } protected void setInputStream ( InputStream ins ) { } protected InputStream wrapTransferReadInputStream ( InputStream inputStream , IProgressMonitor monitor ) { } protected void openStreams ( ) throws IncomingFileTransferException { } private boolean checkAndHandleDone ( ) { } public void setConnectContextForAuthentication ( IConnectContext connectContext ) { } protected static String getHostFromURL ( String url ) { } protected static int getPortFromURL ( String url ) { } protected static String getPathFromURL ( String url ) { } protected static boolean urlUsesHttps ( String url ) { } public static boolean supportsProtocol ( String protocolString ) { } protected boolean isConnected ( ) { } protected boolean doPause ( ) { } protected boolean doResume ( ) { } protected void setResumeRequestHeaderValues ( ) throws IOException { } private boolean openStreamsForResume ( ) { } protected void getResumeResponseHeaderValues ( ) throws IOException { } public Object getAdapter ( Class adapter ) { } private HostConfiguration getHostConfiguration ( ) { } protected void setupProxy ( Proxy proxy ) { if ( proxy . getType ( ) . equals ( Proxy . Type . HTTP ) ) { final ProxyAddress address = proxy . getAddress ( ) ; <START_BUG> getHostConfiguration ( ) . setProxy ( HttpClientRetrieveFileTransfer . getHostFromURL ( address . getHostName ( ) ) , address . getPort ( ) ) ; <END_BUG> final String proxyUsername = proxy . getUsername ( ) ; final String proxyPassword = proxy . getPassword ( ) ; if ( proxyUsername != null ) { final Credentials credentials = new UsernamePasswordCredentials ( proxyUsername , proxyPassword ) ; final AuthScope proxyAuthScope = new AuthScope ( address . getHostName ( ) , address . getPort ( ) , AuthScope . ANY_REALM ) ; Trace . trace ( PLUGIN_ID , ( ( ( "retrieve<seq2seq4repair_space>httpproxy=" + proxyAuthScope ) + ";credentials" ) + credentials ) ) ; httpClient . getState ( ) . setProxyCredentials ( proxyAuthScope , credentials ) ; } } else if ( proxy . getType ( ) . equals ( SOCKS ) ) { Trace . trace ( PLUGIN_ID , ( "retrieve<seq2seq4repair_space>socksproxy=" + ( proxy . getAddress ( ) ) ) ) ; proxyHelper . setupProxy ( proxy ) ; } } protected static NTCredentials createNTLMCredentials ( Proxy p ) { } protected static String getNTLMDomainName ( Proxy p ) { } protected static String getNTLMUserName ( Proxy p ) { } protected void fireConnectStartEvent ( ) { } protected String createConnectJobName ( ) { } protected FileTransferJob prepareConnectJob ( FileTransferJob cjob ) { } protected void connectUsingJob ( FileTransferJob cjob ) { } private IFileTransferRunnable fileConnectRunnable = new IFileTransferRunnable ( ) { public IStatus performFileTransfer ( IProgressMonitor monitor ) { } } ; private IStatus performConnect ( IProgressMonitor monitor ) { } protected void fireReceiveResumedEvent ( ) { } protected void fireTransferReceiveDataEvent ( ) { } protected void fireTransferReceiveDoneEvent ( ) { } protected void fireTransferReceivePausedEvent ( ) { } }

Fix:
getHostConfiguration ( ) . setProxy ( address . getHostName ( ) , address . getPort ( ) ) ;