Buggy code:
public class Model { private Context ctx ; int mYear ; int mMonth ; int mDay ; ArrayList < String > passed_date = new ArrayList < String > ( ) ; ArrayList < String > warning_date = new ArrayList < String > ( ) ; ArrayList < String > tempArray = new ArrayList < String > ( ) ; SharedPreferences prefs ; int warning_days = 3 ; public Model ( Context context ) { } public Model ( Context context , int warningDays ) { } public void email_toast ( ) { } public void first_run ( ) { } public void check_exp_date ( boolean callFromFridge ) { Calendar c = Calendar . getInstance ( ) ; mYear = c . get ( Calendar . YEAR ) ; <START_BUG> mMonth = c . get ( Calendar . MONTH ) ; <END_BUG> mDay = c . get ( Calendar . DAY_OF_MONTH ) ; String exp_date ; passed_date . clear ( ) ; warning_date . clear ( ) ; DatabaseHelper myDb = new DatabaseHelper ( ctx ) ; { try { myDb . createDataBase ( ) ; } catch ( IOException ioe ) { throw new Error ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>database" ) ; } try { myDb . openDataBase ( ) ; } catch ( SQLException sqle ) { throw sqle ; } myDb . getReadableDatabase ( ) ; Cursor cc = myDb . getItems ( ) ; if ( cc . moveToFirst ( ) ) { do { if ( ! ( cc . getString ( 7 ) . equalsIgnoreCase ( "" ) ) ) { exp_date = cc . getString ( 7 ) ; String [ ] exdate = exp_date . split ( "-" ) ; if ( ( Integer . parseInt ( exdate [ 2 ] ) ) < ( mYear ) ) { passed_date . add ( ( ( ( ( ( cc . getString ( 0 ) ) + ":<seq2seq4repair_space>" ) + ( cc . getString ( 1 ) ) ) + "<seq2seq4repair_space>" ) + ( cc . getString ( 2 ) ) ) ) ; continue ; } else if ( ( ( Integer . parseInt ( exdate [ 2 ] ) ) == ( mYear ) ) && ( ( Integer . parseInt ( exdate [ 1 ] ) ) < ( mMonth ) ) ) { passed_date . add ( ( ( ( ( ( cc . getString ( 0 ) ) + ":<seq2seq4repair_space>" ) + ( cc . getString ( 1 ) ) ) + "<seq2seq4repair_space>" ) + ( cc . getString ( 2 ) ) ) ) ; continue ; } else if ( ( ( ( Integer . parseInt ( exdate [ 2 ] ) ) == ( mYear ) ) && ( ( Integer . parseInt ( exdate [ 1 ] ) ) == ( mMonth ) ) ) && ( ( Integer . parseInt ( exdate [ 0 ] ) ) < ( mDay ) ) ) { passed_date . add ( ( ( ( ( ( cc . getString ( 0 ) ) + ":<seq2seq4repair_space>" ) + ( cc . getString ( 1 ) ) ) + "<seq2seq4repair_space>" ) + ( cc . getString ( 2 ) ) ) ) ; continue ; } else if ( ( ( ( Integer . parseInt ( exdate [ 2 ] ) ) == ( mYear ) ) && ( ( Integer . parseInt ( exdate [ 1 ] ) ) == ( mMonth ) ) ) && ( ( ( Integer . parseInt ( exdate [ 0 ] ) ) - ( mDay ) ) < ( warning_days ) ) ) { warning_date . add ( ( ( ( ( ( ( ( ( Integer . parseInt ( exdate [ 0 ] ) ) - ( mDay ) ) + "<seq2seq4repair_space>day[s]<seq2seq4repair_space>left<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( cc . getString ( 0 ) ) ) + ":<seq2seq4repair_space>" ) + ( cc . getString ( 1 ) ) ) + "<seq2seq4repair_space>" ) + ( cc . getString ( 2 ) ) ) ) ; } } } while ( cc . moveToNext ( ) ) ; if ( ! ( passed_date . isEmpty ( ) ) ) { passed_exp ( ) ; } if ( ! ( warning_date . isEmpty ( ) ) ) { warning_exp ( ) ; } if ( ( ( passed_date . isEmpty ( ) ) && ( warning_date . isEmpty ( ) ) ) && callFromFridge ) { ok_exp ( ) ; } myDb . close ( ) ; } } } public void passed_exp ( ) { } public void warning_exp ( ) { } public void ok_exp ( ) { } public void show_history ( ) { } public void clear_history ( ) { } public void show_list ( ) { } }

Fix:
mMonth = ( c . get ( Calendar . MONTH ) ) + 1 ;