Buggy code:
public static final int PLANNED_POKEMON = 200 ; public static final String PLANNED_POKEMON_SEARCH_GENERAL_TABLE = ( TinapaContentProvider . PLANNED_POKEMON_TABLE ) + "//search//general//*" ; public static final Uri PLANNED_POKEMON_SEARCH_GENERAL_URI = Uri . parse ( ( ( ( "content:////" + ( TinapaContentProvider . AUTHORITY ) ) + "//" ) + ( TinapaContentProvider . PLANNED_POKEMON_SEARCH_GENERAL_TABLE ) ) ) ; public static final int PLANNED_POKEMON_SEARCH_GENERAL = 201 ; private static final String OWNED_POKEMON_TABLE = "ownedPokemon" ; public static final Uri OWNED_POKEMON_URI = Uri . parse ( ( ( ( "content:////" + ( TinapaContentProvider . AUTHORITY ) ) + "//" ) + ( TinapaContentProvider . OWNED_POKEMON_TABLE ) ) ) ; public static final int OWNED_POKEMON = 300 ; public static final String OWNED_POKEMON_SEARCH_GENERAL_TABLE = ( TinapaContentProvider . OWNED_POKEMON_TABLE ) + "//search//general//*" ; public static final Uri OWNED_POKEMON_SEARCH_GENERAL_URI = Uri . parse ( ( ( ( "content:////" + ( TinapaContentProvider . AUTHORITY ) ) + "//" ) + ( TinapaContentProvider . OWNED_POKEMON_SEARCH_GENERAL_TABLE ) ) ) ; public static final int OWNED_POKEMON_SEARCH_GENERAL = 301 ; private static final String PLANNED_TEAM_TABLE = "plannedTeam" ; public static final Uri PLANNED_TEAM_URI = Uri . parse ( ( ( ( "content:////" + ( TinapaContentProvider . AUTHORITY ) ) + "//" ) + ( TinapaContentProvider . PLANNED_TEAM_TABLE ) ) ) ; public static final int PLANNED_TEAM = 400 ; private static final UriMatcher uriMatcher = new UriMatcher ( UriMatcher . NO_MATCH ) ; @ Override public boolean onCreate ( ) { } @ Override public int delete ( Uri uri , String selection , String [ ] selectionArgs ) { } @ Override public String getType ( Uri uri ) { } @ Override public Uri insert ( Uri uri , ContentValues values ) { } @ Override public Cursor query ( Uri uri , String [ ] projection , String selection , String [ ] selectionArgs , String sortOrder ) { SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder ( ) ; String [ ] selectionArray = null ; String orderBy = null ; SQLiteDatabase db = dbHelper . getReadableDatabase ( ) ; int uriType = TinapaContentProvider . uriMatcher . match ( uri ) ; switch ( uriType ) { case TinapaContentProvider . POKEDEX : queryBuilder . setTables ( "pokemon<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_species_names<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_species_names.pokemon_species_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_species_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>1)<seq2seq4repair_space>AS<seq2seq4repair_space>type1<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type1.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>2)<seq2seq4repair_space>AS<seq2seq4repair_space>type2<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type2.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_abilities,<seq2seq4repair_space>abilities,<seq2seq4repair_space>ability_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>abilities.id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>1)<seq2seq4repair_space>AS<seq2seq4repair_space>ability1<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>ability1.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_abilities,<seq2seq4repair_space>abilities,<seq2seq4repair_space>ability_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>abilities.id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>2)<seq2seq4repair_space>AS<seq2seq4repair_space>ability2<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>ability2.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_abilities,<seq2seq4repair_space>abilities,<seq2seq4repair_space>ability_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>abilities.id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>3)<seq2seq4repair_space>AS<seq2seq4repair_space>ability3<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>ability3.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"hp\")<seq2seq4repair_space>AS<seq2seq4repair_space>hp<seq2seq4repair_space>ON<seq2seq4repair_space>(hp.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"attack\")<seq2seq4repair_space>AS<seq2seq4repair_space>att<seq2seq4repair_space>ON<seq2seq4repair_space>(att.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"defense\")<seq2seq4repair_space>AS<seq2seq4repair_space>def<seq2seq4repair_space>ON<seq2seq4repair_space>(def.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"special-attack\")<seq2seq4repair_space>AS<seq2seq4repair_space>satt<seq2seq4repair_space>ON<seq2seq4repair_space>(satt.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"special-defense\")<seq2seq4repair_space>AS<seq2seq4repair_space>sdef<seq2seq4repair_space>ON<seq2seq4repair_space>(sdef.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>pokemon_id,<seq2seq4repair_space>base_stat,<seq2seq4repair_space>name<seq2seq4repair_space>FROM<seq2seq4repair_space>stats,<seq2seq4repair_space>pokemon_stats,<seq2seq4repair_space>stat_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>stat_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>stats.id<seq2seq4repair_space>=<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stat_names.stat_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_stats.stat_id<seq2seq4repair_space>AND<seq2seq4repair_space>stats.identifier<seq2seq4repair_space>=<seq2seq4repair_space>\"speed\")<seq2seq4repair_space>AS<seq2seq4repair_space>spd<seq2seq4repair_space>ON<seq2seq4repair_space>(spd.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)" ) ; if ( ( selection != null ) && ( ! ( selection . isEmpty ( ) ) ) ) { queryBuilder . appendWhere ( selection ) ; } selectionArray = new String [ ] { "pokemon.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "pokemon_species_names.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . name ) , "pokemon.species_id<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . number ) , "type1.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . type1 ) , "type2.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . type2 ) , "ability1.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability1Name ) , "ability1.id<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability1ID ) , "ability2.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability2Name ) , "ability2.id<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability2ID ) , "ability3.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability3Name ) , "ability3.id<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . ability3ID ) , "hp.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseHP ) , "att.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseAttack ) , "def.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseDefense ) , "satt.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseSpecialAttack ) , "sdef.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseSpecialDefense ) , "spd.base_stat<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . baseSpeed ) , "image<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . image ) , "shinny_image<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . shinnyImage ) , "icon_image<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . iconImage ) } ; break ; case TinapaContentProvider . POKEDEX_ALL_SHORT : queryBuilder . setTables ( "pokemon<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_species_names<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_species_names.pokemon_species_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_species_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>1)<seq2seq4repair_space>AS<seq2seq4repair_space>type1<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type1.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>2)<seq2seq4repair_space>AS<seq2seq4repair_space>type2<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type2.pokemon_id)" ) ; if ( ! ( TextUtils . isEmpty ( selection ) ) ) { queryBuilder . appendWhere ( ( ( "pokemon_species_names.name<seq2seq4repair_space>LIKE<seq2seq4repair_space>'%" + selection ) + "%'" ) ) ; } selectionArray = new String [ ] { "pokemon.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "pokemon_species_names.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . name ) , "pokemon.species_id<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . number ) , "type1.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . type1 ) , "type2.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . type2 ) , "icon_image<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( DexKeyValues . iconImage ) } ; break ; case TinapaContentProvider . POKEDEX_SEARCH_SPECIES : break ; case TinapaContentProvider . POKEDEX_POKEMON_MOVES : queryBuilder . setTables ( "moves<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_moves<seq2seq4repair_space>ON<seq2seq4repair_space>(moves.id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_moves.move_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_moves.version_group_id<seq2seq4repair_space>=<seq2seq4repair_space>15)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_move_methods<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon_move_methods.id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_moves.pokemon_move_method_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>ON<seq2seq4repair_space>(moves.id<seq2seq4repair_space>=<seq2seq4repair_space>move_names.move_id<seq2seq4repair_space>AND<seq2seq4repair_space>move_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_flavor_text<seq2seq4repair_space>ON<seq2seq4repair_space>(moves.id<seq2seq4repair_space>=<seq2seq4repair_space>move_flavor_text.move_id<seq2seq4repair_space>AND<seq2seq4repair_space>move_flavor_text.language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>move_flavor_text.version_group_id<seq2seq4repair_space>=<seq2seq4repair_space>15)" ) ; if ( ( selection != null ) && ( ! ( selection . isEmpty ( ) ) ) ) { queryBuilder . appendWhere ( selection ) ; } selectionArray = new String [ ] { "moves.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "name" , "flavor_text" , "pokemon_move_methods.identifier<seq2seq4repair_space>AS<seq2seq4repair_space>identifier" } ; break ; case TinapaContentProvider . POKEDEX_POKEMON_ABILITIES : queryBuilder . setTables ( "pokemon_abilities,<seq2seq4repair_space>abilities,<seq2seq4repair_space>ability_names" ) ; <START_BUG> queryBuilder . appendWhere ( "local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>abilities.id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>1" ) ; <END_BUG> if ( ! ( TextUtils . isEmpty ( selection ) ) ) { queryBuilder . appendWhere ( ( "<seq2seq4repair_space>AND<seq2seq4repair_space>" + selection ) ) ; } selectionArray = new String [ ] { "id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "name<seq2seq4repair_space>AS<seq2seq4repair_space>name" , "pokemon_id<seq2seq4repair_space>AS<seq2seq4repair_space>pokemon_id" , "slot<seq2seq4repair_space>AS<seq2seq4repair_space>slot" , "is_hidden<seq2seq4repair_space>AS<seq2seq4repair_space>is_hidden" } ; orderBy = "slot<seq2seq4repair_space>ASC" ; break ; case TinapaContentProvider . PLANNED_POKEMON : break ; case TinapaContentProvider . PLANNED_POKEMON_SEARCH_GENERAL : queryBuilder . setTables ( "planned_pokemons<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon<seq2seq4repair_space>ON<seq2seq4repair_space>(planned_pokemons.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_species_names<seq2seq4repair_space>ON<seq2seq4repair_space>(planned_pokemons.pokemon_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_species_names.pokemon_species_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_species_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)" ) ; if ( ! ( TextUtils . isEmpty ( selection ) ) ) { queryBuilder . appendWhere ( ( ( "pokemon_species_names<seq2seq4repair_space>LIKE<seq2seq4repair_space>%'" + selection ) + "'%" ) ) ; } selectionArray = new String [ ] { "planned_pokemons.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "pokemon_species_names.name<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( PlannedKeyValues . NAME ) , "pokemon.icon_image<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( PlannedKeyValues . ICON_IMAGE ) } ; break ; case TinapaContentProvider . OWNED_POKEMON : queryBuilder . setTables ( "owned_pokemons<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_species_names<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_species_names.pokemon_species_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_species_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>1)<seq2seq4repair_space>AS<seq2seq4repair_space>type1<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type1.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>2)<seq2seq4repair_space>AS<seq2seq4repair_space>type2<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type2.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AS<seq2seq4repair_space>id,<seq2seq4repair_space>name,<seq2seq4repair_space>effect<seq2seq4repair_space>FROM<seq2seq4repair_space>ability_names,<seq2seq4repair_space>ability_prose<seq2seq4repair_space>WHERE<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_prose.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>ability_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>ability_prose.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>AS<seq2seq4repair_space>ability<seq2seq4repair_space>ON<seq2seq4repair_space>(owned_pokemons.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>nature_names<seq2seq4repair_space>ON<seq2seq4repair_space>(owned_pokemons.nature_id<seq2seq4repair_space>=<seq2seq4repair_space>nature_names.nature_id<seq2seq4repair_space>AND<seq2seq4repair_space>nature_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>genders<seq2seq4repair_space>ON<seq2seq4repair_space>(genders.id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.gender_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move1<seq2seq4repair_space>ON<seq2seq4repair_space>(move1.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move1_id<seq2seq4repair_space>AND<seq2seq4repair_space>move1.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move2<seq2seq4repair_space>ON<seq2seq4repair_space>(move2.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move2_id<seq2seq4repair_space>AND<seq2seq4repair_space>move2.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move3<seq2seq4repair_space>ON<seq2seq4repair_space>(move3.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move3_id<seq2seq4repair_space>AND<seq2seq4repair_space>move3.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move4<seq2seq4repair_space>ON<seq2seq4repair_space>(move4.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move4_id<seq2seq4repair_space>AND<seq2seq4repair_space>move4.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)" ) ; if ( ( selection != null ) && ( ! ( selection . isEmpty ( ) ) ) ) { queryBuilder . appendWhere ( selection ) ; } selectionArray = new String [ ] { "owned_pokemons.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "owned_pokemons.nickname<seq2seq4repair_space>AS<seq2seq4repair_space>nickname" , "pokemon_species_names.name<seq2seq4repair_space>AS<seq2seq4repair_space>name" , "icon_image" , "image" , "shinny_image" , "iv_hp" , "iv_att" , "iv_def" , "iv_satt" , "iv_sdef" , "iv_spd" , "ev_hp" , "ev_att" , "ev_def" , "ev_satt" , "ev_sdef" , "ev_spd" , "level" , "shinny" , "note" , "nature.name<seq2seq4repair_space>AS<seq2seq4repair_space>nature_name" } ; break ; case TinapaContentProvider . OWNED_POKEMON_SEARCH_GENERAL : queryBuilder . setTables ( "owned_pokemons<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>pokemon_species_names<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.species_id<seq2seq4repair_space>=<seq2seq4repair_space>pokemon_species_names.pokemon_species_id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_species_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>1)<seq2seq4repair_space>AS<seq2seq4repair_space>type1<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type1.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>name,<seq2seq4repair_space>pokemon_id<seq2seq4repair_space>FROM<seq2seq4repair_space>pokemon_types,<seq2seq4repair_space>type_names<seq2seq4repair_space>WHERE<seq2seq4repair_space>local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_types.type_id<seq2seq4repair_space>=<seq2seq4repair_space>type_names.type_id<seq2seq4repair_space>AND<seq2seq4repair_space>slot<seq2seq4repair_space>=<seq2seq4repair_space>2)<seq2seq4repair_space>AS<seq2seq4repair_space>type2<seq2seq4repair_space>ON<seq2seq4repair_space>(pokemon.id<seq2seq4repair_space>=<seq2seq4repair_space>type2.pokemon_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>(SELECT<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>AS<seq2seq4repair_space>id,<seq2seq4repair_space>name,<seq2seq4repair_space>effect<seq2seq4repair_space>FROM<seq2seq4repair_space>ability_names,<seq2seq4repair_space>ability_prose<seq2seq4repair_space>WHERE<seq2seq4repair_space>ability_names.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_prose.ability_id<seq2seq4repair_space>AND<seq2seq4repair_space>ability_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>ability_prose.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>AS<seq2seq4repair_space>ability<seq2seq4repair_space>ON<seq2seq4repair_space>(owned_pokemons.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability.id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>nature_names<seq2seq4repair_space>ON<seq2seq4repair_space>(owned_pokemons.nature_id<seq2seq4repair_space>=<seq2seq4repair_space>nature_names.nature_id<seq2seq4repair_space>AND<seq2seq4repair_space>nature_names.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>genders<seq2seq4repair_space>ON<seq2seq4repair_space>(genders.id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.gender_id)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move1<seq2seq4repair_space>ON<seq2seq4repair_space>(move1.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move1_id<seq2seq4repair_space>AND<seq2seq4repair_space>move1.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move2<seq2seq4repair_space>ON<seq2seq4repair_space>(move2.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move2_id<seq2seq4repair_space>AND<seq2seq4repair_space>move2.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move3<seq2seq4repair_space>ON<seq2seq4repair_space>(move3.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move3_id<seq2seq4repair_space>AND<seq2seq4repair_space>move3.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)<seq2seq4repair_space>LEFT<seq2seq4repair_space>OUTER<seq2seq4repair_space>JOIN<seq2seq4repair_space>move_names<seq2seq4repair_space>AS<seq2seq4repair_space>move4<seq2seq4repair_space>ON<seq2seq4repair_space>(move4.move_id<seq2seq4repair_space>=<seq2seq4repair_space>owned_pokemons.move4_id<seq2seq4repair_space>AND<seq2seq4repair_space>move4.local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9)" ) ; selectionArray = new String [ ] { "pokemon.id<seq2seq4repair_space>AS<seq2seq4repair_space>_id" , "owned_pokemons.nickname<seq2seq4repair_space>AS<seq2seq4repair_space>" + ( OwnedKeyValues . NICKNAME ) , "pokemon_species_names.name<seq2seq4repair_space>AS<seq2seq4repair_space>name" , "icon_image<seq2seq4repair_space>AS<seq2seq4repair_space>image" } ;

Fix:
queryBuilder . appendWhere ( "local_language_id<seq2seq4repair_space>=<seq2seq4repair_space>9<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>abilities.id<seq2seq4repair_space>AND<seq2seq4repair_space>pokemon_abilities.ability_id<seq2seq4repair_space>=<seq2seq4repair_space>ability_names.ability_id" ) ;