Buggy code:
public class UploadProcess implements Runnable { private UploadProcessListener mListener ; private final HttpHandler mHttp ; private final TokenManager mTokenManager ; private final Upload mUpload ; private boolean mDebug ; public UploadProcess ( HttpHandler http , TokenManager tokenManager , Upload upload ) { } public void setUploadProcessListener ( UploadProcessListener uploadListener ) { } public void debug ( boolean debug ) { } @ Override public void run ( ) { } void exceptionDuringUpload ( Upload upload , Exception exception ) { } void generalCancel ( Upload upload , Result result ) { } void storageLimitExceeded ( Upload upload ) { } void apiError ( Upload upload , Result result ) { } void pollMaxAttemptsReached ( Upload upload ) { } void checkFinished ( Upload upload ) { if ( mDebug ) { System . out . println ( ( "upload//check<seq2seq4repair_space>finished<seq2seq4repair_space>for<seq2seq4repair_space>" + ( mUpload ) ) ) ; } if ( upload . isHashInAccount ( ) ) { if ( mDebug ) { System . out . println ( ( "upload//check<seq2seq4repair_space>and<seq2seq4repair_space>hash<seq2seq4repair_space>is<seq2seq4repair_space>in<seq2seq4repair_space>user<seq2seq4repair_space>account<seq2seq4repair_space>for<seq2seq4repair_space>" + ( mUpload ) ) ) ; } Upload . Options . ActionOnInAccount actionOnInAccount = upload . getOptions ( ) . getActionOnInAccount ( ) ; switch ( actionOnInAccount ) { case UPLOAD_ALWAYS : doInstantUpload ( upload ) ; break ; case UPLOAD_IF_NOT_IN_FOLDER : <START_BUG> if ( upload . isHashInFolder ( ) ) { <END_BUG> doInstantUpload ( upload ) ; } else { if ( ( mListener ) != null ) { mListener . uploadFinished ( upload , upload . getDuplicateQuickKey ( ) ) ; } } break ; case DO_NOT_UPLOAD : default : if ( ( mListener ) != null ) { mListener . uploadFinished ( upload , upload . getDuplicateQuickKey ( ) ) ; } break ; } return ; } else { if ( mDebug ) { System . out . println ( ( "upload//check<seq2seq4repair_space>finished<seq2seq4repair_space>and<seq2seq4repair_space>hash<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>user<seq2seq4repair_space>account<seq2seq4repair_space>for<seq2seq4repair_space>" + ( mUpload ) ) ) ; } } if ( upload . isHashInMediaFire ( ) ) { if ( mDebug ) { System . out . println ( ( "upload//check<seq2seq4repair_space>finished<seq2seq4repair_space>and<seq2seq4repair_space>hash<seq2seq4repair_space>exists<seq2seq4repair_space>on<seq2seq4repair_space>mediafire<seq2seq4repair_space>for<seq2seq4repair_space>" + ( mUpload ) ) ) ; } doInstantUpload ( upload ) ; } else { if ( mDebug ) { System . out . println ( ( "upload//check<seq2seq4repair_space>finished<seq2seq4repair_space>but<seq2seq4repair_space>hash<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>for<seq2seq4repair_space>" + ( mUpload ) ) ) ; } doResumableUpload ( upload ) ; } } void pollFinished ( Upload upload , String quickKey ) { } void pollUpdate ( Upload upload , int status ) { } void instantFinished ( Upload upload ) { } void resumableProgress ( Upload upload , double percentFinished ) { } void resumableFinished ( Upload upload ) { } void uploadStarted ( Upload upload ) { } private void doCheckUpload ( Upload upload ) { } private void doPollUpload ( Upload upload , String responsePollKey ) { } private void doInstantUpload ( Upload upload ) { } private void doResumableUpload ( Upload upload ) { } }

Fix:
if ( ! ( upload . isHashInFolder ( ) ) ) {