nus-yam/ex-repair huggingface dataset:
Program: 174967
Project: 174967
Buggy source:
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}

Fixed version (ground truth):
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final File tileFile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(tileFile,level,i,j)));
  }
}
Program: 174968
Project: 174968
Buggy source:
public ServiceTile(String initfile,int level,int i,int j){
  super();
  this.initfile=initfile;
  this.i=i;
  this.j=j;
  this.level=level;
}

Fixed version (ground truth):
public ServiceTile(File tilefile,int level,int i,int j){
  super();
  this.tileFile=tilefile;
  this.i=i;
  this.j=j;
  this.level=level;
}
Program: 174969
Project: 174969
Buggy source:
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
private boolean tryFileCache(GL2 gl,File file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  boolean ok=true;
  if (file.exists() && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(file);
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(file);
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file.getPath() + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file.getAbsolutePath(),t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}
Program: 174970
Project: 174970
Buggy source:
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_POLYGON);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}

Fixed version (ground truth):
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL2 gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.glBegin(GL2.GL_POLYGON);
  gl.glTexCoord2f(coords.left(),coords.top());
  gl.glVertex2f(xmin,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.top());
  gl.glVertex2f(xmax,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.bottom());
  gl.glVertex2f(xmax,1 - ymax);
  gl.glTexCoord2f(coords.left(),coords.bottom());
  gl.glVertex2f(xmin,1 - ymax);
  gl.glEnd();
  texture.disable(gl);
}
Program: 174971
Project: 174971
Buggy source:
public TileInfo(String id,String absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}

Fixed version (ground truth):
public TileInfo(String id,File absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}
Program: 174972
Project: 174972
Buggy source:
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.idTile,AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}

Fixed version (ground truth):
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.path.getAbsolutePath(),AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}
Program: 174974
Project: 174974
Buggy source:
public TileInfo call(){
  Cache c=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  StringBuilder ff=new StringBuilder(initfile).append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).append("String_Node_Str");
  final File f=c.newFile(ff.toString());
  if (f == null) {
    return new TileInfo(null,ff.toString(),null);
  }
  GeoImageReader gir2=imagePool.get();
  String next=new StringBuilder().append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (gir2 == null) {
    return new TileInfo(next,f.getAbsolutePath(),null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",f);
    return new TileInfo(next,f.getAbsolutePath(),out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,f.getAbsolutePath(),null);
}

Fixed version (ground truth):
public TileInfo call(){
  if (tileFile == null) {
    return null;
  }
  GeoImageReader gir2=imagePool.get();
  String next=buildTileId(level,i,j);
  if (gir2 == null) {
    return new TileInfo(next,tileFile,null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",tileFile);
    return new TileInfo(next,tileFile,out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,tileFile,null);
}
Program: 174975
Project: 174975
Buggy source:
private boolean tryMemoryCache(GL gl,String file,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean tryMemoryCache(GL2 gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}
Program: 174976
Project: 174976
Buggy source:
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}

Fixed version (ground truth):
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final File tileFile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(tileFile,level,i,j)));
  }
}
Program: 174977
Project: 174977
Buggy source:
/** 
 * @param idTile
 * @param texture
 */
public void add(String idTile,Texture texture){
  if (count > max) {
    map.remove(paths[index]);
    count--;
    index--;
  }
  map.put(idTile,texture);
  paths[index++]=idTile;
  if (index >= max) {
    index=0;
  }
  count++;
}

Fixed version (ground truth):
/** 
 * @param idTile
 * @param texture
 */
public void add(String path,Texture texture){
  if (count > max) {
    map.remove(paths[index]);
    count--;
    index--;
  }
  map.put(path,texture);
  paths[index++]=path;
  if (index >= max) {
    index=0;
  }
  count++;
}
Program: 174978
Project: 174978
Buggy source:
public ServiceTile(String initfile,int level,int i,int j){
  super();
  this.initfile=initfile;
  this.i=i;
  this.j=j;
  this.level=level;
}

