Program: 164114
Project: 164114
Buggy source:
public static void saveGame(String fileName) throws IOException {
  try {
    Bundle bundle=new Bundle();
    version=Game.versionCode;
    bundle.put(VERSION,version);
    bundle.put(CHALLENGES,challenges);
    bundle.put(HERO,hero);
    bundle.put(GOLD,gold);
    bundle.put(DEPTH,depth);
    for (    int d : droppedItems.keyArray()) {
      bundle.put(String.format(DROPPED,d),droppedItems.get(d));
    }
    quickslot.storePlaceholders(bundle);
    bundle.put(WT,transmutation);
    int[] dropValues=new int[limitedDrops.values().length];
    for (    limitedDrops value : limitedDrops.values())     dropValues[value.ordinal()]=value.count;
    bundle.put(LIMDROPS,dropValues);
    int count=0;
    int ids[]=new int[chapters.size()];
    for (    Integer id : chapters) {
      ids[count++]=id;
    }
    bundle.put(CHAPTERS,ids);
    Bundle quests=new Bundle();
    Ghost.Quest.storeInBundle(quests);
    Wandmaker.Quest.storeInBundle(quests);
    Blacksmith.Quest.storeInBundle(quests);
    Imp.Quest.storeInBundle(quests);
    bundle.put(QUESTS,quests);
    Room.storeRoomsInBundle(bundle);
    Statistics.storeInBundle(bundle);
    Journal.storeInBundle(bundle);
    Generator.storeInBundle(bundle);
    Scroll.save(bundle);
    Potion.save(bundle);
    Ring.save(bundle);
    Actor.storeNextID(bundle);
    Bundle badges=new Bundle();
    Badges.saveLocal(badges);
    bundle.put(BADGES,badges);
    OutputStream output=Game.instance.openFileOutput(fileName,Game.MODE_PRIVATE);
    Bundle.write(bundle,output);
    output.close();
  }
 catch (  IOException e) {
    GamesInProgress.setUnknown(hero.heroClass);
    ShatteredPixelDungeon.reportException(e);
  }
}

Fixed version (ground truth):
public static void saveGame(String fileName) throws IOException {
  try {
    Bundle bundle=new Bundle();
    version=Game.versionCode;
    bundle.put(VERSION,version);
    bundle.put(CHALLENGES,challenges);
    bundle.put(HERO,hero);
    bundle.put(GOLD,gold);
    bundle.put(DEPTH,depth);
    for (    int d : droppedItems.keyArray()) {
      bundle.put(Messages.format(DROPPED,d),droppedItems.get(d));
    }
    quickslot.storePlaceholders(bundle);
    bundle.put(WT,transmutation);
    int[] dropValues=new int[limitedDrops.values().length];
    for (    limitedDrops value : limitedDrops.values())     dropValues[value.ordinal()]=value.count;
    bundle.put(LIMDROPS,dropValues);
    int count=0;
    int ids[]=new int[chapters.size()];
    for (    Integer id : chapters) {
      ids[count++]=id;
    }
    bundle.put(CHAPTERS,ids);
    Bundle quests=new Bundle();
    Ghost.Quest.storeInBundle(quests);
    Wandmaker.Quest.storeInBundle(quests);
    Blacksmith.Quest.storeInBundle(quests);
    Imp.Quest.storeInBundle(quests);
    bundle.put(QUESTS,quests);
    Room.storeRoomsInBundle(bundle);
    Statistics.storeInBundle(bundle);
    Journal.storeInBundle(bundle);
    Generator.storeInBundle(bundle);
    Scroll.save(bundle);
    Potion.save(bundle);
    Ring.save(bundle);
    Actor.storeNextID(bundle);
    Bundle badges=new Bundle();
    Badges.saveLocal(badges);
    bundle.put(BADGES,badges);
    OutputStream output=Game.instance.openFileOutput(fileName,Game.MODE_PRIVATE);
    Bundle.write(bundle,output);
    output.close();
  }
 catch (  IOException e) {
    GamesInProgress.setUnknown(hero.heroClass);
    ShatteredPixelDungeon.reportException(e);
  }
}