Buggy code:
public class SplitTimeView extends AbstractTable { private static final String TAG = "SplitTimeView" ; public SplitTimeView ( Context context ) { } public List < SplitTimeStepCount > selectAll ( long startTime ) { <START_BUG> String query = "select<seq2seq4repair_space>a.timestamp,<seq2seq4repair_space>a.distance,<seq2seq4repair_space>" + ( ( ( ( ( ( "(select<seq2seq4repair_space>step_count<seq2seq4repair_space>from<seq2seq4repair_space>gm_stepcount<seq2seq4repair_space>b<seq2seq4repair_space>" + "<seq2seq4repair_space>where<seq2seq4repair_space>a.start_time<seq2seq4repair_space>=<seq2seq4repair_space>b.start_time<seq2seq4repair_space>" ) + "<seq2seq4repair_space>and<seq2seq4repair_space>b.timestamp<seq2seq4repair_space><<seq2seq4repair_space>a.timestamp<seq2seq4repair_space>" ) + "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>b.timestamp<seq2seq4repair_space>desc<seq2seq4repair_space>limit<seq2seq4repair_space>1)<seq2seq4repair_space>as<seq2seq4repair_space>stepcount<seq2seq4repair_space>" ) + "from<seq2seq4repair_space>gm_lap<seq2seq4repair_space>a<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>a.start_time<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>" ) + "order<seq2seq4repair_space>by<seq2seq4repair_space>a.timestamp" ) ; <END_BUG> String [ ] selectionArgs = new String [ ] { this . formatDateMsec ( startTime ) } ; Cursor cursor = this . db . rawQuery ( query , selectionArgs ) ; List < SplitTimeStepCount > dataList = new ArrayList < > ( ) ; if ( ( cursor . getCount ( ) ) == 0 ) { return dataList ; } cursor . moveToFirst ( ) ; try { while ( ! ( cursor . isAfterLast ( ) ) ) { SplitTimeStepCount splitTimeStepCount = new SplitTimeStepCount ( this . parseDate ( cursor . getString ( 0 ) ) , cursor . getFloat ( 1 ) , cursor . getInt ( 2 ) ) ; dataList . add ( splitTimeStepCount ) ; cursor . moveToNext ( ) ; } } catch ( ParseException e ) { Log . e ( SplitTimeView . TAG , e . getMessage ( ) , e ) ; } cursor . close ( ) ; return dataList ; } public List < LapTime > selectLaps ( long startTime ) { } @ Override public String getTableName ( ) { } }

Fix:
String query = "select<seq2seq4repair_space>a.timestamp,<seq2seq4repair_space>a.distance,<seq2seq4repair_space>" + ( ( ( ( ( ( "(select<seq2seq4repair_space>step_count<seq2seq4repair_space>from<seq2seq4repair_space>gm_stepcount<seq2seq4repair_space>b<seq2seq4repair_space>" + "<seq2seq4repair_space>where<seq2seq4repair_space>a.start_time<seq2seq4repair_space>=<seq2seq4repair_space>b.start_time<seq2seq4repair_space>" ) + "<seq2seq4repair_space>and<seq2seq4repair_space>b.timestamp<seq2seq4repair_space><=<seq2seq4repair_space>a.timestamp<seq2seq4repair_space>" ) + "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>b.timestamp<seq2seq4repair_space>desc<seq2seq4repair_space>limit<seq2seq4repair_space>1)<seq2seq4repair_space>as<seq2seq4repair_space>stepcount<seq2seq4repair_space>" ) + "from<seq2seq4repair_space>gm_lap<seq2seq4repair_space>a<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>a.start_time<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>" ) + "order<seq2seq4repair_space>by<seq2seq4repair_space>a.timestamp" ) ;