Buggy code:
public class ImageFilter extends CordovaPlugin { @ Override public boolean execute ( String action , JSONArray data , CallbackContext callbackContext ) throws JSONException { boolean ignore = false ; String filePath = "" ; Context context = this . cordova . getActivity ( ) . getApplicationContext ( ) ; File path = new File ( ( ( context . getFilesDir ( ) . getPath ( ) ) + "//user//" ) ) ; File NBBfile = new File ( path , "tmp.jpg" ) ; try { boolean success = false ; if ( ! ( path . exists ( ) ) ) { success = path . mkdir ( ) ; } } catch ( Exception e ) { ignore = true ; callbackContext . success ( ( "error<seq2seq4repair_space>1<seq2seq4repair_space>-<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; } if ( ! ignore ) { final JSONObject options = data . optJSONObject ( 0 ) ; String imageURL = new File ( ( ( context . getFilesDir ( ) . getPath ( ) ) + "//user//" ) , options . optString ( "image" ) ) . getAbsolutePath ( ) ; try { Bitmap bmp = BitmapFactory . decodeFile ( imageURL ) ; if ( ( ( bmp . getHeight ( ) ) >= 655 ) || ( ( bmp . getWidth ( ) ) >= 655 ) ) { bmp = Bitmap . createBitmap ( bmp , 0 , 0 , 655 , 655 ) ; } else { bmp = Bitmap . createBitmap ( bmp ) ; } try { Bitmap none = Bitmap . createBitmap ( bmp ) ; Canvas canvas = new Canvas ( none ) ; canvas . drawBitmap ( none , 0 , 0 , null ) ; Paint paint = new Paint ( ) ; ColorMatrix cm = new ColorMatrix ( ) ; cm . set ( new float [ ] { 1 , 0 , 0 , 0 , - 60 , 0 , 1 , 0 , 0 , - 60 , 0 , 0 , 1 , 0 , - 60 , 0 , 0 , 0 , 1 , 0 } ) ; paint . setColorFilter ( new ColorMatrixColorFilter ( cm ) ) ; Matrix matrix = new Matrix ( ) ; canvas . drawBitmap ( none , matrix , paint ) ; try { FileOutputStream out = new FileOutputStream ( NBBfile ) ; none . compress ( JPEG , 100 , out ) ; out . flush ( ) ; out . close ( ) ; Uri uri = Uri . fromFile ( NBBfile ) ; filePath = uri . toString ( ) ; callbackContext . success ( ( ( ( ( ( ( ( "success<seq2seq4repair_space>=<seq2seq4repair_space>" + imageURL ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + filePath ) + "<seq2seq4repair_space>w:<seq2seq4repair_space>" ) + ( bmp . getWidth ( ) ) ) + "<seq2seq4repair_space>h:<seq2seq4repair_space>" ) + ( bmp . getHeight ( ) ) ) ) ; } catch ( Exception e ) { ignore = true ; callbackContext . success ( ( ( ( ( ( ( ( ( ( "error<seq2seq4repair_space>4<seq2seq4repair_space>-<seq2seq4repair_space>" + imageURL ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + "<seq2seq4repair_space>w:<seq2seq4repair_space>" ) + ( bmp . getWidth ( ) ) ) + "<seq2seq4repair_space>h:<seq2seq4repair_space>" ) + ( bmp . getHeight ( ) ) ) + ( ImageFilter . getStackTrace ( e ) ) ) ) ; } } catch ( Exception e ) { ignore = true ; callbackContext . success ( ( ( ( ( ( ( ( ( ( "error<seq2seq4repair_space>3<seq2seq4repair_space>-<seq2seq4repair_space>" + ( e . toString ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + imageURL ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + "<seq2seq4repair_space>w:<seq2seq4repair_space>" ) + ( bmp . getWidth ( ) ) ) + "<seq2seq4repair_space>h:<seq2seq4repair_space>" ) + ( bmp . getHeight ( ) ) ) + ( ImageFilter . getStackTrace ( e ) ) ) ) ; } } catch ( Exception e ) { ignore = true ; <START_BUG> callbackContext . success ( ( ( ( ( ( ( ( ( ( "error<seq2seq4repair_space>2<seq2seq4repair_space>-<seq2seq4repair_space>" + ( e . toString ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + imageURL ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + "<seq2seq4repair_space>w:<seq2seq4repair_space>" ) + ( bmp . getWidth ( ) ) ) + "<seq2seq4repair_space>h:<seq2seq4repair_space>" ) + ( bmp . getHeight ( ) ) ) + ( ImageFilter . getStackTrace ( e ) ) ) ) ; <END_BUG> } } return true ; } public static String getStackTrace ( final Throwable throwable ) { } No newline ; at end ; of file ; }

Fix:
callbackContext . success ( ( ( ( ( "error<seq2seq4repair_space>2<seq2seq4repair_space>-<seq2seq4repair_space>" + ( e . toString ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + imageURL ) + ( ImageFilter . getStackTrace ( e ) ) ) ) ;