Fixed version (ground truth):
public ServiceTile(File tilefile,int level,int i,int j){
  super();
  this.tileFile=tilefile;
  this.i=i;
  this.j=j;
  this.level=level;
}
Program: 174979
Project: 174979
Buggy source:
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
private boolean tryFileCache(GL2 gl,File file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  boolean ok=true;
  if (file.exists() && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(file);
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(file);
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file.getPath() + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file.getAbsolutePath(),t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}
Program: 174980
Project: 174980
Buggy source:
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_POLYGON);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}

Fixed version (ground truth):
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL2 gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.glBegin(GL2.GL_POLYGON);
  gl.glTexCoord2f(coords.left(),coords.top());
  gl.glVertex2f(xmin,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.top());
  gl.glVertex2f(xmax,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.bottom());
  gl.glVertex2f(xmax,1 - ymax);
  gl.glTexCoord2f(coords.left(),coords.bottom());
  gl.glVertex2f(xmin,1 - ymax);
  gl.glEnd();
  texture.disable(gl);
}
Program: 174981
Project: 174981
Buggy source:
public TileInfo(String id,String absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}

Fixed version (ground truth):
public TileInfo(String id,File absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}
Program: 174982
Project: 174982
Buggy source:
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.idTile,AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}

Fixed version (ground truth):
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.path.getAbsolutePath(),AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}
Program: 174984
Project: 174984
Buggy source:
public TileInfo call(){
  Cache c=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  StringBuilder ff=new StringBuilder(initfile).append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).append("String_Node_Str");
  final File f=c.newFile(ff.toString());
  if (f == null) {
    return new TileInfo(null,ff.toString(),null);
  }
  GeoImageReader gir2=imagePool.get();
  String next=new StringBuilder().append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (gir2 == null) {
    return new TileInfo(next,f.getAbsolutePath(),null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",f);
    return new TileInfo(next,f.getAbsolutePath(),out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,f.getAbsolutePath(),null);
}

Fixed version (ground truth):
public TileInfo call(){
  if (tileFile == null) {
    return null;
  }
  GeoImageReader gir2=imagePool.get();
  String next=buildTileId(level,i,j);
  if (gir2 == null) {
    return new TileInfo(next,tileFile,null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",tileFile);
    return new TileInfo(next,tileFile,out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,tileFile,null);
}
Program: 174985
Project: 174985
Buggy source:
private boolean tryMemoryCache(GL gl,String file,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean tryMemoryCache(GL2 gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}
Program: 174986
Project: 174986
Buggy source:
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}

Fixed version (ground truth):
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final File tileFile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(tileFile,level,i,j)));
  }
}
Program: 174987
Project: 174987
Buggy source:
public ServiceTile(String initfile,int level,int i,int j){
  super();
  this.initfile=initfile;
  this.i=i;
  this.j=j;
  this.level=level;
}

Fixed version (ground truth):
public ServiceTile(File tilefile,int level,int i,int j){
  super();
  this.tileFile=tilefile;
  this.i=i;
  this.j=j;
  this.level=level;
}
Program: 174988
Project: 174988
Buggy source:
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
private boolean tryFileCache(GL2 gl,File file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  boolean ok=true;
  if (file.exists() && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(file);
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(file);
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file.getPath() + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file.getAbsolutePath(),t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}
Program: 174989
Project: 174989
Buggy source:
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_POLYGON);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}

Fixed version (ground truth):
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL2 gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.glBegin(GL2.GL_POLYGON);
  gl.glTexCoord2f(coords.left(),coords.top());
  gl.glVertex2f(xmin,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.top());
  gl.glVertex2f(xmax,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.bottom());
  gl.glVertex2f(xmax,1 - ymax);
  gl.glTexCoord2f(coords.left(),coords.bottom());
  gl.glVertex2f(xmin,1 - ymax);
  gl.glEnd();
  texture.disable(gl);
}
Program: 174990
Project: 174990
Buggy source:
public TileInfo(String id,String absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}

