Buggy code:
public abstract class AbstractRetrieveFileTransfer implements IRetrieveFileTransfer , IFileTransferPausable , IIncomingFileTransfer { public static final int DEFAULT_BUF_LENGTH = 4096 ; private static final int FILETRANSFER_ERRORCODE = 1001 ; protected Job job ; protected URL remoteFileURL ; protected IFileID remoteFileID ; protected IFileTransferListener listener ; protected int buff_length = AbstractRetrieveFileTransfer . DEFAULT_BUF_LENGTH ; protected boolean done = false ; protected long bytesReceived = 0 ; protected InputStream remoteFileContents ; protected OutputStream localFileContents ; protected boolean closeOutputStream = true ; protected Exception exception ; protected long fileLength = - 1 ; protected Map options = null ; protected boolean paused = false ; protected IFileRangeSpecification rangeSpecification = null ; protected Proxy proxy ; protected IConnectContext connectContext ; public void setConnectContextForAuthentication ( IConnectContext connectContext ) { } public void setProxy ( Proxy proxy ) { } protected URL getRemoteFileURL ( ) { } protected void setInputStream ( InputStream ins ) { } protected void setOutputStream ( OutputStream outs ) { } protected void setCloseOutputStream ( boolean close ) { } protected void setFileLength ( long length ) { } protected Map getOptions ( ) { } public AbstractRetrieveFileTransfer ( ) { } protected void handleReceivedData ( byte [ ] buf , int bytes , double factor , IProgressMonitor monitor ) throws IOException { } public class FileTransferJob extends Job { public FileTransferJob ( String name ) { } protected IStatus run ( IProgressMonitor monitor ) { } } public ID getID ( ) { } protected IStatus getFinalStatus ( Throwable exception1 ) { } protected void hardClose ( ) { } protected void fireTransferReceivePausedEvent ( ) { } protected void fireTransferReceiveDoneEvent ( ) { } protected void fireTransferReceiveDataEvent ( ) { } public long getBytesReceived ( ) { } public void cancel ( ) { } public Exception getException ( ) { } public double getPercentComplete ( ) { } public boolean isDone ( ) { } public Object getAdapter ( Class adapter ) { } protected abstract void openStreams ( ) throws IncomingFileTransferException { } public void sendRetrieveRequest ( final IFileID remoteFileID1 , IFileTransferListener transferListener , Map options1 ) throws IncomingFileTransferException { } public Namespace getRetrieveNamespace ( ) { } public boolean isPaused ( ) { } protected abstract boolean doPause ( ) { } public boolean pause ( ) { } protected abstract boolean doResume ( ) { } public boolean resume ( ) { } public IFileTransferListener getListener ( ) { } protected void setupAndScheduleJob ( ) { } protected void fireReceiveStartEvent ( ) { } protected void fireReceiveResumedEvent ( ) { } public IFileRangeSpecification getFileRangeSpecification ( ) { } public void sendRetrieveRequest ( IFileID rFileID , IFileRangeSpecification rangeSpec , IFileTransferListener transferListener , Map ops ) throws IncomingFileTransferException { } protected abstract void setupProxy ( Proxy proxy ) { } protected IProxyData selectProxyFromProxies ( String protocol , IProxyData [ ] proxies ) { } protected void setupProxies ( ) { if ( ( proxy ) == null ) { try { IProxyService proxyService = Activator . getDefault ( ) . getProxyService ( ) ; <START_BUG> if ( proxyService != null ) { <END_BUG> URL target = getRemoteFileURL ( ) ; final IProxyData [ ] proxies = proxyService . getProxyDataForHost ( target . getHost ( ) ) ; IProxyData selectedProxy = selectProxyFromProxies ( target . getProtocol ( ) , proxies ) ; if ( selectedProxy != null ) { proxy = new Proxy ( ( selectedProxy . getType ( ) . equalsIgnoreCase ( SOCKS_PROXY_TYPE ) ? Type . SOCKS : Type . HTTP ) , new org . eclipse . ecf . core . util . ProxyAddress ( selectedProxy . getHost ( ) , selectedProxy . getPort ( ) ) , selectedProxy . getUserId ( ) , selectedProxy . getPassword ( ) ) ; } } } catch ( Exception e ) { Activator . logNoProxyWarning ( e ) ; } catch ( NoClassDefFoundError e ) { Activator . logNoProxyWarning ( e ) ; } } if ( ( proxy ) != null ) setupProxy ( proxy ) ; } }

Fix:
if ( ( proxyService != null ) && ( proxyService . isProxiesEnabled ( ) ) ) {