Program: 58069
Project: 58069
Buggy source:
public static void saveBlocks(final World world,final int maxY,int x,int z,int offset_x,int offset_z){
  final HashMap<Short,Short> ids=new HashMap<>();
  final HashMap<Short,Byte> datas=new HashMap<>();
  for (short y=1; y < maxY; y++) {
    final Block block=world.getBlockAt(x,y,z);
    final short id=(short)block.getTypeId();
    if (id != 0) {
      ids.put(y,id);
      final byte data=block.getData();
      if (data != 0) {
        datas.put(y,data);
      }
      BlockLoc bl;
switch (id) {
case 54:
        bl=new BlockLoc(x + offset_x,y,z + offset_z);
      final InventoryHolder chest=(InventoryHolder)block.getState();
    final ItemStack[] inventory=chest.getInventory().getContents().clone();
  chestContents.put(bl,inventory);
break;
case 52:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final CreatureSpawner spawner=(CreatureSpawner)block.getState();
final String type=spawner.getCreatureTypeId();
if ((type != null) && (type.length() != 0)) {
spawnerData.put(bl,type);
}
break;
case 137:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final CommandBlock cmd=(CommandBlock)block.getState();
final String string=cmd.getCommand();
if ((string != null) && (string.length() > 0)) {
cmdData.put(bl,string);
}
break;
case 63:
case 68:
case 323:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Sign sign=(Sign)block.getState();
sign.getLines();
signContents.put(bl,sign.getLines().clone());
break;
case 61:
case 62:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Furnace furnace=(Furnace)block.getState();
final short burn=furnace.getBurnTime();
final short cook=furnace.getCookTime();
final ItemStack[] invFur=furnace.getInventory().getContents().clone();
furnaceContents.put(bl,invFur);
if (cook != 0) {
furnaceTime.put(bl,new Short[]{burn,cook});
}
break;
case 23:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Dispenser dispenser=(Dispenser)block.getState();
final ItemStack[] invDis=dispenser.getInventory().getContents().clone();
dispenserContents.put(bl,invDis);
break;
case 158:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Dropper dropper=(Dropper)block.getState();
final ItemStack[] invDro=dropper.getInventory().getContents().clone();
dropperContents.put(bl,invDro);
break;
case 117:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final BrewingStand brewingStand=(BrewingStand)block.getState();
final short time=(short)brewingStand.getBrewingTime();
if (time > 0) {
brewTime.put(bl,time);
}
final ItemStack[] invBre=brewingStand.getInventory().getContents().clone();
brewingStandContents.put(bl,invBre);
break;
case 25:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final NoteBlock noteBlock=(NoteBlock)block.getState();
final Note note=noteBlock.getNote();
noteBlockContents.put(bl,note);
break;
case 138:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Beacon beacon=(Beacon)block.getState();
final ItemStack[] invBea=beacon.getInventory().getContents().clone();
beaconContents.put(bl,invBea);
break;
case 84:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Jukebox jukebox=(Jukebox)block.getState();
final Material playing=jukebox.getPlaying();
if (playing != null) {
jukeDisc.put(bl,(short)playing.getId());
}
break;
case 154:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Hopper hopper=(Hopper)block.getState();
final ItemStack[] invHop=hopper.getInventory().getContents().clone();
hopperContents.put(bl,invHop);
break;
case 397:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Skull skull=(Skull)block.getState();
final String o=skull.getOwner();
final byte skulltype=getOrdinal(SkullType.values(),skull.getSkullType());
skull.getRotation();
final short rot=getOrdinal(BlockFace.values(),skull.getRotation());
skullData.put(bl,new Object[]{o,rot,skulltype});
break;
case 176:
case 177:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Banner banner=(Banner)block.getState();
final byte base=getOrdinal(DyeColor.values(),banner.getBaseColor());
final ArrayList<Byte[]> types=new ArrayList<>();
for (final Pattern pattern : banner.getPatterns()) {
types.add(new Byte[]{getOrdinal(PatternType.values(),pattern.getPattern()),pattern.getColor().getDyeData()});
}
bannerBase.put(bl,base);
bannerColors.put(bl,types);
break;
}
}
}
final ChunkLoc loc=new ChunkLoc(x,z);
GENERATE_BLOCKS.put(loc,ids);
GENERATE_DATA.put(loc,datas);
}