Fixed version (ground truth):
public TileInfo(String id,File absPath,BufferedImage img){
  idTile=id;
  path=absPath;
  pngImage=img;
}
Program: 174991
Project: 174991
Buggy source:
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.idTile,AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}

Fixed version (ground truth):
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.path.getAbsolutePath(),AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}
Program: 174993
Project: 174993
Buggy source:
public TileInfo call(){
  Cache c=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  StringBuilder ff=new StringBuilder(initfile).append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).append("String_Node_Str");
  final File f=c.newFile(ff.toString());
  if (f == null) {
    return new TileInfo(null,ff.toString(),null);
  }
  GeoImageReader gir2=imagePool.get();
  String next=new StringBuilder().append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (gir2 == null) {
    return new TileInfo(next,f.getAbsolutePath(),null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",f);
    return new TileInfo(next,f.getAbsolutePath(),out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,f.getAbsolutePath(),null);
}

Fixed version (ground truth):
public TileInfo call(){
  if (tileFile == null) {
    return null;
  }
  GeoImageReader gir2=imagePool.get();
  String next=buildTileId(level,i,j);
  if (gir2 == null) {
    return new TileInfo(next,tileFile,null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",tileFile);
    return new TileInfo(next,tileFile,out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,tileFile,null);
}
Program: 174994
Project: 174994
Buggy source:
private boolean tryMemoryCache(GL gl,String file,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean tryMemoryCache(GL2 gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}
Program: 174995
Project: 174995
Buggy source:
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}

Fixed version (ground truth):
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final File tileFile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(tileFile,level,i,j)));
  }
}
Program: 174996
Project: 174996
Buggy source:
/** 
 * @param idTile
 * @param texture
 */
public void add(String idTile,Texture texture){
  if (count > max) {
    map.remove(paths[index]);
    count--;
    index--;
  }
  map.put(idTile,texture);
  paths[index++]=idTile;
  if (index >= max) {
    index=0;
  }
  count++;
}

Fixed version (ground truth):
/** 
 * @param idTile
 * @param texture
 */
public void add(String path,Texture texture){
  if (count > max) {
    map.remove(paths[index]);
    count--;
    index--;
  }
  map.put(path,texture);
  paths[index++]=path;
  if (index >= max) {
    index=0;
  }
  count++;
}
Program: 174997
Project: 174997
Buggy source:
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<Object[]>> remove1=new ArrayList<Future<Object[]>>();
  for (  Future<Object[]> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        Object[] o=f.get();
        submitedTiles.remove(o[1]);
        if (o.length > 2 && o[2] != null) {
          tcm.add((String)o[0],AWTTextureIO.newTexture(gl.getGLProfile(),(BufferedImage)o[2],false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}

Fixed version (ground truth):
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.idTile,AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}
Program: 174998
Project: 174998
Buggy source:
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=new StringBuilder("String_Node_Str").append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) & !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}
Program: 174999
Project: 174999
Buggy source:
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_QUADS);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}

Fixed version (ground truth):
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_POLYGON);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}
Program: 175000
Project: 175000
Buggy source:
public Object[] call(){
  Cache c=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  StringBuilder ff=new StringBuilder(initfile).append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).append("String_Node_Str");
  final File f=c.newFile(ff.toString());
  if (f == null) {
    return new Object[]{ff.toString(),null};
  }
  GeoImageReader gir2=imagePool.get();
  String next=new StringBuilder().append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (gir2 == null) {
    return new Object[]{f.getAbsolutePath(),next,null};
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",f);
    return new Object[]{f.getAbsolutePath(),next,out};
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new Object[]{f.getAbsolutePath(),next,null};
}

