nus-yam/ex-repair huggingface dataset:
Program: 174898
Project: 174898
Buggy source:
@Test public void testApply_Basic(){
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  int prizeCard=10;
  List<Player> newPlayers=new Round(prizeCard).apply(players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(2,newPlayers.get(0).getNumCardsInHand());
  assertEquals(2,newPlayers.get(1).getNumCardsInHand());
  assertEquals(2,newPlayers.get(2).getNumCardsInHand());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 0).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 0).count());
}

Fixed version (ground truth):
@Test public void testApply_Basic(){
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  int prizeCard=10;
  List<Player> newPlayers=new Round(prizeCard).apply(players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(2,newPlayers.get(0).getNumCardsInHand());
  assertEquals(2,newPlayers.get(1).getNumCardsInHand());
  assertEquals(2,newPlayers.get(2).getNumCardsInHand());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 0).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 0).count());
}
Program: 174899
Project: 174899
Buggy source:
@Test public void testGetAllBids_Basic(){
  Round round=new Round();
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  List<Bid> result=round.getAllBids(players.stream(),10);
  assertEquals(3,result.size());
}

Fixed version (ground truth):
@Test public void testGetAllBids_Basic(){
  Round round=new Round();
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  List<Bid> result=round.getAllBids(players.stream(),10);
  assertEquals(3,result.size());
}
Program: 174900
Project: 174900
Buggy source:
@Test public void testFindWinningBid_Basic(){
  Round round=new Round();
  int maxCard=50;
  Strategy strategy=new MaxCard();
  Player p1=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p2=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p3=new Player("String_Node_Str",strategy,maxCard,new Hand());
  int prizeCard=20;
  List<Bid> bids=new ArrayList<>();
  bids.add(new Bid(prizeCard,10,p1));
  bids.add(new Bid(prizeCard,12,p2));
  bids.add(new Bid(prizeCard,14,p3));
  Bid result=round.findWinningBid(bids);
  assertEquals("String_Node_Str",result.getBidder().getName());
}

Fixed version (ground truth):
@Test public void testFindWinningBid_Basic(){
  Round round=new Round();
  int maxCard=50;
  Player p1=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p2=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p3=new Player("String_Node_Str",strategy,maxCard,new Hand());
  int prizeCard=20;
  List<Bid> bids=new ArrayList<>();
  bids.add(new Bid(prizeCard,10,p1));
  bids.add(new Bid(prizeCard,12,p2));
  bids.add(new Bid(prizeCard,14,p3));
  Bid result=round.findWinningBid(bids);
  assertEquals("String_Node_Str",result.getBidder().getName());
}
Program: 174901
Project: 174901
Buggy source:
@Test public void testDeal_Table_Basic(){
  Dealer dealer=new Dealer();
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Table table=dealer.deal(20,players);
  assertEquals(5,table.getKitty().cardsAsIntStream().count());
  assertEquals(5,table.getPlayers().get(0).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(1).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(2).getNumCardsInHand());
}

Fixed version (ground truth):
@Test public void testDeal_Table_Basic(){
  Dealer dealer=new Dealer();
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Table table=dealer.deal(20,players);
  assertEquals(5,table.getKitty().cardsAsIntStream().count());
  assertEquals(5,table.getPlayers().get(0).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(1).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(2).getNumCardsInHand());
}
Program: 174902
Project: 174902
Buggy source:
private Optional<String> determineCollectionFromId(final Optional<String> id){
  return id.map(i -> {
    final String[] split=i.split("String_Node_Str");
    return split.length == 2 ? split[0] : null;
  }
);
}

Fixed version (ground truth):
private Optional<String> determineCollectionFromId(final Optional<String> id){
  return id.map(i -> MetadataUtils.determineCollectionFromId(i));
}
Program: 174903
Project: 174903
Buggy source:
/** 
 * Test method for   {@link com.arangodb.springframework.core.util.MetadataUtils#determineDocumentKeyFromId(java.lang.String)}.
 */
