Program: 17544
Project: 17544
Buggy source:
public void download(){
  if (!mOutputFile.getParentFile().exists()) {
    if (!mOutputFile.getParentFile().mkdir()) {
      mError=new Exception("String_Node_Str");
    }
  }
  if (mOverrideFile && mOutputFile.exists()) {
    if (!mOutputFile.delete()) {
      mError=new Exception("String_Node_Str");
    }
  }
  if (mError == null) {
    mDownloadThread=new Thread(new Runnable(){
      @Override public void run(){
        try {
          Log.i(TAG,"String_Node_Str" + mURL.getHost());
          URLConnection connection=mURL.openConnection();
          connection.setDoOutput(true);
          connection.connect();
          FileOutputStream fileOutput=new FileOutputStream(mOutputFile);
          InputStream inputStream=connection.getInputStream();
          byte[] buffer=new byte[1024];
          final int FullLength=connection.getContentLength();
          int bufferLength;
          int downloaded=0;
          Log.i(TAG,"String_Node_Str" + mOutputFile.getName());
          while (((bufferLength=inputStream.read(buffer)) > 0) && !mCancel) {
            fileOutput.write(buffer,0,bufferLength);
            downloaded+=bufferLength;
            final int Downloaded=downloaded;
            if (onUpdateListener != null) {
              mHandler.post(new Runnable(){
                @Override public void run(){
                  onUpdateListener.onUpdate(FullLength,Downloaded);
                }
              }
);
            }
          }
          fileOutput.close();
          Log.i(TAG,"String_Node_Str");
          if (!mCheckSHA1 || !isDownloadCorrupt()) {
            mHandler.post(new Runnable(){
              @Override public void run(){
                if (onDownloadListener != null) {
                  mHandler.post(new Runnable(){
                    @Override public void run(){
                      onDownloadListener.onSuccess(mOutputFile);
                    }
                  }
);
                }
              }
            }
);
          }
 else {
            mHandler.post(new Runnable(){
              @Override public void run(){
                if (onDownloadListener != null)                 onDownloadListener.onFail(mError);
              }
            }
);
            mOutputFile.delete();
          }
        }
 catch (        IOException e) {
          mError=e;
          e.printStackTrace();
        }
      }
    }
);
    mDownloadThread.start();
  }
 else {
    mHandler.post(new Runnable(){
      @Override public void run(){
        if (onDownloadListener != null)         onDownloadListener.onFail(null);
      }
    }
);
  }
}

Fixed version (ground truth):
public void download(){
  if (!mOutputFile.getParentFile().exists()) {
    if (!mOutputFile.getParentFile().mkdir()) {
      mError=new Exception("String_Node_Str");
    }
  }
  if (mOverrideFile && mOutputFile.exists()) {
    if (!mOutputFile.delete()) {
      mError=new Exception("String_Node_Str");
    }
  }
  if (mError == null) {
    mDownloadThread=new Thread(new Runnable(){
      @Override public void run(){
        try {
          Log.i(TAG,"String_Node_Str" + mURL.getHost());
          URLConnection connection=mURL.openConnection();
          connection.setDoOutput(true);
          connection.setDoInput(true);
          connection.connect();
          FileOutputStream fileOutput=new FileOutputStream(mOutputFile);
          InputStream inputStream=connection.getInputStream();
          byte[] buffer=new byte[1024];
          final int FullLength=connection.getContentLength();
          int bufferLength;
          int downloaded=0;
          Log.i(TAG,"String_Node_Str" + mOutputFile.getName());
          while (((bufferLength=inputStream.read(buffer)) > 0) && !mCancel) {
            fileOutput.write(buffer,0,bufferLength);
            downloaded+=bufferLength;
            final int Downloaded=downloaded;
            if (onUpdateListener != null) {
              mHandler.post(new Runnable(){
                @Override public void run(){
                  onUpdateListener.onUpdate(FullLength,Downloaded);
                }
              }
);
            }
          }
          fileOutput.close();
          Log.i(TAG,"String_Node_Str");
        }
 catch (        IOException e) {
          mError=e;
          e.printStackTrace();
        }
        if ((!mCheckSHA1 || !isDownloadCorrupt()) && mError == null) {
          mHandler.post(new Runnable(){
            @Override public void run(){
              if (onDownloadListener != null) {
                mHandler.post(new Runnable(){
                  @Override public void run(){
                    onDownloadListener.onSuccess(mOutputFile);
                  }
                }
);
              }
            }
          }
);
        }
 else {
          mHandler.post(new Runnable(){
            @Override public void run(){
              if (onDownloadListener != null)               onDownloadListener.onFail(mError);
            }
          }
);
          mOutputFile.delete();
        }
      }
    }
);
    mDownloadThread.start();
  }
 else {
    mHandler.post(new Runnable(){
      @Override public void run(){
        if (onDownloadListener != null)         onDownloadListener.onFail(null);
      }
    }
);
  }
}