Program: 15157
Project: 15157
Buggy source:
private void uploadMediaFile(Cursor cursor){
  if (!cursor.moveToFirst())   return;
  mUploadInProgress=true;
  int blogId=Integer.valueOf(cursor.getString((cursor.getColumnIndex("String_Node_Str"))));
  final String blogIdStr=String.valueOf(blogId);
  final String mediaId=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String fileName=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String filePath=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String mimeType=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  MediaFile mediaFile=new MediaFile();
  mediaFile.setBlogId(blogIdStr);
  mediaFile.setFileName(fileName);
  mediaFile.setFilePath(filePath);
  mediaFile.setMIMEType(mimeType);
  mediaFile.save();
  ApiHelper.UploadMediaTask task=new ApiHelper.UploadMediaTask(mContext,mediaFile,new Callback(){
    @Override public void onSuccess(    String id){
      mUploadInProgress=false;
      WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
      sendUpdateBroadcast();
      mHandler.post(FetchQueueTask);
    }
    @Override public void onFailure(){
      mUploadInProgress=false;
      WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
      sendUpdateBroadcast();
      mHandler.post(FetchQueueTask);
    }
  }
);
  WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
  sendUpdateBroadcast();
  List<Object> apiArgs=new ArrayList<Object>();
  apiArgs.add(WordPress.getCurrentBlog());
  task.execute(apiArgs);
  mHandler.post(FetchQueueTask);
}

Fixed version (ground truth):
private void uploadMediaFile(Cursor cursor){
  if (!cursor.moveToFirst())   return;
  mUploadInProgress=true;
  int blogId=Integer.valueOf(cursor.getString((cursor.getColumnIndex("String_Node_Str"))));
  final String blogIdStr=String.valueOf(blogId);
  final String mediaId=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String fileName=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String filePath=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String mimeType=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  MediaFile mediaFile=new MediaFile();
  mediaFile.setBlogId(blogIdStr);
  mediaFile.setFileName(fileName);
  mediaFile.setFilePath(filePath);
  mediaFile.setMIMEType(mimeType);
  ApiHelper.UploadMediaTask task=new ApiHelper.UploadMediaTask(mContext,mediaFile,new Callback(){
    @Override public void onSuccess(    String id){
      mUploadInProgress=false;
      WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
      sendUpdateBroadcast();
      mHandler.post(FetchQueueTask);
    }
    @Override public void onFailure(){
      mUploadInProgress=false;
      WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
      sendUpdateBroadcast();
      mHandler.post(FetchQueueTask);
    }
  }
);
  WordPress.wpDB.updateMediaUploadState(blogIdStr,mediaId,"String_Node_Str");
  sendUpdateBroadcast();
  List<Object> apiArgs=new ArrayList<Object>();
  apiArgs.add(WordPress.getCurrentBlog());
  task.execute(apiArgs);
  mHandler.post(FetchQueueTask);
}