@Test public void testDetermineDocumentKeyFromId(){
  String key=MetadataUtils.determineDocumentKeyFromId(COLLECTION_NAME + '/' + NUMERIC_ID);
  assertThat(key,is(NUMERIC_ID));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.arangodb.springframework.core.util.MetadataUtils#determineDocumentKeyFromId(java.lang.String)}.
 */
@Test public void testDetermineDocumentKeyFromId(){
  String key=MetadataUtils.determineDocumentKeyFromId(COLLECTION_NAME + MetadataUtils.KEY_DELIMITER + KEY);
  assertThat(key,is(KEY));
}
Program: 174904
Project: 174904
Buggy source:
@Override public Object resolve(final String id,final Class<?> type,final Relations annotation){
  return template.query("String_Node_Str" + Math.max(1,annotation.minDepth()) + "String_Node_Str"+ Math.max(1,annotation.maxDepth())+ "String_Node_Str"+ annotation.direction()+ "String_Node_Str",new MapBuilder().put("String_Node_Str",id).put("String_Node_Str",Arrays.asList(annotation.edges()).stream().map((e) -> template.collection(e).name()).reduce((a,b) -> a + "String_Node_Str" + b).get()).put("String_Node_Str",type).get(),new AqlQueryOptions(),type).asListRemaining();
}

Fixed version (ground truth):
@Override public Object resolve(final String id,final Class<?> type,final Relations annotation){
  final ArangoCursor<?> result=template.query("String_Node_Str" + Math.max(1,annotation.minDepth()) + "String_Node_Str"+ Math.max(1,annotation.maxDepth())+ "String_Node_Str"+ annotation.direction()+ "String_Node_Str",new MapBuilder().put("String_Node_Str",id).put("String_Node_Str",Arrays.asList(annotation.edges()).stream().map((e) -> template.collection(e).name()).reduce((a,b) -> a + "String_Node_Str" + b).get()).put("String_Node_Str",type).get(),new AqlQueryOptions(),type);
  return result.hasNext() ? result.next() : null;
}
Program: 174905
Project: 174905
Buggy source:
@Override public Object resolveMultiple(final String id,final Class<?> type,final Relations annotation){
  return annotation.lazy() ? proxy(id,Collection.class,annotation,(i,t,a) -> resolve(i,type,a)) : resolve(id,type,annotation);
}

Fixed version (ground truth):
@Override public Object resolveMultiple(final String id,final Class<?> type,final Relations annotation){
  return annotation.lazy() ? proxy(id,type,annotation,(i,t,a) -> resolve(i,type,a)) : resolve(id,type,annotation);
}
Program: 174906
Project: 174906
Buggy source:
private Object convertResult(final ArangoCursor<?> result,final ArangoParameterAccessor accessor){
  if (isExistsQuery()) {
    if (!result.hasNext()) {
      return false;
    }
    return (int)result.next() > 0;
  }
  final ArangoResultConverter resultConverter=new ArangoResultConverter(accessor,result,operations,domainClass);
  return resultConverter.convertResult(method.getReturnType().getType());
}

Fixed version (ground truth):
private Object convertResult(final ArangoCursor<?> result,final ArangoParameterAccessor accessor){
  if (isExistsQuery()) {
    if (!result.hasNext()) {
      return false;
    }
    return (int)(Integer)result.next() > 0;
  }
  final ArangoResultConverter resultConverter=new ArangoResultConverter(accessor,result,operations,domainClass);
  return resultConverter.convertResult(method.getReturnType().getType());
}
Program: 174907
Project: 174907
Buggy source:
public ArangoRepositoryFactoryBean(final Class<? extends T> repositoryInterface,final ArangoOperations arangoOperations){
  super(repositoryInterface);
  this.arangoOperations=arangoOperations;
}

Fixed version (ground truth):
@Autowired public ArangoRepositoryFactoryBean(final Class<? extends T> repositoryInterface){
  super(repositoryInterface);
}
Program: 174908
Project: 174908
Buggy source:
void dropDatabase();

Fixed version (ground truth):
void dropDatabase() throws DataAccessException ;
Program: 174909
Project: 174909
Buggy source:
<T>T getDocument(final String id,final Class<T> type) throws DataAccessException ;

Fixed version (ground truth):
<T>T getDocument(String id,Class<T> type) throws DataAccessException ;
Program: 174910
Project: 174910
Buggy source:
<T>ArangoCursor<T> query(final String query,final Map<String,Object> bindVars,final AqlQueryOptions options,final Class<T> type) throws DataAccessException ;

Fixed version (ground truth):
<T>ArangoCursor<T> query(String query,Map<String,Object> bindVars,AqlQueryOptions options,Class<T> type) throws DataAccessException ;
Program: 174911
Project: 174911
Buggy source:
<T>Iterable<T> getDocuments(final Class<T> type,Iterable<String> strings);

Fixed version (ground truth):
<T>Iterable<T> getDocuments(Class<T> type,Iterable<String> strings) throws DataAccessException ;
Program: 174912
Project: 174912
Buggy source:
long count(final Class<?> type);

Fixed version (ground truth):
long count(Class<?> type);
Program: 174913
Project: 174913
Buggy source:
<T>DocumentCreateEntity<T> insertDocument(final T value) throws DataAccessException ;

Fixed version (ground truth):
<T>DocumentCreateEntity<T> insertDocument(T value) throws DataAccessException ;
Program: 174914
Project: 174914
Buggy source:
void deleteDocuments(final Class<?> type);

Fixed version (ground truth):
void deleteDocuments(Class<?> type);
Program: 174915
Project: 174915
Buggy source:
<T>DocumentUpdateEntity<T> replaceDocument(final String id,final T value) throws DataAccessException ;

Fixed version (ground truth):
<T>DocumentUpdateEntity<T> replaceDocument(String id,T value) throws DataAccessException ;
Program: 174916
Project: 174916
Buggy source:
MultiDocumentEntity<DocumentCreateEntity<Object>> insertDocuments(final Collection<Object> values,Class<?> type) throws DataAccessException ;

Fixed version (ground truth):
MultiDocumentEntity<DocumentCreateEntity<Object>> insertDocuments(Collection<Object> values,Class<?> type) throws DataAccessException ;
Program: 174917
Project: 174917
Buggy source:
void dropCollection(Class<?> type);

Fixed version (ground truth):
/** 
 * @deprecated use {@link CollectionOperations#drop()} instead
 * @param type
 */
@Deprecated void dropCollection(Class<?> type) throws DataAccessException ;
Program: 174918
Project: 174918
Buggy source:
MultiDocumentEntity<DocumentUpdateEntity<Object>> updateDocuments(final Collection<Object> values,Class<?> type) throws DataAccessException ;

Fixed version (ground truth):
MultiDocumentEntity<DocumentUpdateEntity<Object>> updateDocuments(Collection<Object> values,Class<?> type) throws DataAccessException ;
Program: 174919
Project: 174919
Buggy source:
<T>DocumentDeleteEntity<Void> deleteDocument(final String id,Class<T> type) throws DataAccessException ;

Fixed version (ground truth):
<T>DocumentDeleteEntity<Void> deleteDocument(String id,Class<T> type) throws DataAccessException ;
Program: 174920
Project: 174920
Buggy source:
boolean exists(final String s,final Class<?> type);

Fixed version (ground truth):
boolean exists(String s,Class<?> type);
Program: 174921
Project: 174921
Buggy source:
MultiDocumentEntity<DocumentUpdateEntity<Object>> replaceDocuments(final Collection<Object> values,Class<?> type) throws DataAccessException ;

Fixed version (ground truth):
MultiDocumentEntity<DocumentUpdateEntity<Object>> replaceDocuments(Collection<Object> values,Class<?> type) throws DataAccessException ;
Program: 174922
Project: 174922
Buggy source:
<T>DocumentUpdateEntity<T> updateDocument(final String id,final T value) throws DataAccessException ;

Fixed version (ground truth):
<T>DocumentUpdateEntity<T> updateDocument(String id,T value) throws DataAccessException ;
Program: 174923
Project: 174923
Buggy source:
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}

