Buggy code:
public class ExerciseDatabaseHelper extends SQLiteOpenHelper implements ExerciseRecordPersistor { public static final String DBNAME = "PercussionPractice.db" ; public static final int Version = 19 ; private static final String TABLE_EXERCISE_DATA = "exercise_data" ; private static final String DROP_EXERCISE_DATA_STATEMENT = "DROP<seq2seq4repair_space>TABlE<seq2seq4repair_space>IF<seq2seq4repair_space>EXISTS<seq2seq4repair_space>" + ( ExerciseDatabaseHelper . TABLE_EXERCISE_DATA ) ; private static final String COLUMN_EXERCISE_NAME = "name" ; private static final String COLUMN_EXERCISE_LOCAL_ID = "local_id" ; private static final String COLUMN_EXERCISE_ID = "id" ; private static final String COLUMN_EXERCISE_PIC_REF = "pic_ref" ; private static final String EXERCISE_DATA_TABLE_CREATE = MessageFormat . format ( "<seq2seq4repair_space>create<seq2seq4repair_space>table<seq2seq4repair_space>{0}({1}<seq2seq4repair_space>integer,<seq2seq4repair_space>{2}<seq2seq4repair_space>text,<seq2seq4repair_space>{3}<seq2seq4repair_space>text,<seq2seq4repair_space>primary<seq2seq4repair_space>key({2})<seq2seq4repair_space>on<seq2seq4repair_space>conflict<seq2seq4repair_space>replace<seq2seq4repair_space>);" , ExerciseDatabaseHelper . TABLE_EXERCISE_DATA , ExerciseDatabaseHelper . COLUMN_EXERCISE_ID , ExerciseDatabaseHelper . COLUMN_EXERCISE_NAME , ExerciseDatabaseHelper . COLUMN_EXERCISE_PIC_REF ) ; private static final String TABLE_USER_DATA = "user_data" ; private static final String DROP_USER_DATA_STATEMENT = "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>IF<seq2seq4repair_space>EXISTS<seq2seq4repair_space>" + ( ExerciseDatabaseHelper . TABLE_USER_DATA ) ; private static final String COLUMN_EXERCISE_RECORD_ID = "_id" ; private static final String COLUMN_EXERCISE_TYPE = "exercise_type" ; private static final String COLUMN_BPM = "bpm" ; private static final String COLUMN_TIME_SPAN = "time_span" ; private static final String COLUMN_TIME_STAMP = "time_stamp" ; private static final String USER_DATA_TABLE_CREATE = MessageFormat . format ( "create<seq2seq4repair_space>table<seq2seq4repair_space>{0}({1}<seq2seq4repair_space>integer<seq2seq4repair_space>primary<seq2seq4repair_space>key<seq2seq4repair_space>autoincrement,<seq2seq4repair_space>{2}<seq2seq4repair_space>integer,<seq2seq4repair_space>{4}<seq2seq4repair_space>integer,<seq2seq4repair_space>{5}<seq2seq4repair_space>integer,<seq2seq4repair_space>{6}<seq2seq4repair_space>integer<seq2seq4repair_space>);" , ExerciseDatabaseHelper . TABLE_USER_DATA , ExerciseDatabaseHelper . COLUMN_EXERCISE_RECORD_ID , ExerciseDatabaseHelper . COLUMN_EXERCISE_TYPE , ExerciseDatabaseHelper . TABLE_EXERCISE_DATA , ExerciseDatabaseHelper . COLUMN_BPM , ExerciseDatabaseHelper . COLUMN_TIME_SPAN , ExerciseDatabaseHelper . COLUMN_TIME_STAMP ) ; @ Inject public ExerciseDatabaseHelper ( Context context ) { } private static String GetUserDataStatement ( int exerciseID , int NumOfRows ) { } private static String SaveRecordStatement ( int exerciseId , int BPM , int TimeSpan , long TimeStamp ) { } private static final String GetExercisesStatement = "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>" + ( ExerciseDatabaseHelper . TABLE_EXERCISE_DATA ) ; @ Override public void onCreate ( SQLiteDatabase sqLiteDatabase ) { } @ Override public void onUpgrade ( SQLiteDatabase sqLiteDatabase , int i , int i2 ) { } @ Override public void onConfigure ( SQLiteDatabase db ) { } public Exercise [ ] getAllExercises ( ) { } public ExerciseRecord [ ] getLatestRecords ( Exercise exercise , int numOfRecords ) { } public boolean saveRecordData ( ExerciseRecord record ) { } public boolean saveExercise ( Exercise exercise ) { } private static String saveExerciseStatement ( String name , String url , int id ) { <START_BUG> String nullCheckedURL = ( url == null ) ? "null" : MessageFormat . format ( "''{1}''" , url ) ; <END_BUG> return MessageFormat . format ( "Insert<seq2seq4repair_space>into<seq2seq4repair_space>{0}({1},<seq2seq4repair_space>{2},<seq2seq4repair_space>{3})<seq2seq4repair_space>Values(''{4}'',<seq2seq4repair_space>{5},<seq2seq4repair_space>{6}<seq2seq4repair_space>);" , ExerciseDatabaseHelper . TABLE_EXERCISE_DATA , ExerciseDatabaseHelper . COLUMN_EXERCISE_NAME , ExerciseDatabaseHelper . COLUMN_EXERCISE_PIC_REF , ExerciseDatabaseHelper . COLUMN_EXERCISE_ID , name , nullCheckedURL , id ) ; } public void TruncateDatabase ( ) { } @ Override public ExerciseRecord [ ] getLatest ( Exercise exercise , int numRecords ) { } @ Override public boolean saveRecord ( ExerciseRecord record ) { } }

Fix:
String nullCheckedURL = ( url == null ) ? "null" : MessageFormat . format ( "''{0}''" , url ) ;