Program: 174955
Project: 174955
Buggy source:
/** 
 * @param gir
 */
public ImageLayer(GeoImageReader gir){
  iReader=ImageIO.getImageReadersByFormatName("String_Node_Str");
  pngReader=(ImageReader)iReader.next();
  this.activeGir=gir;
  poolSize=Integer.parseInt(ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  poolExcutorService=new ThreadPoolExecutor(1,poolSize,100,TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>());
  submitedTiles=new ArrayList<String>();
  imagePool=new ImagePool(gir,poolSize);
  setName(gir);
  activeBand=0;
  levels=(int)(Math.sqrt(Math.max(gir.getWidth() / Constant.TILE_SIZE_DOUBLE,gir.getHeight() / Constant.TILE_SIZE_DOUBLE))) + 1;
  maxlevels=(int)(Math.sqrt(Math.max(gir.getWidth() / (Constant.TILE_SIZE_DOUBLE * 2),gir.getHeight() / (Constant.TILE_SIZE_DOUBLE * 2)))) + 1;
  curlevel=levels;
  xpadding=(((1 << levels) << 8) - gir.getWidth()) / 2;
  ypadding=(((1 << levels) << 8) - gir.getHeight()) / 2;
  String temp=SumoPlatform.getApplication().getConfiguration().getMaxTileBuffer();
  int maxBuffer=Integer.parseInt(temp);
  tcm=new TextureCacheManager(maxBuffer);
  setInitialContrast();
  maxnumberoftiles=SumoPlatform.getApplication().getConfiguration().getMaxNumOfTiles();
  createMatrixTileOrder();
  int tileSize=(int)(Constant.TILESIZE / gir.getPixelsize()[0]);
  if (tileSize < Constant.TILESIZEPIXELS)   tileSize=Constant.TILESIZEPIXELS;
  this.horizontalTilesImage=gir.getWidth() / tileSize;
  this.verticalTilesImage=gir.getHeight() / tileSize;
  this.realTileSizeX=gir.getWidth() / horizontalTilesImage;
  this.realTileSizeY=gir.getHeight() / verticalTilesImage;
}

Fixed version (ground truth):
/** 
 * @param gir
 */
public ImageLayer(GeoImageReader gir){
  iReader=ImageIO.getImageReadersByFormatName("String_Node_Str");
  pngReader=(ImageReader)iReader.next();
  this.activeGir=gir;
  poolSize=Integer.parseInt(ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  poolExcutorService=new ThreadPoolExecutor(1,poolSize,100,TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>());
  submitedTiles=new ArrayList<String>();
  setName(gir);
  activeBand=0;
  levels=(int)(Math.sqrt(Math.max(gir.getWidth() / Constant.TILE_SIZE_DOUBLE,gir.getHeight() / Constant.TILE_SIZE_DOUBLE))) + 1;
  maxlevels=(int)(Math.sqrt(Math.max(gir.getWidth() / (Constant.TILE_SIZE_DOUBLE * 2),gir.getHeight() / (Constant.TILE_SIZE_DOUBLE * 2)))) + 1;
  curlevel=levels;
  xpadding=(((1 << levels) << 8) - gir.getWidth()) / 2;
  ypadding=(((1 << levels) << 8) - gir.getHeight()) / 2;
  String temp=SumoPlatform.getApplication().getConfiguration().getMaxTileBuffer();
  int maxBuffer=Integer.parseInt(temp);
  tcm=new TextureCacheManager(maxBuffer);
  setInitialContrast();
  maxnumberoftiles=SumoPlatform.getApplication().getConfiguration().getMaxNumOfTiles();
  createMatrixTileOrder();
  int tileSize=(int)(Constant.TILESIZE / gir.getPixelsize()[0]);
  if (tileSize < Constant.TILESIZEPIXELS)   tileSize=Constant.TILESIZEPIXELS;
  this.horizontalTilesImage=gir.getWidth() / tileSize;
  this.verticalTilesImage=gir.getHeight() / tileSize;
  this.realTileSizeX=gir.getWidth() / horizontalTilesImage;
  this.realTileSizeY=gir.getHeight() / verticalTilesImage;
}