Fixed version (ground truth):
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",JsonObject.class.getName(),getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}
Program: 174924
Project: 174924
Buggy source:
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}

Fixed version (ground truth):
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",JsonObject.class.getName(),getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}
Program: 174925
Project: 174925
Buggy source:
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}

Fixed version (ground truth):
protected void generateJsonMapper(TableDefinition table,JavaWriter out){
  out.tab(1).println("String_Node_Str");
  out.tab(1).println("String_Node_Str",JsonObject.class.getName(),getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(2).println("String_Node_Str",getStrategy().getFullJavaClassName(table,GeneratorStrategy.Mode.POJO));
  out.tab(1).println("String_Node_Str");
  out.println();
}
Program: 174926
Project: 174926
Buggy source:
private final List<Table<?>> getTables0(){
  return Arrays.<Table<?>>asList(Something.SOMETHING,Somethingcomposite.SOMETHINGCOMPOSITE);
}

Fixed version (ground truth):
private final List<Table<?>> getTables0(){
  return Arrays.<Table<?>>asList(Something.SOMETHING,Somethingcomposite.SOMETHINGCOMPOSITE,Somethingwithoutjson.SOMETHINGWITHOUTJSON);
}
Program: 174927
Project: 174927
Buggy source:
@Override public java.util.function.Function<JsonObject,generated.classic.async.vertx.tables.pojos.Something> jsonMapper(){
  return generated.classic.async.vertx.tables.pojos.Something::new;
}

Fixed version (ground truth):
@Override public java.util.function.Function<io.vertx.core.json.JsonObject,generated.classic.async.vertx.tables.pojos.Something> jsonMapper(){
  return generated.classic.async.vertx.tables.pojos.Something::new;
}
Program: 174928
Project: 174928
Buggy source:
@Override public java.util.function.Function<JsonObject,generated.classic.async.vertx.tables.pojos.Somethingcomposite> jsonMapper(){
  return generated.classic.async.vertx.tables.pojos.Somethingcomposite::new;
}

Fixed version (ground truth):
@Override public java.util.function.Function<io.vertx.core.json.JsonObject,generated.classic.async.vertx.tables.pojos.Somethingcomposite> jsonMapper(){
  return generated.classic.async.vertx.tables.pojos.Somethingcomposite::new;
}
Program: 174934
Project: 174934
Buggy source:
/** 
 * @param x
 * @param y
 * @param offsetx
 * @param offsety
 * @return
 */
public synchronized int[] readPixValues(int x,int y,int offsetx,int offsety){
  int pixels=offsetx * offsety;
  Band b=data.GetRasterBand(band);
  int buf_size=pixels;
  int[] dd=new int[buf_size];
  try {
    b.ReadRaster(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,dd);
  }
 catch (  Exception ex2) {
    try {
      Thread.sleep(1000);
    }
 catch (    Exception ex) {
    }
    b.ReadRaster(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,dd);
  }
  return dd;
}

Fixed version (ground truth):
public synchronized int[] readPixValues(int x,int y,int offsetx,int offsety){
  return readPixValues(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,1);
}
Program: 174935
Project: 174935
Buggy source:
@Override public File getOverviewFile(){
  return new File(this.overviewImage);
}

Fixed version (ground truth):
@Override public File getOverviewFile(){
  try {
    return new File(this.overviewImage);
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 174936
Project: 174936
Buggy source:
/** 
 * @param imageFile
 * @throws IOException
 */
protected void setFile(File imageFile) throws IOException {
  files=new String[1];
  File parent=imageFile;
  if (!parent.isDirectory()) {
    parent=imageFile.getParentFile();
  }
  for (  File f : parent.listFiles()) {
    if (f.getName().endsWith("String_Node_Str")) {
      productxml=f;
      files[0]=f.getAbsolutePath();
    }
  }
  if (productxml == null)   throw new IOException("String_Node_Str");
  overviewImage=new StringBuilder(parent.getAbsolutePath()).append("String_Node_Str").toString();
}

Fixed version (ground truth):
/** 
 * @param imageFile
 * @throws IOException
 */
protected void setFile(File imageFile) throws IOException {
  files=new String[1];
  File parent=imageFile;
  if (!parent.isDirectory()) {
    parent=imageFile.getParentFile();
  }
  for (  File f : parent.listFiles()) {
    if (f.getName().endsWith("String_Node_Str")) {
      productxml=f;
      files[0]=f.getAbsolutePath();
    }
  }
  if (productxml == null)   throw new IOException("String_Node_Str");
  overviewImage=new StringBuilder(parent.getAbsolutePath()).append(File.separator).append("String_Node_Str").toString();
}
Program: 174937
Project: 174937
Buggy source:
@Override public void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).getxSize(),length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=(TIFF)getImage(band);
  try {
    preloadedDataReal=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,0,(int[])null);
    preloadedDataImg=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
@Override public synchronized void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).getxSize(),length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=(TIFF)getImage(band);
  try {
    preloadedDataReal=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,0,(int[])null);
    preloadedDataImg=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}
