Program: 94434
Project: 94434
Buggy source:
public IStatus performFileTransfer(IProgressMonitor monitor){
  transferStartTime=System.currentTimeMillis();
  final byte[] buf=new byte[buff_length];
  final long totalWork=((fileLength == -1) ? 100 : fileLength);
  double factor=(totalWork > Integer.MAX_VALUE) ? (((double)Integer.MAX_VALUE) / ((double)totalWork)) : 1.0;
  int work=(totalWork > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)totalWork;
  monitor.beginTask(getRemoteFileURL().toString() + Messages.AbstractRetrieveFileTransfer_Progress_Data,work);
  InputStream readInputStream=wrapTransferReadInputStream(remoteFileContents,monitor);
  try {
    while (!isDone() && !isPaused()) {
      try {
        final int bytes=readInputStream.read(buf);
        handleReceivedData(buf,bytes,factor,monitor);
      }
 catch (      OperationCanceledException e) {
        throw new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled);
      }
    }
  }
 catch (  final Exception e) {
    if (!isDone()) {
      setDoneException(e);
    }
  }
 finally {
    try {
      if (readInputStream != null)       readInputStream.close();
    }
 catch (    final IOException e) {
      Activator.getDefault().log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
    }
    hardClose();
    monitor.done();
    try {
      if (isPaused())       fireTransferReceivePausedEvent();
 else       fireTransferReceiveDoneEvent();
    }
 catch (    Exception e) {
      Activator.getDefault().log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,Messages.AbstractRetrieveFileTransfer_EXCEPTION_IN_FINALLY,e));
    }
  }
  return getFinalStatus(exception);
}

Fixed version (ground truth):
public IStatus performFileTransfer(IProgressMonitor monitor){
  transferStartTime=System.currentTimeMillis();
  final byte[] buf=new byte[buff_length];
  final long totalWork=((fileLength == -1) ? 100 : fileLength);
  double factor=(totalWork > Integer.MAX_VALUE) ? (((double)Integer.MAX_VALUE) / ((double)totalWork)) : 1.0;
  int work=(totalWork > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)totalWork;
  monitor.beginTask(getRemoteFileURL().toString() + Messages.AbstractRetrieveFileTransfer_Progress_Data,work);
  InputStream readInputStream=wrapTransferReadInputStream(remoteFileContents,monitor);
  try {
    while (!isDone() && !isPaused()) {
      try {
        final int bytes=readInputStream.read(buf);
        handleReceivedData(buf,bytes,factor,monitor);
      }
 catch (      OperationCanceledException e) {
        throw new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled);
      }
    }
  }
 catch (  final Exception e) {
    if (!isDone()) {
      setDoneException(e);
    }
  }
 finally {
    try {
      if (readInputStream != null)       readInputStream.close();
    }
 catch (    final IOException e) {
      Activator a=Activator.getDefault();
      if (a != null)       a.log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
    }
    hardClose();
    monitor.done();
    try {
      if (isPaused())       fireTransferReceivePausedEvent();
 else       fireTransferReceiveDoneEvent();
    }
 catch (    Exception e) {
      Activator a=Activator.getDefault();
      if (a != null)       a.log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,Messages.AbstractRetrieveFileTransfer_EXCEPTION_IN_FINALLY,e));
    }
  }
  return getFinalStatus(exception);
}