Buggy code:
public class SimpleUploadUseReturnBodyActivity extends ActionBarActivity { private static final int REQUEST_CODE = 8090 ; private SimpleUploadUseReturnBodyActivity context ; private EditText uploadFileKeyEditText ; private EditText uploadFileXParam1EditText ; private EditText uploadFileXParam2EditText ; private TextView uploadLogTextView ; private LinearLayout uploadStatusLayout ; private ProgressBar uploadProgressBar ; private TextView uploadSpeedTextView ; private TextView uploadFileLengthTextView ; private TextView uploadPercentageTextView ; private UploadManager uploadManager ; private long uploadLastTimePoint ; private long uploadLastOffset ; private long uploadFileLength ; private String uploadFilePath ; public SimpleUploadUseReturnBodyActivity ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void selectUploadFile ( View view ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void uploadFile ( View view ) { } private void upload ( String uploadToken ) { if ( ( this . uploadManager ) == null ) { this . uploadManager = new UploadManager ( ) ; } File uploadFile = new File ( this . uploadFilePath ) ; String exParam1 = this . uploadFileXParam1EditText . getText ( ) . toString ( ) ; String exParam2 = this . uploadFileXParam2EditText . getText ( ) . toString ( ) ; Map < String , String > xParams = new HashMap < String , String > ( ) ; xParams . put ( "x:exParam1" , exParam1 ) ; xParams . put ( "x:exParam2" , exParam2 ) ; String uploadFileKey = this . uploadFileKeyEditText . getText ( ) . toString ( ) ; UploadOptions uploadOptions = new UploadOptions ( xParams , null , false , new UpProgressHandler ( ) { @ Override public void progress ( String key , double percent ) { updateStatus ( percent ) ; } } , null ) ; final long startTime = System . currentTimeMillis ( ) ; final long fileLength = uploadFile . length ( ) ; this . uploadFileLength = fileLength ; this . uploadLastTimePoint = startTime ; this . uploadLastOffset = 0 ; AsyncRun . run ( new Runnable ( ) { @ Override public void run ( ) { uploadPercentageTextView . setText ( "0<seq2seq4repair_space>%" ) ; uploadSpeedTextView . setText ( "0<seq2seq4repair_space>KB//s" ) ; uploadFileLengthTextView . setText ( Tools . formatSize ( fileLength ) ) ; uploadStatusLayout . setVisibility ( VISIBLE ) ; } } ) ; writeLog ( ( ( context . getString ( qiniu_upload_file ) ) + "..." ) ) ; this . uploadManager . put ( uploadFile , uploadFileKey , uploadToken , new UpCompletionHandler ( ) { @ Override public void complete ( String key , ResponseInfo respInfo , JSONObject jsonData ) { AsyncRun . run ( new Runnable ( ) { @ Override public void run ( ) { uploadStatusLayout . setVisibility ( INVISIBLE ) ; uploadProgressBar . setProgress ( 0 ) ; } } ) ; long lastMillis = ( System . currentTimeMillis ( ) ) - startTime ; if ( respInfo . isOK ( ) ) { try { String fileKey = jsonData . getString ( "key" ) ; String fileHash = jsonData . getString ( "hash" ) ; <START_BUG> writeLog ( ( ( context . getString ( qiniu_upload_response ) ) + ( jsonData . toString ( ) ) ) ) ; <END_BUG> writeLog ( ( "File<seq2seq4repair_space>Size:<seq2seq4repair_space>" + ( Tools . formatSize ( uploadFileLength ) ) ) ) ; writeLog ( ( "File<seq2seq4repair_space>Key:<seq2seq4repair_space>" + fileKey ) ) ; writeLog ( ( "File<seq2seq4repair_space>Hash:<seq2seq4repair_space>" + fileHash ) ) ; writeLog ( ( "Last<seq2seq4repair_space>Time:<seq2seq4repair_space>" + ( Tools . formatMilliSeconds ( lastMillis ) ) ) ) ; writeLog ( ( "Average<seq2seq4repair_space>Speed:<seq2seq4repair_space>" + ( Tools . formatSpeed ( fileLength , lastMillis ) ) ) ) ; writeLog ( ( "X-Reqid:<seq2seq4repair_space>" + ( respInfo . reqId ) ) ) ; writeLog ( ( "X-Via:<seq2seq4repair_space>" + ( respInfo . xvia ) ) ) ; writeLog ( "--------------------------------" ) ; } catch ( JSONException e ) { AsyncRun . run ( new Runnable ( ) { @ Override public void run ( ) { Toast . makeText ( context , context . getString ( qiniu_upload_file_response_parse_error ) , LENGTH_LONG ) . show ( ) ; } } ) ; writeLog ( context . getString ( qiniu_upload_file_response_parse_error ) ) ; if ( jsonData != null ) { writeLog ( jsonData . toString ( ) ) ; } writeLog ( "--------------------------------" ) ; } } else { AsyncRun . run ( new Runnable ( ) { @ Override public void run ( ) { Toast . makeText ( context , context . getString ( qiniu_upload_file_failed ) , LENGTH_LONG ) . show ( ) ; } } ) ; writeLog ( respInfo . toString ( ) ) ; if ( jsonData != null ) { writeLog ( jsonData . toString ( ) ) ; } writeLog ( "--------------------------------" ) ; } } } , uploadOptions ) ; } private void updateStatus ( final double percentage ) { } private void clearLog ( ) { } private void writeLog ( final String msg ) { } }

Fix:
writeLog ( ( ( ( context . getString ( qiniu_upload_response ) ) + "\r\n" ) + ( jsonData . toString ( ) ) ) ) ;