Fixed version (ground truth):
public TileInfo call(){
  Cache c=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  StringBuilder ff=new StringBuilder(initfile).append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).append("String_Node_Str");
  final File f=c.newFile(ff.toString());
  if (f == null) {
    return new TileInfo(null,ff.toString(),null);
  }
  GeoImageReader gir2=imagePool.get();
  String next=new StringBuilder().append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (gir2 == null) {
    return new TileInfo(next,f.getAbsolutePath(),null);
  }
  try {
    int x=i * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - xpadding;
    int y=j * (1 << level) * Constant.TILE_SIZE_IMG_LAYER - ypadding;
    float zoom=(1 << level);
    final BufferedImage out=createImage(gir2,x,y,Constant.TILE_SIZE_IMG_LAYER,Constant.TILE_SIZE_IMG_LAYER,zoom);
    ImageIO.write(out,"String_Node_Str",f);
    return new TileInfo(next,f.getAbsolutePath(),out);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    imagePool.release(gir2);
  }
  return new TileInfo(next,f.getAbsolutePath(),null);
}
Program: 175001
Project: 175001
Buggy source:
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=new StringBuffer(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}

Fixed version (ground truth):
/** 
 * @param initfile file tile
 * @param level	   zoom level
 * @param i
 * @param j
 */
public void addTileToQueue(final String initfile,final int level,final int i,final int j){
  String tilesStr=this.buildTileId(level,i,j);
  if (!submitedTiles.contains(tilesStr)) {
    submitedTiles.add(tilesStr);
    futures.add(0,poolExcutorService.submit(new ServiceTile(initfile,level,i,j)));
  }
}
Program: 175002
Project: 175002
Buggy source:
public ServiceTile(File tilefile,int level,int i,int j){
  super();
  this.tileFile=tilefile;
  this.i=i;
  this.j=j;
  this.level=level;
}

Fixed version (ground truth):
public ServiceTile(String initfile,int level,int i,int j){
  super();
  this.initfile=initfile;
  this.i=i;
  this.j=j;
  this.level=level;
}
Program: 175003
Project: 175003
Buggy source:
private boolean tryFileCache(GL2 gl,File file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=this.buildTileId(level,i,j);
  boolean ok=true;
  if (file.exists() && !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(file);
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(file);
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file.getPath() + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file.getAbsolutePath(),t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}

Fixed version (ground truth):
private boolean tryFileCache(GL gl,String file,int level,int i,int j,float xmin,float xmax,float ymin,float ymax){
  String tileId=new StringBuilder("String_Node_Str").append(level).append("String_Node_Str").append(getBandFolder(activeBand)).append("String_Node_Str").append(i).append("String_Node_Str").append(j).toString();
  Cache cacheInstance=CacheManager.getCacheInstance(activeGir.getDisplayName(activeBand));
  boolean ok=true;
  if (cacheInstance.contains(file) & !submitedTiles.contains(tileId)) {
    BufferedImage temp=null;
    try {
      try {
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
 catch (      Exception ex) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        temp=ImageIO.read(cacheInstance.newFile(file));
      }
      if (temp == null) {
        ok=false;
      }
    }
 catch (    Exception ex) {
      ok=false;
      logger.warn("String_Node_Str" + file + "String_Node_Str"+ ex.getMessage());
    }
 finally {
      pngReader.dispose();
    }
    if (ok) {
      if (temp.getColorModel().getNumComponents() == 1) {
        temp=rescale.filter(temp,rescale.createCompatibleDestImage(temp,temp.getColorModel()));
      }
      Texture t=AWTTextureIO.newTexture(gl.getGLProfile(),temp,false);
      tcm.add(file,t);
      bindTexture(gl,t,xmin,xmax,ymin,ymax);
    }
  }
 else {
    ok=false;
  }
  return ok;
}
Program: 175004
Project: 175004
Buggy source:
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL2 gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.glBegin(GL2.GL_POLYGON);
  gl.glTexCoord2f(coords.left(),coords.top());
  gl.glVertex2f(xmin,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.top());
  gl.glVertex2f(xmax,1 - ymin);
  gl.glTexCoord2f(coords.right(),coords.bottom());
  gl.glVertex2f(xmax,1 - ymax);
  gl.glTexCoord2f(coords.left(),coords.bottom());
  gl.glVertex2f(xmin,1 - ymax);
  gl.glEnd();
  texture.disable(gl);
}