Program: 174938
Project: 174938
Buggy source:
public void setMaxValue(int value,String polarization){
  this.statisticsBoatForPolarization.get(polarization).maxValue=value;
}

Fixed version (ground truth):
public void setMaxValue(int value,String polarization){
  BoatStatisticMapPolarization.Statistics stats=this.statisticsBoatForPolarization.get(polarization);
  stats.maxValue=value;
  statisticsBoatForPolarization.put(polarization,stats);
}
Program: 174941
Project: 174941
Buggy source:
/** 
 * @param x
 * @param y
 * @param offsetx
 * @param offsety
 * @return
 */
public synchronized int[] readPixValues(int x,int y,int offsetx,int offsety){
  int pixels=offsetx * offsety;
  Band b=data.GetRasterBand(band);
  int buf_size=pixels;
  int[] dd=new int[buf_size];
  try {
    b.ReadRaster(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,dd);
  }
 catch (  Exception ex2) {
    try {
      Thread.sleep(1000);
    }
 catch (    Exception ex) {
    }
    b.ReadRaster(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,dd);
  }
  return dd;
}

Fixed version (ground truth):
public synchronized int[] readPixValues(int x,int y,int offsetx,int offsety){
  return readPixValues(x,y,offsetx,offsety,gdalconstConstants.GDT_UInt32,1);
}
Program: 174942
Project: 174942
Buggy source:
@Override public File getOverviewFile(){
  return new File(this.overviewImage);
}

