Program: 86556
Project: 86556
Buggy source:
public void init(SceneDef info) throws Exception {
  destroy();
  List<Layer> collidableLayers=new ArrayList<Layer>();
  List<Layer> destructableLayers=new ArrayList<Layer>();
  int bgSize=info.getBackgroundLayers().length;
  this.backgroundLayers=new Layer[bgSize];
  for (int i=0; i < bgSize; i++) {
    this.backgroundLayers[i]=info.getBackgroundLayers()[i];
    if (this.backgroundLayers[i].collidable()) {
      collidableLayers.add(this.backgroundLayers[i]);
    }
    if (this.backgroundLayers[i].isDestructable()) {
      destructableLayers.add(this.backgroundLayers[i]);
    }
  }
  int fgSize=info.getForegroundLayers().length;
  this.foregroundLayers=new Layer[fgSize];
  for (int i=0; i < fgSize; i++) {
    this.foregroundLayers[i]=info.getForegroundLayers()[i];
    if (this.foregroundLayers[i].isDestructable()) {
      destructableLayers.add(this.foregroundLayers[i]);
    }
  }
  this.collidableLayers=new Layer[collidableLayers.size()];
  this.collidableLayers=collidableLayers.toArray(this.collidableLayers);
  this.destructableLayer=new Layer[destructableLayers.size()];
  this.destructableLayer=destructableLayers.toArray(this.destructableLayer);
  this.backgroundImage=info.getBackgroundImage();
  this.maxX=info.getDimensionX();
  this.maxY=info.getDimensionY();
  this.tileWidth=info.getTileWidth();
  this.tileHeight=info.getTileHeight();
  Vector2f worldCoordinates=tileToWorld(this.maxX,this.maxY);
  this.mapWidth=(int)worldCoordinates.x;
  this.mapHeight=(int)worldCoordinates.y;
  this.worldBounds=new Rectangle(0,0,this.mapWidth,this.mapHeight);
  this.atlas=info.getAtlas();
  this.mapObjects=info.getMapObjects();
  this.mapObjectsFactory=info.getMapObjectsFactory();
  for (int i=0; i < this.destructableLayer.length; i++) {
    Layer layer=this.destructableLayer[i];
    if (layer.collidable() && layer.isDestructable() && layer.getHeightMask() == 0) {
      this.collisionLayerToAddTiles=layer;
    }
  }
  this.surfaces=info.getSurfaces();
  if (this.shadeTilesLookup != null) {
    this.shadeTilesLookup=createShadeLookup(75);
  }
}

Fixed version (ground truth):
public void init(SceneDef info) throws Exception {
  destroy();
  List<Layer> collidableLayers=new ArrayList<Layer>();
  List<Layer> destructableLayers=new ArrayList<Layer>();
  int bgSize=info.getBackgroundLayers().length;
  this.backgroundLayers=new Layer[bgSize];
  for (int i=0; i < bgSize; i++) {
    this.backgroundLayers[i]=info.getBackgroundLayers()[i];
    if (this.backgroundLayers[i].collidable()) {
      collidableLayers.add(this.backgroundLayers[i]);
    }
    if (this.backgroundLayers[i].isDestructable()) {
      destructableLayers.add(this.backgroundLayers[i]);
    }
  }
  int fgSize=info.getForegroundLayers().length;
  this.foregroundLayers=new Layer[fgSize];
  for (int i=0; i < fgSize; i++) {
    this.foregroundLayers[i]=info.getForegroundLayers()[i];
    if (this.foregroundLayers[i].isDestructable()) {
      destructableLayers.add(this.foregroundLayers[i]);
    }
  }
  this.collidableLayers=new Layer[collidableLayers.size()];
  this.collidableLayers=collidableLayers.toArray(this.collidableLayers);
  this.destructableLayer=new Layer[destructableLayers.size()];
  this.destructableLayer=destructableLayers.toArray(this.destructableLayer);
  this.backgroundImage=info.getBackgroundImage();
  this.maxX=info.getDimensionX();
  this.maxY=info.getDimensionY();
  this.tileWidth=info.getTileWidth();
  this.tileHeight=info.getTileHeight();
  Vector2f worldCoordinates=tileToWorld(this.maxX,this.maxY);
  this.mapWidth=(int)worldCoordinates.x;
  this.mapHeight=(int)worldCoordinates.y;
  this.worldBounds=new Rectangle(0,0,this.mapWidth,this.mapHeight);
  this.atlas=info.getAtlas();
  this.mapObjects=info.getMapObjects();
  this.mapObjectsFactory=info.getMapObjectsFactory();
  for (int i=0; i < this.mapObjects.size(); i++) {
    MapObject object=this.mapObjects.get(i);
    if (object.isForeground()) {
      this.foregroundMapObjects.add(object);
    }
 else {
      this.backgroundMapObjects.add(object);
    }
  }
  for (int i=0; i < this.destructableLayer.length; i++) {
    Layer layer=this.destructableLayer[i];
    if (layer.collidable() && layer.isDestructable() && layer.getHeightMask() == 0) {
      this.collisionLayerToAddTiles=layer;
    }
  }
  this.surfaces=info.getSurfaces();
  if (this.shadeTilesLookup != null) {
    this.shadeTilesLookup=createShadeLookup(75);
  }
}