Buggy code:
public class StopNameSQLHelper extends SQLiteOpenHelper implements OmniAutoCompleteProvider , StopLocationTranslator , StopNameTranslator { private static final String TAG = "StopNameSQLHelper" ; private static final int MINIMUM_AUTOCOMPLETE_PROMPT = 3 ; private static final String DATABASE_NAME = "StopNames.db" ; private static final int DATABASE_VERSION = 3 ; private static final String TEXT_TYPE = "<seq2seq4repair_space>TEXT" ; private static final String COMMA_SEP = "," ; private static final String SQL_CREATE_ENTRIES = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>" + ( StopNameSQLHelper . StopNameEntry . TABLE_NAME ) ) + "<seq2seq4repair_space>(" ) + ( _ID ) ) + "<seq2seq4repair_space>INTEGER<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY," ) + ( StopNameSQLHelper . StopNameEntry . COLUMN_NAME_STOPID ) ) + ( StopNameSQLHelper . TEXT_TYPE ) ) + ( StopNameSQLHelper . COMMA_SEP ) ) + ( StopNameSQLHelper . StopNameEntry . COLUMN_NAME_STOPNAME ) ) + ( StopNameSQLHelper . TEXT_TYPE ) ) + ( StopNameSQLHelper . COMMA_SEP ) ) + ( StopNameSQLHelper . StopNameEntry . COLUMN_NAME_LATITUDE ) ) + ( StopNameSQLHelper . TEXT_TYPE ) ) + ( StopNameSQLHelper . COMMA_SEP ) ) + ( StopNameSQLHelper . StopNameEntry . COLUMN_NAME_LONGITUDE ) ) + ( StopNameSQLHelper . TEXT_TYPE ) ) + "<seq2seq4repair_space>)" ; private static final String SQL_DELETE_ENTRIES = "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>IF<seq2seq4repair_space>EXISTS<seq2seq4repair_space>" + ( StopNameSQLHelper . StopNameEntry . TABLE_NAME ) ; public static abstract class StopNameEntry implements BaseColumns { public static final String TABLE_NAME = "stopnames" ; public static final String COLUMN_NAME_STOPID = "stopid" ; public static final String COLUMN_NAME_STOPNAME = "stopname" ; public static final String COLUMN_NAME_LATITUDE = "latitude" ; public static final String COLUMN_NAME_LONGITUDE = "longitude" ; } private static String [ ] projection = new String [ ] { StopNameSQLHelper . StopNameEntry . COLUMN_NAME_STOPID , StopNameSQLHelper . StopNameEntry . COLUMN_NAME_STOPNAME , StopNameSQLHelper . StopNameEntry . COLUMN_NAME_LATITUDE , StopNameSQLHelper . StopNameEntry . COLUMN_NAME_LONGITUDE } ; private class SQLEntry { public String stopID ; public String stopName ; public String latitude ; public String longitude ; } private Context context ; public StopNameSQLHelper ( Context context ) { } @ Override public void initialize ( ) { } @ Override public BasicLocation getStopLocation ( Stop stop ) { } private boolean badQueryInput ( String input ) { } private Collection < StopNameSQLHelper . SQLEntry > getAutoCompleteEntries ( SQLiteDatabase db , String stopName ) { } @ Override public Collection < OmniAutoCompleteEntry > autocomplete ( String input ) { if ( badQueryInput ( input ) ) { return new ArrayList < OmniAutoCompleteEntry > ( ) ; } Long t = Tracking . startTime ( ) ; SQLiteDatabase db = getReadableDatabase ( ) ; HashMap < String , OmniAutoCompleteEntry > ret = new HashMap < String , OmniAutoCompleteEntry > ( ) ; String [ ] split = input . split ( "<seq2seq4repair_space>" ) ; for ( String s : split ) { HashMap < String , OmniAutoCompleteEntry > tmp = new HashMap < String , OmniAutoCompleteEntry > ( ) ; if ( ( s . length ( ) ) < ( StopNameSQLHelper . MINIMUM_AUTOCOMPLETE_PROMPT ) ) { Log . d ( StopNameSQLHelper . TAG , ( ( ( "Autocomplete<seq2seq4repair_space>component<seq2seq4repair_space>" + s ) + "<seq2seq4repair_space>shorter<seq2seq4repair_space>than<seq2seq4repair_space>min<seq2seq4repair_space>chars<seq2seq4repair_space>" ) + ( StopNameSQLHelper . MINIMUM_AUTOCOMPLETE_PROMPT ) ) ) ; continue ; } Log . d ( StopNameSQLHelper . TAG , ( "Autocomplete<seq2seq4repair_space>searching<seq2seq4repair_space>for<seq2seq4repair_space>" + s ) ) ; <START_BUG> Collection < StopNameSQLHelper . SQLEntry > matchingEntries = getAutoCompleteEntries ( db , input ) ; <END_BUG> Log . d ( StopNameSQLHelper . TAG , ( ( ( "Autocomplete<seq2seq4repair_space>returned<seq2seq4repair_space>" + ( matchingEntries . size ( ) ) ) + "<seq2seq4repair_space>entries<seq2seq4repair_space>for<seq2seq4repair_space>" ) + s ) ) ; for ( StopNameSQLHelper . SQLEntry entry : matchingEntries ) { if ( entry . stopID . matches ( "\\d+$" ) ) { if ( ! ( tmp . containsKey ( entry . stopName ) ) ) { OmniAutoCompleteEntry newEntry = new OmniAutoCompleteEntry ( entry . stopName , 1 ) ; Stop newStop = new Stop ( entry . stopID ) ; newStop . setLocation ( new BasicLocation ( entry . latitude , entry . longitude ) ) ; newEntry . setStop ( newStop ) ; tmp . put ( entry . stopName , newEntry ) ; } } } for ( Map . Entry < String , OmniAutoCompleteEntry > entry : tmp . entrySet ( ) ) { if ( ret . containsKey ( entry . getKey ( ) ) ) { ret . get ( entry . getKey ( ) ) . addPriority ( 1.0F ) ; Log . v ( StopNameSQLHelper . TAG , ( ( ( ( ( "Added<seq2seq4repair_space>priority:<seq2seq4repair_space>" + ( entry . getKey ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( ret . get ( entry . getKey ( ) ) . getPriority ( ) ) ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ) + s ) ) ; } else { ret . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } } Tracking . sendTime ( "SQL" , "StopNames" , "getAutocomplete" , t ) ; Log . d ( StopNameSQLHelper . TAG , ( ( ( ( "Got<seq2seq4repair_space>autocomplete<seq2seq4repair_space>for<seq2seq4repair_space>" + input ) + ",<seq2seq4repair_space>" ) + ( ret . size ( ) ) ) + "<seq2seq4repair_space>matches" ) ) ; return ret . values ( ) ; } @ Override public String getStopName ( String stopID ) { } @ Override public Collection < String > getStopID ( String stopName ) { } private boolean isCleanStopID ( String stopID ) { } private void cleanStopIDs ( Collection < String > ret ) { } private Collection < StopNameSQLHelper . SQLEntry > getMatchingEntries ( String table , String selection , String [ ] args , SQLiteDatabase db ) { } private Collection < StopNameSQLHelper . SQLEntry > getMatchingEntriesRaw ( String query , SQLiteDatabase db ) { } private Collection < String > getStringsFromSQL ( String query , SQLiteDatabase db , String columnName ) { } @ Override public void onCreate ( SQLiteDatabase sqLiteDatabase ) { } private String makeStopLocationRequest ( String stopID ) { } private String makeStopNameRequest ( String stopID ) { }

Fix:
Collection < StopNameSQLHelper . SQLEntry > matchingEntries = getAutoCompleteEntries ( db , s ) ;