Program: 177415
Project: 177415
Buggy source:
public static SpoutChunk loadChunk(SpoutRegion r,int x,int y,int z,InputStream dis,ChunkDataForRegion dataForRegion){
  SpoutChunk chunk=null;
  NBTInputStream is=null;
  try {
    if (dis == null) {
      return chunk;
    }
    is=new NBTInputStream(dis,false);
    CompoundTag chunkTag=(CompoundTag)is.readTag();
    CompoundMap map=chunkTag.getValue();
    int cx=r.getChunkX() + x;
    int cy=r.getChunkY() + y;
    int cz=r.getChunkZ() + z;
    byte populationState=SafeCast.toGeneric(map.get("String_Node_Str"),new ByteTag("String_Node_Str",PopulationState.POPULATED.getId()),ByteTag.class).getValue();
    short[] blocks=SafeCast.toShortArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    short[] data=SafeCast.toShortArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] skyLight=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] blockLight=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] extraData=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    BiomeManager manager=null;
    if (map.containsKey("String_Node_Str")) {
      try {
        String biomeManagerClass=(String)map.get("String_Node_Str").getValue();
        byte[] biomes=(byte[])map.get("String_Node_Str").getValue();
        @SuppressWarnings("String_Node_Str") Class<? extends BiomeManager> clazz=(Class<? extends BiomeManager>)Class.forName(biomeManagerClass);
        Class<?>[] params={int.class,int.class,int.class};
        manager=clazz.getConstructor(params).newInstance(cx,cy,cz);
        manager.deserialize(biomes);
      }
 catch (      Exception e) {
        Spout.getLogger().severe("String_Node_Str");
        e.printStackTrace();
      }
    }
    if (manager == null) {
      manager=new EmptyBiomeManager(cx,cy,cz);
    }
    SpoutWorld world=r.getWorld();
    StringMap global=((SpoutEngine)Spout.getEngine()).getEngineItemMap();
    StringMap itemMap=world.getItemMap();
    for (int i=0; i < blocks.length; i++) {
      blocks[i]=(short)itemMap.convertTo(global,blocks[i]);
    }
    DatatableMap extraDataMap=new GenericDatatableMap();
    extraDataMap.decompress(extraData);
    chunk=new FilteredChunk(r.getWorld(),r,cx,cy,cz,PopulationState.byID(populationState),blocks,data,skyLight,blockLight,manager,extraDataMap);
    CompoundMap entityMap=SafeCast.toGeneric(NBTMapper.toTagValue(map.get("String_Node_Str")),null,CompoundMap.class);
    loadEntities(r,entityMap,dataForRegion.loadedEntities);
    List<? extends CompoundTag> updateList=checkerListCompoundTag.checkTag(map.get("String_Node_Str"),null);
    loadDynamicUpdates(updateList,dataForRegion.loadedUpdates);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException ignore) {
      }
    }
  }
  return chunk;
}

Fixed version (ground truth):
public static SpoutChunk loadChunk(SpoutRegion r,int x,int y,int z,InputStream dis,ChunkDataForRegion dataForRegion){
  SpoutChunk chunk=null;
  NBTInputStream is=null;
  try {
    if (dis == null) {
      return chunk;
    }
    is=new NBTInputStream(dis,false);
    CompoundTag chunkTag=(CompoundTag)is.readTag();
    CompoundMap map=chunkTag.getValue();
    int cx=r.getChunkX() + x;
    int cy=r.getChunkY() + y;
    int cz=r.getChunkZ() + z;
    byte populationState=SafeCast.toGeneric(map.get("String_Node_Str"),new ByteTag("String_Node_Str",PopulationState.POPULATED.getId()),ByteTag.class).getValue();
    short[] blocks=SafeCast.toShortArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    short[] data=SafeCast.toShortArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] skyLight=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] blockLight=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    byte[] extraData=SafeCast.toByteArray(NBTMapper.toTagValue(map.get("String_Node_Str")),null);
    BiomeManager manager=null;
    if (map.containsKey("String_Node_Str")) {
      try {
        String biomeManagerClass=(String)map.get("String_Node_Str").getValue();
        byte[] biomes=(byte[])map.get("String_Node_Str").getValue();
        @SuppressWarnings("String_Node_Str") Class<? extends BiomeManager> clazz=(Class<? extends BiomeManager>)Class.forName(biomeManagerClass);
        Class<?>[] params={int.class,int.class,int.class};
        manager=clazz.getConstructor(params).newInstance(cx,cy,cz);
        manager.deserialize(biomes);
      }
 catch (      Exception e) {
        Spout.getLogger().severe("String_Node_Str");
        e.printStackTrace();
      }
    }
    if (manager == null) {
      manager=new EmptyBiomeManager(cx,cy,cz);
    }
    SpoutWorld world=r.getWorld();
    StringMap global=((SpoutEngine)Spout.getEngine()).getEngineItemMap();
    StringMap itemMap=world.getItemMap();
    for (int i=0; i < blocks.length; i++) {
      blocks[i]=(short)itemMap.convertTo(global,blocks[i]);
    }
    DatatableMap extraDataMap=new GenericDatatableMap();
    extraDataMap.decompress(extraData);
    chunk=new FilteredChunk(r.getWorld(),r,cx,cy,cz,PopulationState.byID(populationState),blocks,data,skyLight,blockLight,manager,extraDataMap);
    CompoundMap entityMap=SafeCast.toGeneric(NBTMapper.toTagValue(map.get("String_Node_Str")),(CompoundMap)null,CompoundMap.class);
    loadEntities(r,entityMap,dataForRegion.loadedEntities);
    List<? extends CompoundTag> updateList=checkerListCompoundTag.checkTag(map.get("String_Node_Str"),null);
    loadDynamicUpdates(updateList,dataForRegion.loadedUpdates);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException ignore) {
      }
    }
  }
  return chunk;
}