Buggy code:
public class Badges { public static enum Badge { MONSTERS_SLAIN_1 ( "10<seq2seq4repair_space>enemies<seq2seq4repair_space>slain" , 0 ) , MONSTERS_SLAIN_2 ( "50<seq2seq4repair_space>enemies<seq2seq4repair_space>slain" , 1 ) , MONSTERS_SLAIN_3 ( "150<seq2seq4repair_space>enemies<seq2seq4repair_space>slain" , 2 ) , MONSTERS_SLAIN_4 ( "250<seq2seq4repair_space>enemies<seq2seq4repair_space>slain" , 3 ) , GOLD_COLLECTED_1 ( "100<seq2seq4repair_space>gold<seq2seq4repair_space>collected" , 4 ) , GOLD_COLLECTED_2 ( "500<seq2seq4repair_space>gold<seq2seq4repair_space>collected" , 5 ) , GOLD_COLLECTED_3 ( "2500<seq2seq4repair_space>gold<seq2seq4repair_space>collected" , 6 ) , GOLD_COLLECTED_4 ( "7500<seq2seq4repair_space>gold<seq2seq4repair_space>collected" , 7 ) , LEVEL_REACHED_1 ( "Level<seq2seq4repair_space>6<seq2seq4repair_space>reached" , 8 ) , LEVEL_REACHED_2 ( "Level<seq2seq4repair_space>12<seq2seq4repair_space>reached" , 9 ) , LEVEL_REACHED_3 ( "Level<seq2seq4repair_space>18<seq2seq4repair_space>reached" , 10 ) , LEVEL_REACHED_4 ( "Level<seq2seq4repair_space>24<seq2seq4repair_space>reached" , 11 ) , ALL_POTIONS_IDENTIFIED ( "All<seq2seq4repair_space>potions<seq2seq4repair_space>identified" , 16 ) , ALL_SCROLLS_IDENTIFIED ( "All<seq2seq4repair_space>scrolls<seq2seq4repair_space>identified" , 17 ) , ALL_RINGS_IDENTIFIED ( "All<seq2seq4repair_space>rings<seq2seq4repair_space>identified" , 18 ) , ALL_WANDS_IDENTIFIED ( "All<seq2seq4repair_space>wands<seq2seq4repair_space>identified" , 19 ) , ALL_ITEMS_IDENTIFIED ( "All<seq2seq4repair_space>potions,<seq2seq4repair_space>scrolls,<seq2seq4repair_space>rings<seq2seq4repair_space>&<seq2seq4repair_space>wands<seq2seq4repair_space>identified" , 35 , true ) , BAG_BOUGHT_SEED_POUCH , BAG_BOUGHT_SCROLL_HOLDER , BAG_BOUGHT_WAND_HOLSTER , ALL_BAGS_BOUGHT ( "All<seq2seq4repair_space>bags<seq2seq4repair_space>bought" , 23 ) , DEATH_FROM_FIRE ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>fire" , 24 ) , DEATH_FROM_POISON ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>poison" , 25 ) , DEATH_FROM_GAS ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>toxic<seq2seq4repair_space>gas" , 26 ) , DEATH_FROM_HUNGER ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>hunger" , 27 ) , DEATH_FROM_GLYPH ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>a<seq2seq4repair_space>glyph" , 57 ) , DEATH_FROM_FALLING ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>falling<seq2seq4repair_space>down" , 59 ) , YASD ( "Death<seq2seq4repair_space>from<seq2seq4repair_space>fire,<seq2seq4repair_space>poison,<seq2seq4repair_space>toxic<seq2seq4repair_space>gas<seq2seq4repair_space>&<seq2seq4repair_space>hunger" , 34 , true ) , BOSS_SLAIN_1_WARRIOR , BOSS_SLAIN_1_MAGE , BOSS_SLAIN_1_ROGUE , BOSS_SLAIN_1_HUNTRESS , BOSS_SLAIN_1 ( "1st<seq2seq4repair_space>boss<seq2seq4repair_space>slain" , 12 ) , BOSS_SLAIN_2 ( "2nd<seq2seq4repair_space>boss<seq2seq4repair_space>slain" , 13 ) , BOSS_SLAIN_3 ( "3rd<seq2seq4repair_space>boss<seq2seq4repair_space>slain" , 14 ) , BOSS_SLAIN_4 ( "4th<seq2seq4repair_space>boss<seq2seq4repair_space>slain" , 15 ) , BOSS_SLAIN_1_ALL_CLASSES ( "1st<seq2seq4repair_space>boss<seq2seq4repair_space>slain<seq2seq4repair_space>by<seq2seq4repair_space>Warrior,<seq2seq4repair_space>Mage,<seq2seq4repair_space>Rogue<seq2seq4repair_space>&<seq2seq4repair_space>Huntress" , 32 , true ) , BOSS_SLAIN_3_GLADIATOR , BOSS_SLAIN_3_BERSERKER , BOSS_SLAIN_3_WARLOCK , BOSS_SLAIN_3_BATTLEMAGE , BOSS_SLAIN_3_FREERUNNER , BOSS_SLAIN_3_ASSASSIN , BOSS_SLAIN_3_SNIPER , BOSS_SLAIN_3_WARDEN , BOSS_SLAIN_3_ALL_SUBCLASSES ( ( "3rd<seq2seq4repair_space>boss<seq2seq4repair_space>slain<seq2seq4repair_space>by<seq2seq4repair_space>Gladiator,<seq2seq4repair_space>Berserker,<seq2seq4repair_space>Warlock,<seq2seq4repair_space>Battlemage,<seq2seq4repair_space>" + "Freerunner,<seq2seq4repair_space>Assassin,<seq2seq4repair_space>Sniper<seq2seq4repair_space>&<seq2seq4repair_space>Warden" ) , 33 , true ) , RING_OF_HAGGLER ( "Ring<seq2seq4repair_space>of<seq2seq4repair_space>Haggler<seq2seq4repair_space>obtained" , 20 ) , RING_OF_THORNS ( "Ring<seq2seq4repair_space>of<seq2seq4repair_space>Thorns<seq2seq4repair_space>obtained" , 21 ) , STRENGTH_ATTAINED_1 ( "13<seq2seq4repair_space>points<seq2seq4repair_space>of<seq2seq4repair_space>Strength<seq2seq4repair_space>attained" , 40 ) , STRENGTH_ATTAINED_2 ( "15<seq2seq4repair_space>points<seq2seq4repair_space>of<seq2seq4repair_space>Strength<seq2seq4repair_space>attained" , 41 ) , STRENGTH_ATTAINED_3 ( "17<seq2seq4repair_space>points<seq2seq4repair_space>of<seq2seq4repair_space>Strength<seq2seq4repair_space>attained" , 42 ) , STRENGTH_ATTAINED_4 ( "19<seq2seq4repair_space>points<seq2seq4repair_space>of<seq2seq4repair_space>Strength<seq2seq4repair_space>attained" , 43 ) , FOOD_EATEN_1 ( "10<seq2seq4repair_space>pieces<seq2seq4repair_space>of<seq2seq4repair_space>food<seq2seq4repair_space>eaten" , 44 ) , FOOD_EATEN_2 ( "20<seq2seq4repair_space>pieces<seq2seq4repair_space>of<seq2seq4repair_space>food<seq2seq4repair_space>eaten" , 45 ) , FOOD_EATEN_3 ( "30<seq2seq4repair_space>pieces<seq2seq4repair_space>of<seq2seq4repair_space>food<seq2seq4repair_space>eaten" , 46 ) , FOOD_EATEN_4 ( "40<seq2seq4repair_space>pieces<seq2seq4repair_space>of<seq2seq4repair_space>food<seq2seq4repair_space>eaten" , 47 ) , MASTERY_WARRIOR , MASTERY_MAGE , MASTERY_ROGUE , MASTERY_HUNTRESS , ITEM_LEVEL_1 ( "Item<seq2seq4repair_space>of<seq2seq4repair_space>level<seq2seq4repair_space>3<seq2seq4repair_space>acquired" , 48 ) , ITEM_LEVEL_2 ( "Item<seq2seq4repair_space>of<seq2seq4repair_space>level<seq2seq4repair_space>6<seq2seq4repair_space>acquired" , 49 ) , ITEM_LEVEL_3 ( "Item<seq2seq4repair_space>of<seq2seq4repair_space>level<seq2seq4repair_space>9<seq2seq4repair_space>acquired" , 50 ) , ITEM_LEVEL_4 ( "Item<seq2seq4repair_space>of<seq2seq4repair_space>level<seq2seq4repair_space>12<seq2seq4repair_space>acquired" , 51 ) , RARE_ALBINO , RARE_BANDIT , RARE_SHIELDED , RARE_SENIOR , RARE_ACIDIC , RARE ( "All<seq2seq4repair_space>rare<seq2seq4repair_space>monsters<seq2seq4repair_space>slain" , 37 , true ) , VICTORY_WARRIOR , VICTORY_MAGE , VICTORY_ROGUE , VICTORY_HUNTRESS , VICTORY ( "Amulet<seq2seq4repair_space>of<seq2seq4repair_space>Yendor<seq2seq4repair_space>obtained" , 22 ) , VICTORY_ALL_CLASSES ( "Amulet<seq2seq4repair_space>of<seq2seq4repair_space>Yendor<seq2seq4repair_space>obtained<seq2seq4repair_space>by<seq2seq4repair_space>Warrior,<seq2seq4repair_space>Mage,<seq2seq4repair_space>Rogue<seq2seq4repair_space>&<seq2seq4repair_space>Huntress" , 36 , true ) , MASTERY_COMBO ( "7-hit<seq2seq4repair_space>combo" , 56 ) , POTIONS_COOKED_1 ( "3<seq2seq4repair_space>potions<seq2seq4repair_space>cooked" , 52 ) , POTIONS_COOKED_2 ( "6<seq2seq4repair_space>potions<seq2seq4repair_space>cooked" , 53 ) , POTIONS_COOKED_3 ( "9<seq2seq4repair_space>potions<seq2seq4repair_space>cooked" , 54 ) , POTIONS_COOKED_4 ( "12<seq2seq4repair_space>potions<seq2seq4repair_space>cooked" , 55 ) , NO_MONSTERS_SLAIN ( "Level<seq2seq4repair_space>completed<seq2seq4repair_space>without<seq2seq4repair_space>killing<seq2seq4repair_space>any<seq2seq4repair_space>monsters" , 28 ) , GRIM_WEAPON ( "Monster<seq2seq4repair_space>killed<seq2seq4repair_space>by<seq2seq4repair_space>a<seq2seq4repair_space>Grim<seq2seq4repair_space>weapon" , 29 ) , PIRANHAS ( "6<seq2seq4repair_space>piranhas<seq2seq4repair_space>killed" , 30 ) , NIGHT_HUNTER ( "15<seq2seq4repair_space>monsters<seq2seq4repair_space>killed<seq2seq4repair_space>at<seq2seq4repair_space>nighttime" , 58 ) , GAMES_PLAYED_1 ( "10<seq2seq4repair_space>games<seq2seq4repair_space>played" , 60 , true ) , GAMES_PLAYED_2 ( "100<seq2seq4repair_space>games<seq2seq4repair_space>played" , 61 , true ) , GAMES_PLAYED_3 ( "500<seq2seq4repair_space>games<seq2seq4repair_space>played" , 62 , true ) , GAMES_PLAYED_4 ( "2000<seq2seq4repair_space>games<seq2seq4repair_space>played" , 63 , true ) , HAPPY_END ( "Happy<seq2seq4repair_space>end" , 38 ) , CHAMPION ( "Challenge<seq2seq4repair_space>won" , 39 , true ) , SUPPORTER ( "Thanks<seq2seq4repair_space>for<seq2seq4repair_space>your<seq2seq4repair_space>support!" , 31 , true ) ; public boolean meta ; public String description ; public int image ; private Badge ( String description , int image ) { } private Badge ( String description , int image , boolean meta ) { } private Badge ( ) { } } private static HashSet < Badges . Badge > global ; private static HashSet < Badges . Badge > local = new HashSet < Badges . Badge > ( ) ; private static boolean saveNeeded = false ; public static void reset ( ) { } private static final String BADGES_FILE = "badges.dat" ; private static final String BADGES = "badges" ; private static HashSet < Badges . Badge > restore ( Bundle bundle ) { } private static void store ( Bundle bundle , HashSet < Badges . Badge > badges ) { int count = 0 ; <START_BUG> String [ ] names = new String [ Badges . global . size ( ) ] ; <END_BUG> for ( Badges . Badge badge : badges ) { names [ ( count ++ ) ] = badge . toString ( ) ; } bundle . put ( Badges . BADGES , names ) ; } public static void loadLocal ( Bundle bundle ) { } public static void saveLocal ( Bundle bundle ) { } public static void loadGlobal ( ) { } public static void saveGlobal ( ) { } public static void validateMonstersSlain ( ) { } public static void validateGoldCollected ( ) { } public static void validateLevelReached ( ) { } public static void validateStrengthAttained ( ) { } public static void validateFoodEaten ( ) { } public static void validatePotionsCooked ( ) { } public static void validatePiranhasKilled ( ) { } public static void validateItemLevelAquired ( Item item ) { } public static void validateAllPotionsIdentified ( ) { } public static void validateAllScrollsIdentified ( ) { } public static void validateAllRingsIdentified ( ) { } public static void validateAllWandsIdentified ( ) { } public static void validateAllBagsBought ( Item bag ) { } public static void validateAllItemsIdentified ( ) { } public static void validateDeathFromFire ( ) { } public static void validateDeathFromPoison ( ) { } public static void validateDeathFromGas ( ) { } public static void validateDeathFromHunger ( ) { } public static void validateDeathFromGlyph ( ) { } public static void validateDeathFromFalling ( ) { } private static void validateYASD ( ) { } public static void validateBossSlain ( ) { } public static void validateMastery ( ) { } public static void validateMasteryCombo ( int n ) { } public static void validateRingOfHaggler ( ) { } public static void validateRingOfThorns ( ) { } public static void validateRare ( Mob mob ) { }

Fix:
String [ ] names = new String [ badges . size ( ) ] ;