Program: 164386
Project: 164386
Buggy source:
public void create(){
  resizingNeeded=false;
  map=new int[LENGTH];
  visited=new boolean[LENGTH];
  Arrays.fill(visited,false);
  mapped=new boolean[LENGTH];
  Arrays.fill(mapped,false);
  mobs=new HashSet<Mob>();
  heaps=new SparseArray<Heap>();
  blobs=new HashMap<Class<? extends Blob>,Blob>();
  plants=new SparseArray<Plant>();
  if (!Dungeon.bossLevel()) {
    addItemToSpawn(Generator.random(Generator.Category.FOOD));
    if (Dungeon.posNeeded()) {
      addItemToSpawn(new PotionOfStrength());
      Dungeon.limitedDrops.strengthPotions.count++;
    }
    if (Dungeon.soeNeeded()) {
      addItemToSpawn(new ScrollOfUpgrade());
      Dungeon.limitedDrops.upgradeScrolls.count++;
    }
    if (Dungeon.asNeeded()) {
      addItemToSpawn(new Stylus());
      Dungeon.limitedDrops.arcaneStyli.count++;
    }
    int bonus=0;
    for (    Buff buff : Dungeon.hero.buffs(RingOfWealth.Wealth.class)) {
      bonus+=((RingOfWealth.Wealth)buff).level;
    }
    if (Random.Float() > Math.pow(0.95,bonus)) {
      if (Random.Int(2) == 0)       addItemToSpawn(new ScrollOfWeaponUpgrade());
 else       addItemToSpawn(new PotionOfMight());
    }
    DriedRose rose=Dungeon.hero.belongings.getItem(DriedRose.class);
    if (rose != null) {
      int petalsNeeded=(int)Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
      for (int i=1; i <= petalsNeeded; i++) {
        if (rose.droppedPetals < 10) {
          addItemToSpawn(new DriedRose.Petal());
          rose.droppedPetals++;
        }
      }
    }
    if (Dungeon.depth > 1) {
switch (Random.Int(10)) {
case 0:
        if (!Dungeon.bossLevel(Dungeon.depth + 1)) {
          feeling=Feeling.CHASM;
        }
      break;
case 1:
    feeling=Feeling.WATER;
  break;
case 2:
feeling=Feeling.GRASS;
break;
}
}
}
boolean pitNeeded=Dungeon.depth > 1 && weakFloorCreated;
do {
Arrays.fill(map,feeling == Feeling.CHASM ? Terrain.CHASM : Terrain.WALL);
pitRoomNeeded=pitNeeded;
weakFloorCreated=false;
}
 while (!build());
decorate();
buildFlagMaps();
cleanWalls();
createMobs();
createItems();
}

Fixed version (ground truth):
public void create(){
  resizingNeeded=false;
  map=new int[LENGTH];
  visited=new boolean[LENGTH];
  Arrays.fill(visited,false);
  mapped=new boolean[LENGTH];
  Arrays.fill(mapped,false);
  mobs=new HashSet<Mob>();
  heaps=new SparseArray<Heap>();
  blobs=new HashMap<Class<? extends Blob>,Blob>();
  plants=new SparseArray<Plant>();
  if (!Dungeon.bossLevel()) {
    addItemToSpawn(Generator.random(Generator.Category.FOOD));
    if (Dungeon.posNeeded()) {
      addItemToSpawn(new PotionOfStrength());
      Dungeon.limitedDrops.strengthPotions.count++;
    }
    if (Dungeon.soeNeeded()) {
      addItemToSpawn(new ScrollOfUpgrade());
      Dungeon.limitedDrops.upgradeScrolls.count++;
    }
    if (Dungeon.asNeeded()) {
      addItemToSpawn(new Stylus());
      Dungeon.limitedDrops.arcaneStyli.count++;
    }
    int bonus=0;
    for (    Buff buff : Dungeon.hero.buffs(RingOfWealth.Wealth.class)) {
      bonus+=((RingOfWealth.Wealth)buff).level;
    }
    if (Random.Float() > Math.pow(0.95,bonus)) {
      if (Random.Int(2) == 0)       addItemToSpawn(new ScrollOfWeaponUpgrade());
 else       addItemToSpawn(new PotionOfMight());
    }
    DriedRose rose=Dungeon.hero.belongings.getItem(DriedRose.class);
    if (rose != null && !rose.cursed) {
      int petalsNeeded=(int)Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
      for (int i=1; i <= petalsNeeded; i++) {
        if (rose.droppedPetals < 10) {
          addItemToSpawn(new DriedRose.Petal());
          rose.droppedPetals++;
        }
      }
    }
    if (Dungeon.depth > 1) {
switch (Random.Int(10)) {
case 0:
        if (!Dungeon.bossLevel(Dungeon.depth + 1)) {
          feeling=Feeling.CHASM;
        }
      break;
case 1:
    feeling=Feeling.WATER;
  break;
case 2:
feeling=Feeling.GRASS;
break;
}
}
}
boolean pitNeeded=Dungeon.depth > 1 && weakFloorCreated;
do {
Arrays.fill(map,feeling == Feeling.CHASM ? Terrain.CHASM : Terrain.WALL);
pitRoomNeeded=pitNeeded;
weakFloorCreated=false;
}
 while (!build());
decorate();
buildFlagMaps();
cleanWalls();
createMobs();
createItems();
}