Fixed version (ground truth):
/** 
 * @param gl
 * @param texture
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 */
private void bindTexture(GL gl,Texture texture,float xmin,float xmax,float ymin,float ymax){
  texture.enable(gl);
  texture.bind(gl);
  TextureCoords coords=texture.getImageTexCoords();
  gl.getGL2().glBegin(GL2.GL_QUADS);
  gl.getGL2().glTexCoord2f(coords.left(),coords.top());
  gl.getGL2().glVertex2f(xmin,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.top());
  gl.getGL2().glVertex2f(xmax,1 - ymin);
  gl.getGL2().glTexCoord2f(coords.right(),coords.bottom());
  gl.getGL2().glVertex2f(xmax,1 - ymax);
  gl.getGL2().glTexCoord2f(coords.left(),coords.bottom());
  gl.getGL2().glVertex2f(xmin,1 - ymax);
  gl.getGL2().glEnd();
  texture.disable(gl);
}
Program: 175005
Project: 175005
Buggy source:
private void disposeSync(){
  poolExcutorService.shutdownNow();
  poolExcutorService=null;
  activeGir.dispose();
  activeGir=null;
  tcm.clear();
  tcm=null;
  submitedTiles.clear();
  submitedTiles=null;
  imagePool.dispose();
  imagePool=null;
  SumoPlatform.getApplication().getLayerManager().removeLayer(this);
}

Fixed version (ground truth):
private void disposeSync(){
  poolExcutorService.shutdownNow();
  poolExcutorService=null;
  activeGir.dispose();
  activeGir=null;
  tcm.clear();
  tcm=null;
  submitedTiles.clear();
  submitedTiles=null;
  SumoPlatform.getApplication().getLayerManager().removeLayer(this);
}
Program: 175006
Project: 175006
Buggy source:
@Override public void dispose(){
  disposed=true;
  if (poolExcutorService != null) {
    poolExcutorService.shutdownNow();
    poolExcutorService=null;
  }
  if (activeGir != null) {
    activeGir.dispose();
    activeGir=null;
  }
  if (tcm != null) {
    tcm.clear();
    tcm=null;
  }
  if (submitedTiles != null) {
    submitedTiles.clear();
    submitedTiles=null;
  }
  if (imagePool != null) {
    imagePool.dispose();
    imagePool=null;
  }
  SumoPlatform.getApplication().getLayerManager().removeLayer(this);
}

Fixed version (ground truth):
@Override public void dispose(){
  disposed=true;
  if (poolExcutorService != null) {
    poolExcutorService.shutdownNow();
    poolExcutorService=null;
  }
  if (activeGir != null) {
    activeGir.dispose();
    activeGir=null;
  }
  if (tcm != null) {
    tcm.clear();
    tcm=null;
  }
  if (submitedTiles != null) {
    submitedTiles.clear();
    submitedTiles=null;
  }
  SumoPlatform.getApplication().getLayerManager().removeLayer(this);
}
Program: 175007
Project: 175007
Buggy source:
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<TileInfo>> remove1=new ArrayList<Future<TileInfo>>();
  for (  Future<TileInfo> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        TileInfo o=f.get();
        submitedTiles.remove(o.idTile);
        if (o.pngImage != null) {
          tcm.add(o.path.getAbsolutePath(),AWTTextureIO.newTexture(gl.getGLProfile(),o.pngImage,false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}

Fixed version (ground truth):
/** 
 * @param gl
 */
private void updateFutures(GL gl){
  List<Future<Object[]>> remove1=new ArrayList<Future<Object[]>>();
  for (  Future<Object[]> f : futures) {
    if (f.isDone() || f.isCancelled()) {
      remove1.add(f);
      try {
        Object[] o=f.get();
        submitedTiles.remove(o[1]);
        if (o.length > 2 && o[2] != null) {
          tcm.add((String)o[0],AWTTextureIO.newTexture(gl.getGLProfile(),(BufferedImage)o[2],false));
        }
      }
 catch (      Exception ex) {
        logger.error(ex.getMessage(),ex);
      }
    }
  }
  futures.removeAll(remove1);
}