Buggy code:
public class DatabaseHandler extends SQLiteOpenHelper { private static final int DATABASE_VERSION = 9 ; static final String DATABASE_NAME = "FitFitRevolution" ; static final String TABLE_MOVES = "moves" ; static final String TABLE_MOVE_HISTORY = "movehistory" ; static final String TABLE_BODY_PART = "bodypart" ; static final String TABLE_WORKOUT = "workouts" ; static final String TABLE_EQUIPMENT = "equipment" ; static final String TABLE_MOVE_EQUIP = "moveequip" ; static final String TABLE_WEIGHTS = "weights" ; static final String MOVES_ID = "moveid" ; static final String MOVES_NAME = "name" ; static final String MOVES_DESCRIPTION = "description" ; static final String MOVES_BODY_PART_ID = "partid" ; static final String MOVES_PRIORITY = "priority" ; static final String MOVES_WEIGHT_ID = "moveweightid" ; static final String MH_MOVE_ID = "moveid" ; static final String MH_WORKOUT_ID = "workoutid" ; static final String MH_WEIGHT = "weight" ; static final String MH_REPS = "reps" ; static final String MH_PLACEMENT = "placement" ; static final String BP_ID = "partid" ; static final String BP_NAME = "name" ; static final String BP_PRIORITY = "priority" ; static final String WORKOUT_ID = "workoutid" ; static final String WORKOUT_DATETIME = "time" ; static final String WORKOUT_SCORE = "score" ; static final String EQUIPMENT_ID = "equipmentid" ; static final String EQUIPMENT_NAME = "name" ; static final String ME_MOVE_ID = "moveid" ; static final String ME_EQUIP_ID = "equipid" ; static final String WEIGHTS_ID = "weightid" ; static final String WEIGHTS_NUM = "weightnum" ; private static Context context ; private static DatabaseHandler i_dbh ; public DatabaseHandler ( Context context ) { } public static DatabaseHandler getInstance ( Context c ) { } @ Override public void onCreate ( SQLiteDatabase db ) { } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } private void FillBodyPartsTable ( SQLiteDatabase db ) { } private void FillEquipmentTable ( SQLiteDatabase db ) { } private void FillMoveEquipTable ( SQLiteDatabase db ) { } private void FillMovesTable ( SQLiteDatabase db ) { } private void FillWeightsTable ( SQLiteDatabase db ) { } public Integer getBodyPart ( SQLiteDatabase db ) { } public String getBodyPartName ( SQLiteDatabase db , Integer i ) { } public ArrayList < String > getEquipmentList ( SQLiteDatabase db , ArrayList < Integer > moveList ) { } public String getEquipmentName ( SQLiteDatabase db , Integer i ) { } public static Integer getLastRep ( SQLiteDatabase db , Integer mID ) { <START_BUG> Cursor cursor = db . rawQuery ( ( ( ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DatabaseHandler . MH_REPS ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DatabaseHandler . TABLE_MOVE_HISTORY ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DatabaseHandler . MOVES_ID ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + mID ) + "<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>" ) + ( DatabaseHandler . MH_WORKOUT_ID ) ) + "<seq2seq4repair_space>DESC" ) , null ) ; <END_BUG> if ( cursor . moveToFirst ( ) ) { return cursor . getInt ( 0 ) ; } else return 10 ; } public static Cursor getMove ( SQLiteDatabase db , Integer mID ) { } public String getMoveName ( SQLiteDatabase db , Integer i ) { } public static Integer getNextWorkout ( SQLiteDatabase db ) { } public Integer getRandomMoveID ( SQLiteDatabase db , Integer partNum ) { } public static Integer getWeightNum ( SQLiteDatabase db , Integer wID ) { } No newline ; at end ; of file ; }

Fix:
Cursor cursor = db . rawQuery ( ( ( ( ( ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DatabaseHandler . MH_REPS ) ) + ",<seq2seq4repair_space>" ) + ( DatabaseHandler . MH_WORKOUT_ID ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DatabaseHandler . TABLE_MOVE_HISTORY ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DatabaseHandler . MOVES_ID ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + mID ) + "<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>" ) + ( DatabaseHandler . MH_WORKOUT_ID ) ) + "<seq2seq4repair_space>DESC" ) , null ) ;