Buggy code:
@ SuppressLint ( { "DefaultLocale" , "SdCardPath" } ) public class DatabaseConverter { private static final String BASE_DIRECTORY = "//mnt//sdcard//" ; private static final String DAY_OF_MONTH_HISTORY_RECORDS_CACHE_DIR = ( DatabaseConverter . BASE_DIRECTORY ) + "trend//day.dat" ; private static final String MONTH_HISTORY_RECORDS_CACHE_DIR = ( DatabaseConverter . BASE_DIRECTORY ) + "trend//month.dat" ; private static final String YEAR_HISTORY_RECORDS_CACHE_DIR = ( DatabaseConverter . BASE_DIRECTORY ) + "trend//year.dat" ; private static final String DEBUG_TAG = "______DatabaseConverter" ; private static DatabaseConverter databaseConverter = null ; private DatabaseConverter ( ) { } public static DatabaseConverter getInstance ( ) { } public void getDataFromDB ( int statisticObject , int statisticType , JSONObject dateInfo , RetriveDataListener callback ) { } private void SaveDataToFile ( String filePath , ArrayList < String > data ) { } private void processAggregation ( int statisticObject , int statisticType , ArrayList < MagicMedRecord > records , RetriveDataListener callback ) { } private ArrayList < String > aggregateByDay ( int statisticObject , ArrayList < MagicMedRecord > records ) { } private int getObjectValue ( int statisticObject , MagicMedRecord record ) { } private String addPadding ( int number ) { } @ SuppressLint ( "UseSparseArrays" ) private ArrayList < String > aggregateByMonth ( int statisticObject , ArrayList < MagicMedRecord > records ) { } private class AssistStatisticCounter { private int key ; private int value ; private int count ; public AssistStatisticCounter ( int key , int value ) { } public void appendData ( int value ) { } @ SuppressWarnings ( "unused" ) public int getKey ( ) { } public void setKey ( int key ) { } public int getValue ( ) { } public void setValue ( int value ) { } public int getCount ( ) { } public void setCount ( int count ) { } } @ SuppressLint ( "UseSparseArrays" ) private ArrayList < String > aggregateByYear ( int statisticObject , ArrayList < MagicMedRecord > records ) { } private ArrayList < MagicMedRecord > retriveData ( long lowerBoundTime , long upperBoundTime ) { } private long getUpperBoundTime ( int statisticType , JSONObject dateInfo ) throws JSONException { } private long getLowerBoundTime ( int statisticType , JSONObject dateInfo ) throws JSONException { } private long dateToMilLiseconds ( int year , int month , int dayOfMonth , int hour , int minute , int second ) { } private String millisecondsToDate ( long milliseconds ) { GregorianCalendar . getInstance ( ) . setTimeInMillis ( milliseconds ) ; Calendar calendar = GregorianCalendar . getInstance ( ) ; calendar . setTimeInMillis ( milliseconds ) ; int year = calendar . get ( Calendar . YEAR ) ; int month = calendar . get ( Calendar . MONTH ) ; int dayOfMonth = calendar . get ( Calendar . DAY_OF_MONTH ) ; int hour = calendar . get ( Calendar . HOUR_OF_DAY ) ; int minute = calendar . get ( Calendar . MINUTE ) ; int second = calendar . get ( Calendar . SECOND ) ; <START_BUG> return String . format ( "%d-%d-%d\t%d:%d:%d" , year , ( month == 0 ? 12 : month ) , dayOfMonth , hour , minute , second ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return String . format ( "%d-%d-%d\t%d:%d:%d" , year , ( month + 1 ) , dayOfMonth , hour , minute , second ) ;