Fixed version (ground truth):
public static void saveBlocks(final World world,final int maxY,int x,int z,int offset_x,int offset_z){
  final HashMap<Short,Short> ids=new HashMap<>();
  final HashMap<Short,Byte> datas=new HashMap<>();
  for (short y=0; y < maxY; y++) {
    final Block block=world.getBlockAt(x,y,z);
    final short id=(short)block.getTypeId();
    if (id != 0) {
      ids.put(y,id);
      final byte data=block.getData();
      if (data != 0) {
        datas.put(y,data);
      }
      BlockLoc bl;
switch (id) {
case 54:
        bl=new BlockLoc(x + offset_x,y,z + offset_z);
      final InventoryHolder chest=(InventoryHolder)block.getState();
    final ItemStack[] inventory=chest.getInventory().getContents().clone();
  chestContents.put(bl,inventory);
break;
case 52:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final CreatureSpawner spawner=(CreatureSpawner)block.getState();
final String type=spawner.getCreatureTypeId();
if ((type != null) && (type.length() != 0)) {
spawnerData.put(bl,type);
}
break;
case 137:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final CommandBlock cmd=(CommandBlock)block.getState();
final String string=cmd.getCommand();
if ((string != null) && (string.length() > 0)) {
cmdData.put(bl,string);
}
break;
case 63:
case 68:
case 323:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Sign sign=(Sign)block.getState();
sign.getLines();
signContents.put(bl,sign.getLines().clone());
break;
case 61:
case 62:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Furnace furnace=(Furnace)block.getState();
final short burn=furnace.getBurnTime();
final short cook=furnace.getCookTime();
final ItemStack[] invFur=furnace.getInventory().getContents().clone();
furnaceContents.put(bl,invFur);
if (cook != 0) {
furnaceTime.put(bl,new Short[]{burn,cook});
}
break;
case 23:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Dispenser dispenser=(Dispenser)block.getState();
final ItemStack[] invDis=dispenser.getInventory().getContents().clone();
dispenserContents.put(bl,invDis);
break;
case 158:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Dropper dropper=(Dropper)block.getState();
final ItemStack[] invDro=dropper.getInventory().getContents().clone();
dropperContents.put(bl,invDro);
break;
case 117:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final BrewingStand brewingStand=(BrewingStand)block.getState();
final short time=(short)brewingStand.getBrewingTime();
if (time > 0) {
brewTime.put(bl,time);
}
final ItemStack[] invBre=brewingStand.getInventory().getContents().clone();
brewingStandContents.put(bl,invBre);
break;
case 25:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final NoteBlock noteBlock=(NoteBlock)block.getState();
final Note note=noteBlock.getNote();
noteBlockContents.put(bl,note);
break;
case 138:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Beacon beacon=(Beacon)block.getState();
final ItemStack[] invBea=beacon.getInventory().getContents().clone();
beaconContents.put(bl,invBea);
break;
case 84:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Jukebox jukebox=(Jukebox)block.getState();
final Material playing=jukebox.getPlaying();
if (playing != null) {
jukeDisc.put(bl,(short)playing.getId());
}
break;
case 154:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Hopper hopper=(Hopper)block.getState();
final ItemStack[] invHop=hopper.getInventory().getContents().clone();
hopperContents.put(bl,invHop);
break;
case 397:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Skull skull=(Skull)block.getState();
final String o=skull.getOwner();
final byte skulltype=getOrdinal(SkullType.values(),skull.getSkullType());
skull.getRotation();
final short rot=getOrdinal(BlockFace.values(),skull.getRotation());
skullData.put(bl,new Object[]{o,rot,skulltype});
break;
case 176:
case 177:
bl=new BlockLoc(x + offset_x,y,z + offset_z);
final Banner banner=(Banner)block.getState();
final byte base=getOrdinal(DyeColor.values(),banner.getBaseColor());
final ArrayList<Byte[]> types=new ArrayList<>();
for (final Pattern pattern : banner.getPatterns()) {
types.add(new Byte[]{getOrdinal(PatternType.values(),pattern.getPattern()),pattern.getColor().getDyeData()});
}
bannerBase.put(bl,base);
bannerColors.put(bl,types);
break;
}
}
}
final PlotLoc loc=new PlotLoc((short)x,(short)z);
GENERATE_BLOCKS.put(loc,ids);
GENERATE_DATA.put(loc,datas);
}