Fixed version (ground truth):
@Override public File getOverviewFile(){
  try {
    return new File(this.overviewImage);
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 174943
Project: 174943
Buggy source:
/** 
 * @param imageFile
 * @throws IOException
 */
protected void setFile(File imageFile) throws IOException {
  files=new String[1];
  File parent=imageFile;
  if (!parent.isDirectory()) {
    parent=imageFile.getParentFile();
  }
  for (  File f : parent.listFiles()) {
    if (f.getName().endsWith("String_Node_Str")) {
      productxml=f;
      files[0]=f.getAbsolutePath();
    }
  }
  if (productxml == null)   throw new IOException("String_Node_Str");
  overviewImage=new StringBuilder(parent.getAbsolutePath()).append("String_Node_Str").toString();
}

Fixed version (ground truth):
/** 
 * @param imageFile
 * @throws IOException
 */
protected void setFile(File imageFile) throws IOException {
  files=new String[1];
  File parent=imageFile;
  if (!parent.isDirectory()) {
    parent=imageFile.getParentFile();
  }
  for (  File f : parent.listFiles()) {
    if (f.getName().endsWith("String_Node_Str")) {
      productxml=f;
      files[0]=f.getAbsolutePath();
    }
  }
  if (productxml == null)   throw new IOException("String_Node_Str");
  overviewImage=new StringBuilder(parent.getAbsolutePath()).append(File.separator).append("String_Node_Str").toString();
}
Program: 174944
Project: 174944
Buggy source:
@Override public void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).getxSize(),length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=(TIFF)getImage(band);
  try {
    preloadedDataReal=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,0,(int[])null);
    preloadedDataImg=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
@Override public synchronized void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).getxSize(),length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=(TIFF)getImage(band);
  try {
    preloadedDataReal=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,0,(int[])null);
    preloadedDataImg=tiff.read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}
Program: 174945
Project: 174945
Buggy source:
public void setMaxValue(int value,String polarization){
  this.statisticsBoatForPolarization.get(polarization).maxValue=value;
}

Fixed version (ground truth):
public void setMaxValue(int value,String polarization){
  BoatStatisticMapPolarization.Statistics stats=this.statisticsBoatForPolarization.get(polarization);
  stats.maxValue=value;
  statisticsBoatForPolarization.put(polarization,stats);
}
Program: 174947
Project: 174947
Buggy source:
public boolean contains(String fileName){
  if (fileName == null) {
    return false;
  }
  fileName=clean(fileName);
  java.io.File file;
  if (fileName.startsWith(getPath().getAbsolutePath())) {
    file=new java.io.File(fileName);
  }
 else {
    file=new File(new StringBuilder(getPath().getAbsolutePath()).append("String_Node_Str").append(fileName).toString());
  }
  if (file.exists()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @return
 */
public boolean contains(String fileName){
  if (fileName == null) {
    return false;
  }
  fileName=clean(fileName);
  java.io.File file;
  if (fileName.startsWith(getPath().getAbsolutePath())) {
    file=new java.io.File(fileName);
  }
 else {
    file=new File(new StringBuilder(getPath().getAbsolutePath()).append("String_Node_Str").append(fileName).toString());
  }
  if (file.exists()) {
    return true;
  }
  return false;
}
Program: 174948
Project: 174948
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: 174949
Project: 174949
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: 174950
Project: 174950
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: 174951
Project: 174951
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: 174952
Project: 174952
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: 174953
Project: 174953
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);
}
Program: 174956
Project: 174956
Buggy source:
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);
}

Fixed version (ground truth):
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};
  }
  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();
  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(activeGir,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 {
  }
  return new Object[]{f.getAbsolutePath(),next,null};
}
Program: 174957
Project: 174957
Buggy source:
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;
}

Fixed version (ground truth):
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;
}
Program: 174958
Project: 174958
Buggy source:
/** 
 * @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)));
  }
}

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=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)));
  }
}
Program: 174959
Project: 174959
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: 174960
Project: 174960
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: 174961
Project: 174961
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: 174962
Project: 174962
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: 174963
Project: 174963
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: 174965
Project: 174965
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: 174966
Project: 174966
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;
}