Program: 36818
Project: 36818
Buggy source:
@Override protected void doUploadProcess(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  Thread.currentThread().setPriority(3);
  FileData fileData=uploadItem.getFileData();
  long fileSize=fileData.getFileSize();
  String encodedShortFileName;
  try {
    encodedShortFileName=URLEncoder.encode(uploadItem.getFileName(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + e);
    notifyListenerException(e);
    return;
  }
  ChunkData chunkData=uploadItem.getChunkData();
  int numChunks=chunkData.getNumberOfUnits();
  int unitSize=chunkData.getUnitSize();
  ResumableResponse response=null;
  for (int chunkNumber=0; chunkNumber < numChunks; chunkNumber++) {
    if (uploadItem.isCancelled()) {
      notifyListenerCancelled(response);
      return;
    }
    if (!uploadItem.getBitmap().isUploaded(chunkNumber)) {
      int chunkSize=getChunkSize(chunkNumber,numChunks,fileSize,unitSize);
      ResumableChunkInfo resumableChunkInfo=createResumableChunkInfo(unitSize,chunkNumber);
      if (resumableChunkInfo == null || resumableChunkInfo.hasException()) {
        notifyListenerException(resumableChunkInfo.getException());
        return;
      }
      String chunkHash=resumableChunkInfo.getChunkHash();
      byte[] uploadChunk=resumableChunkInfo.getUploadChunk();
      printDebugCurrentChunk(chunkNumber,numChunks,chunkSize,unitSize,fileSize,chunkHash,uploadChunk);
      HashMap<String,String> headers=generatePostHeaders(encodedShortFileName,fileSize,chunkNumber,chunkHash,chunkSize);
      HashMap<String,String> parameters=generateGetParameters();
      printDebugRequestData(headers,parameters);
      MFRequest mfRequest=new MFRequest(MFHost.LIVE_HTTP,MFApi.UPLOAD_INSTANT,parameters,headers,uploadChunk);
      MFHttpRunner.RunnerHolder runnerHolder=mfTokenFarm.getMfHttpRunner().doRequest(mfRequest);
      MFResponse receivedMFResponse=runnerHolder.getMfResponse();
      response=receivedMFResponse.getResponseObject(ResumableResponse.class);
      if (shouldSetPollUploadKey(response)) {
        uploadItem.setPollUploadKey(response.getDoUpload().getPollUploadKey());
      }
      if (shouldCancelUpload(response)) {
        notifyListenerCancelled(response);
        return;
      }
      int count=response.getResumableUpload().getBitmap().getCount();
      List<Integer> words=response.getResumableUpload().getBitmap().getWords();
      ResumableBitmap bitmap=new ResumableBitmap(count,words);
      uploadItem.setBitmap(bitmap);
      MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + uploadItem.getFileData().getFilePath() + "String_Node_Str"+ uploadItem.getBitmap().getCount()+ "String_Node_Str"+ uploadItem.getBitmap().getWords().toString()+ "String_Node_Str");
      clearReferences(chunkSize,chunkHash,uploadChunk,headers,parameters);
    }
    updateProgressForListener(numChunks);
  }
  notifyListenerCompleted(response);
}

Fixed version (ground truth):
@Override protected void doUploadProcess(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  FileData fileData=uploadItem.getFileData();
  long fileSize=fileData.getFileSize();
  String encodedShortFileName;
  try {
    encodedShortFileName=URLEncoder.encode(uploadItem.getFileName(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + e);
    notifyListenerException(e);
    return;
  }
  ChunkData chunkData=uploadItem.getChunkData();
  int numChunks=chunkData.getNumberOfUnits();
  int unitSize=chunkData.getUnitSize();
  ResumableResponse response=null;
  for (int chunkNumber=0; chunkNumber < numChunks; chunkNumber++) {
    if (uploadItem.isCancelled()) {
      notifyListenerCancelled(response);
      return;
    }
    if (!uploadItem.getBitmap().isUploaded(chunkNumber)) {
      int chunkSize=getChunkSize(chunkNumber,numChunks,fileSize,unitSize);
      ResumableChunkInfo resumableChunkInfo=createResumableChunkInfo(unitSize,chunkNumber);
      if (resumableChunkInfo == null || resumableChunkInfo.hasException()) {
        notifyListenerException(resumableChunkInfo.getException());
        return;
      }
      String chunkHash=resumableChunkInfo.getChunkHash();
      byte[] uploadChunk=resumableChunkInfo.getUploadChunk();
      printDebugCurrentChunk(chunkNumber,numChunks,chunkSize,unitSize,fileSize,chunkHash,uploadChunk);
      HashMap<String,String> headers=generatePostHeaders(encodedShortFileName,fileSize,chunkNumber,chunkHash,chunkSize);
      HashMap<String,String> parameters=generateGetParameters();
      printDebugRequestData(headers,parameters);
      MFRequest mfRequest=new MFRequest(MFHost.LIVE_HTTP,MFApi.UPLOAD_INSTANT,parameters,headers,uploadChunk);
      MFHttpRunner.RunnerHolder runnerHolder=mfTokenFarm.getMfHttpRunner().doRequest(mfRequest);
      MFResponse receivedMFResponse=runnerHolder.getMfResponse();
      response=receivedMFResponse.getResponseObject(ResumableResponse.class);
      if (shouldSetPollUploadKey(response)) {
        uploadItem.setPollUploadKey(response.getDoUpload().getPollUploadKey());
      }
      if (shouldCancelUpload(response)) {
        notifyListenerCancelled(response);
        return;
      }
      int count=response.getResumableUpload().getBitmap().getCount();
      List<Integer> words=response.getResumableUpload().getBitmap().getWords();
      ResumableBitmap bitmap=new ResumableBitmap(count,words);
      uploadItem.setBitmap(bitmap);
      MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + uploadItem.getFileData().getFilePath() + "String_Node_Str"+ uploadItem.getBitmap().getCount()+ "String_Node_Str"+ uploadItem.getBitmap().getWords().toString()+ "String_Node_Str");
      clearReferences(chunkSize,chunkHash,uploadChunk,headers,parameters);
    }
    updateProgressForListener(numChunks);
  }
  notifyListenerCompleted(response);
}