nus-yam/ex-repair huggingface dataset:
Program: 79853
Project: 79853
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,headers="String_Node_Str") public @ResponseBody Project update(@PathVariable("String_Node_Str") Long id,@RequestBody ProjectDTO updated){
  logger.debug("String_Node_Str" + updated);
  Project project=projectRepository.findOne(updated.getId());
  project.setName(updated.getName());
  project.setDescription(updated.getDescription());
  return project;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,headers="String_Node_Str") public @ResponseBody Project update(@PathVariable("String_Node_Str") Long workspaceId,@PathVariable("String_Node_Str") Long id,@RequestBody ProjectDTO updated){
  logger.debug("String_Node_Str" + updated);
  Project project=projectRepository.findOne(updated.getId());
  project.setName(updated.getName());
  project.setDescription(updated.getDescription());
  return project;
}
Program: 79854
Project: 79854
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,headers="String_Node_Str") public @ResponseBody Project delete(@PathVariable("String_Node_Str") Long id){
  logger.debug("String_Node_Str" + id);
  Project deleted=projectRepository.findOne(id);
  projectRepository.delete(deleted);
  return deleted;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,headers="String_Node_Str") public @ResponseBody Project delete(@PathVariable("String_Node_Str") Long workspaceId,@PathVariable("String_Node_Str") Long id){
  logger.debug("String_Node_Str" + id);
  Project deleted=projectRepository.findOne(id);
  projectRepository.delete(deleted);
  return deleted;
}
Program: 79855
Project: 79855
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public @ResponseBody List<Project> findAll(){
  logger.debug("String_Node_Str");
  return projectRepository.findAll();
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public @ResponseBody List<Project> findAll(@PathVariable("String_Node_Str") Long workspaceId){
  logger.debug("String_Node_Str");
  return projectRepository.findAll();
}
Program: 79856
Project: 79856
Buggy source:
@Query("String_Node_Str") public List<BaseNode> getChildren(@Param("String_Node_Str") String nodeId);

Fixed version (ground truth):
@Query("String_Node_Str") public List<BaseNode> getChildren(@Param("String_Node_Str") Long nodeId);
Program: 79857
Project: 79857
Buggy source:
@Query("String_Node_Str") public BaseNode getParent(@Param("String_Node_Str") String parentId);

Fixed version (ground truth):
@Query("String_Node_Str") public BaseNode getParent(@Param("String_Node_Str") Long parentId);
Program: 79858
Project: 79858
Buggy source:
public int getPosition(){
  return position;
}

Fixed version (ground truth):
public Long getPosition(){
  return position;
}
Program: 79859
Project: 79859
Buggy source:
public void setParentId(String parentId){
  this.parentId=parentId;
}

Fixed version (ground truth):
public void setParentId(Long parentId){
  this.parentId=parentId;
}
Program: 79860
Project: 79860
Buggy source:
public String getParentId(){
  return parentId;
}

Fixed version (ground truth):
public Long getParentId(){
  return parentId;
}
Program: 79861
Project: 79861
Buggy source:
public void setPosition(int position){
  this.position=position;
}

Fixed version (ground truth):
public void setPosition(Long position){
  this.position=position;
}
Program: 79864
Project: 79864
Buggy source:
@Override public List<IngameTrade> getIngameTrades(){
  List<IngameTrade> trades=new ArrayList<IngameTrade>();
  int tableOffset=romEntry.getValue("String_Node_Str");
  int tableSize=romEntry.getValue("String_Node_Str");
  int nicknameLength=romEntry.getValue("String_Node_Str");
  int otLength=romEntry.getValue("String_Node_Str");
  int[] unused=romEntry.arrayEntries.get("String_Node_Str");
  int unusedOffset=0;
  int entryLength=nicknameLength + otLength + 10;
  for (int entry=0; entry < tableSize; entry++) {
    if (unusedOffset < unused.length && unused[unusedOffset] == entry) {
      unusedOffset++;
      continue;
    }
    IngameTrade trade=new IngameTrade();
    int entryOffset=tableOffset + entry * entryLength;
    trade.requestedPokemon=pokes[rom[entryOffset + 1] & 0xFF];
    trade.givenPokemon=pokes[rom[entryOffset + 2] & 0xFF];
    trade.nickname=readString(entryOffset + 3,nicknameLength);
    int atkdef=rom[entryOffset + 3 + nicknameLength] & 0xFF;
    int spdspc=rom[entryOffset + 4 + nicknameLength] & 0xFF;
    trade.ivs=new int[]{(atkdef >> 4) & 0xF,atkdef & 0xF,(spdspc >> 4) & 0xF,spdspc & 0xF};
    trade.item=rom[entryOffset + 5 + nicknameLength] & 0xFF;
    trade.otId=readWord(entryOffset + 6 + nicknameLength);
    trade.otName=readString(entryOffset + 8 + nicknameLength,otLength);
    trades.add(trade);
  }
  return trades;
}

Fixed version (ground truth):
@Override public List<IngameTrade> getIngameTrades(){
  List<IngameTrade> trades=new ArrayList<IngameTrade>();
  int tableOffset=romEntry.getValue("String_Node_Str");
  int tableSize=romEntry.getValue("String_Node_Str");
  int nicknameLength=romEntry.getValue("String_Node_Str");
  int otLength=romEntry.getValue("String_Node_Str");
  int[] unused=romEntry.arrayEntries.get("String_Node_Str");
  int unusedOffset=0;
  int entryLength=nicknameLength + otLength + 9;
  if (entryLength % 2 != 0) {
    entryLength++;
  }
  for (int entry=0; entry < tableSize; entry++) {
    if (unusedOffset < unused.length && unused[unusedOffset] == entry) {
      unusedOffset++;
      continue;
    }
    IngameTrade trade=new IngameTrade();
    int entryOffset=tableOffset + entry * entryLength;
    trade.requestedPokemon=pokes[rom[entryOffset + 1] & 0xFF];
    trade.givenPokemon=pokes[rom[entryOffset + 2] & 0xFF];
    trade.nickname=readString(entryOffset + 3,nicknameLength);
    int atkdef=rom[entryOffset + 3 + nicknameLength] & 0xFF;
    int spdspc=rom[entryOffset + 4 + nicknameLength] & 0xFF;
    trade.ivs=new int[]{(atkdef >> 4) & 0xF,atkdef & 0xF,(spdspc >> 4) & 0xF,spdspc & 0xF};
    trade.item=rom[entryOffset + 5 + nicknameLength] & 0xFF;
    trade.otId=readWord(entryOffset + 6 + nicknameLength);
    trade.otName=readString(entryOffset + 8 + nicknameLength,otLength);
    trades.add(trade);
  }
  return trades;
}
Program: 79865
Project: 79865
Buggy source:
public static void applyPatch(byte[] rom,String patchName) throws IOException {
  byte[] patch=getCodeTweakFile(patchName + "String_Node_Str");
  int patchlen=patch.length;
  if (patchlen < 8 || patch[0] != 'P' || patch[1] != 'A' || patch[2] != 'T' || patch[3] != 'C' || patch[4] != 'H') {
    throw new IOException("String_Node_Str");
  }
  int offset=5;
  while (offset + 2 < patchlen) {
    int writeOffset=readIPSOffset(patch,offset);
    if (writeOffset == 0x454f46) {
      return;
    }
    offset+=3;
    if (offset + 1 >= patchlen) {
      throw new IOException("String_Node_Str");
    }
    int size=readIPSSize(patch,offset);
    offset+=2;
    if (size == 0) {
      if (offset + 1 >= patchlen) {
        throw new IOException("String_Node_Str");
      }
      int rleSize=readIPSSize(patch,offset);
      if (writeOffset + rleSize > rom.length) {
        throw new IOException("String_Node_Str");
      }
      offset+=2;
      if (offset >= patchlen) {
        throw new IOException("String_Node_Str");
      }
      byte rleByte=patch[offset++];
      for (int i=writeOffset; i < writeOffset + rleSize; i++) {
        rom[i]=rleByte;
      }
    }
 else {
      if (offset + size > patchlen) {
        throw new IOException("String_Node_Str");
      }
      if (writeOffset + size > rom.length) {
        throw new IOException("String_Node_Str");
      }
      System.arraycopy(patch,offset,rom,writeOffset,size);
      offset+=size;
    }
  }
  throw new IOException("String_Node_Str");
}

Fixed version (ground truth):
public static void applyPatch(byte[] rom,String patchName) throws IOException {
  byte[] patch=getCodeTweakFile(patchName + "String_Node_Str");
  System.out.println(patch.length);
  System.out.println(Arrays.toString(patch));
  int patchlen=patch.length;
  if (patchlen < 8 || patch[0] != 'P' || patch[1] != 'A' || patch[2] != 'T' || patch[3] != 'C' || patch[4] != 'H') {
    throw new IOException("String_Node_Str");
  }
  int offset=5;
  while (offset + 2 < patchlen) {
    int writeOffset=readIPSOffset(patch,offset);
    if (writeOffset == 0x454f46) {
      return;
    }
    offset+=3;
    if (offset + 1 >= patchlen) {
      throw new IOException("String_Node_Str");
    }
    int size=readIPSSize(patch,offset);
    offset+=2;
    if (size == 0) {
      if (offset + 1 >= patchlen) {
        throw new IOException("String_Node_Str");
      }
      int rleSize=readIPSSize(patch,offset);
      if (writeOffset + rleSize > rom.length) {
        throw new IOException("String_Node_Str");
      }
      offset+=2;
      if (offset >= patchlen) {
        throw new IOException("String_Node_Str");
      }
      byte rleByte=patch[offset++];
      for (int i=writeOffset; i < writeOffset + rleSize; i++) {
        rom[i]=rleByte;
      }
    }
 else {
      if (offset + size > patchlen) {
        throw new IOException("String_Node_Str");
      }
      if (writeOffset + size > rom.length) {
        throw new IOException("String_Node_Str");
      }
      System.arraycopy(patch,offset,rom,writeOffset,size);
      offset+=size;
    }
  }
  throw new IOException("String_Node_Str");
}
Program: 79866
Project: 79866
Buggy source:
public static byte[] getCodeTweakFile(String filename) throws IOException {
  InputStream is=FileFunctions.class.getResourceAsStream("String_Node_Str" + filename);
  byte[] buf=new byte[is.available()];
  is.read(buf);
  is.close();
  return buf;
}

Fixed version (ground truth):
public static byte[] getCodeTweakFile(String filename) throws IOException {
  InputStream is=FileFunctions.class.getResourceAsStream("String_Node_Str" + filename);
  byte[] buf=new byte[is.available()];
  int offs=0, read=0;
  while (offs < buf.length && (read=is.read(buf,offs,buf.length - offs)) != -1) {
    offs+=read;
  }
  is.close();
  return buf;
}
Program: 79868
Project: 79868
Buggy source:
public static Set<Pokemon> getMiddleEvolutions(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> middleEvolutions=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn.evolutionsTo.size() == 1 && pkmn.evolutionsFrom.size() == 0) {
      Evolution onlyEvo=pkmn.evolutionsTo.get(0);
      if (onlyEvo.carryStats) {
        middleEvolutions.add(pkmn);
      }
    }
  }
  return middleEvolutions;
}

Fixed version (ground truth):
public static Set<Pokemon> getMiddleEvolutions(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> middleEvolutions=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn != null) {
      if (pkmn.evolutionsTo.size() == 1 && pkmn.evolutionsFrom.size() > 0) {
        Evolution onlyEvo=pkmn.evolutionsTo.get(0);
        if (onlyEvo.carryStats) {
          middleEvolutions.add(pkmn);
        }
      }
    }
  }
  return middleEvolutions;
}
Program: 79869
Project: 79869
Buggy source:
public static Set<Pokemon> getFinalEvolutions(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> finalEvolutions=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn.evolutionsTo.size() == 1 && pkmn.evolutionsFrom.size() > 0) {
      Evolution onlyEvo=pkmn.evolutionsTo.get(0);
      if (onlyEvo.carryStats) {
        finalEvolutions.add(pkmn);
      }
    }
  }
  return finalEvolutions;
}

Fixed version (ground truth):
public static Set<Pokemon> getFinalEvolutions(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> finalEvolutions=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn != null) {
      if (pkmn.evolutionsTo.size() == 1 && pkmn.evolutionsFrom.size() == 0) {
        Evolution onlyEvo=pkmn.evolutionsTo.get(0);
        if (onlyEvo.carryStats) {
          finalEvolutions.add(pkmn);
        }
      }
    }
  }
  return finalEvolutions;
}
Program: 79870
Project: 79870
Buggy source:
public static Set<Pokemon> getBasicOrNoCopyPokemon(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> dontCopyPokes=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn.evolutionsTo.size() != 1) {
      dontCopyPokes.add(pkmn);
    }
 else {
      Evolution onlyEvo=pkmn.evolutionsTo.get(0);
      if (!onlyEvo.carryStats) {
        dontCopyPokes.add(pkmn);
      }
    }
  }
  return dontCopyPokes;
}

Fixed version (ground truth):
public static Set<Pokemon> getBasicOrNoCopyPokemon(RomHandler baseRom){
  List<Pokemon> allPokes=baseRom.getPokemon();
  Set<Pokemon> dontCopyPokes=new TreeSet<Pokemon>();
  for (  Pokemon pkmn : allPokes) {
    if (pkmn != null) {
      if (pkmn.evolutionsTo.size() != 1) {
        dontCopyPokes.add(pkmn);
      }
 else {
        Evolution onlyEvo=pkmn.evolutionsTo.get(0);
        if (!onlyEvo.carryStats) {
          dontCopyPokes.add(pkmn);
        }
      }
    }
  }
  return dontCopyPokes;
}
Program: 79872
Project: 79872
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + from.number;
  result=prime * result + to.number;
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + from.number;
  result=prime * result + to.number;
  result=prime * result + type.ordinal();
  return result;
}
Program: 79873
Project: 79873
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Evolution other=(Evolution)obj;
  if (from != other.from)   return false;
  if (to != other.to)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Evolution other=(Evolution)obj;
  if (from != other.from)   return false;
  if (to != other.to)   return false;
  if (type != other.type)   return false;
  return true;
}
Program: 79874
Project: 79874
Buggy source:
@Override public int compareTo(Evolution o){
  if (this.from.number < o.from.number) {
    return -1;
  }
 else   if (this.from.number > o.from.number) {
    return 1;
  }
 else   if (this.to.number < o.to.number) {
    return -1;
  }
 else   if (this.to.number > o.to.number) {
    return 1;
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
@Override public int compareTo(Evolution o){
  if (this.from.number < o.from.number) {
    return -1;
  }
 else   if (this.from.number > o.from.number) {
    return 1;
  }
 else   if (this.to.number < o.to.number) {
    return -1;
  }
 else   if (this.to.number > o.to.number) {
    return 1;
  }
 else   if (this.type.ordinal() < o.type.ordinal()) {
    return -1;
  }
 else   if (this.type.ordinal() > o.type.ordinal()) {
    return 1;
  }
 else {
    return 0;
  }
}
Program: 79877
Project: 79877
Buggy source:
@Override public boolean setStaticPokemon(List<Pokemon> staticPokemon){
  if (romEntry.getValue("String_Node_Str") == 0) {
    return false;
  }
  int singleSize=romEntry.staticPokemonSingle.size();
  int gcSize=romEntry.staticPokemonGameCorner.size();
  if (staticPokemon.size() != singleSize + gcSize) {
    return false;
  }
  for (  Pokemon pkmn : staticPokemon) {
    if (!isInGame(pkmn)) {
      return false;
    }
  }
  for (int i=0; i < singleSize; i++) {
    rom[romEntry.staticPokemonSingle.get(i)]=(byte)pokeNumToRBYTable[staticPokemon.get(i).number];
  }
  for (int i=0; i < gcSize; i++) {
    byte pokeNum=(byte)pokeNumToRBYTable[staticPokemon.get(i + singleSize).number];
    int[] offsets=romEntry.staticPokemonGameCorner.get(i).offsets;
    for (    int offset : offsets) {
      rom[offset]=pokeNum;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean setStaticPokemon(List<Pokemon> staticPokemon){
  if (romEntry.getValue("String_Node_Str") == 0) {
    return false;
  }
  int singleSize=romEntry.staticPokemonSingle.size();
  int gcSize=romEntry.staticPokemonGameCorner.size();
  if (staticPokemon.size() != singleSize + gcSize) {
    return false;
  }
  for (int i=0; i < singleSize; i++) {
    rom[romEntry.staticPokemonSingle.get(i)]=(byte)pokeNumToRBYTable[staticPokemon.get(i).number];
  }
  for (int i=0; i < gcSize; i++) {
    byte pokeNum=(byte)pokeNumToRBYTable[staticPokemon.get(i + singleSize).number];
    int[] offsets=romEntry.staticPokemonGameCorner.get(i).offsets;
    for (    int offset : offsets) {
      rom[offset]=pokeNum;
    }
  }
  return true;
}
Program: 79878
Project: 79878
Buggy source:
@Override public boolean setStarters(List<Pokemon> newStarters){
  if (newStarters.size() != 3) {
    return false;
  }
  for (  Pokemon pkmn : newStarters) {
    if (!isInGame(pkmn)) {
      return false;
    }
  }
  for (int i=0; i < 3; i++) {
    byte starter=(byte)newStarters.get(i).number;
    int[] offsets=romEntry.arrayEntries.get("String_Node_Str" + (i + 1));
    for (    int offset : offsets) {
      rom[offset]=starter;
    }
  }
  if (romEntry.getValue("String_Node_Str") > 0) {
    List<Integer> cyndaTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    int offset=cyndaTexts.get(romEntry.isCrystal ? 1 : 0);
    String pokeName=newStarters.get(0).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
    List<Integer> totoTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    offset=totoTexts.get(romEntry.isCrystal ? 1 : 0);
    pokeName=newStarters.get(1).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
    List<Integer> chikoTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    offset=chikoTexts.get(romEntry.isCrystal ? 1 : 0);
    pokeName=newStarters.get(2).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean setStarters(List<Pokemon> newStarters){
  if (newStarters.size() != 3) {
    return false;
  }
  for (int i=0; i < 3; i++) {
    byte starter=(byte)newStarters.get(i).number;
    int[] offsets=romEntry.arrayEntries.get("String_Node_Str" + (i + 1));
    for (    int offset : offsets) {
      rom[offset]=starter;
    }
  }
  if (romEntry.getValue("String_Node_Str") > 0) {
    List<Integer> cyndaTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    int offset=cyndaTexts.get(romEntry.isCrystal ? 1 : 0);
    String pokeName=newStarters.get(0).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
    List<Integer> totoTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    offset=totoTexts.get(romEntry.isCrystal ? 1 : 0);
    pokeName=newStarters.get(1).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
    List<Integer> chikoTexts=RomFunctions.search(rom,traduire("String_Node_Str"));
    offset=chikoTexts.get(romEntry.isCrystal ? 1 : 0);
    pokeName=newStarters.get(2).name;
    writeFixedLengthScriptString(pokeName + "String_Node_Str",offset,lengthOfStringAt(offset) + 1);
  }
  return true;
}
Program: 79879
Project: 79879
Buggy source:
@Override public boolean setStaticPokemon(List<Pokemon> staticPokemon){
  if (romEntry.getValue("String_Node_Str") == 0) {
    return false;
  }
  if (!havePatchedFleeing) {
    patchFleeing();
  }
  if (staticPokemon.size() != romEntry.staticPokemonSingle.size() + romEntry.staticPokemonGameCorner.size()) {
    return false;
  }
  for (  Pokemon pkmn : staticPokemon) {
    if (!isInGame(pkmn)) {
      return false;
    }
  }
  Iterator<Pokemon> statics=staticPokemon.iterator();
  for (  int offset : romEntry.staticPokemonSingle) {
    rom[offset]=(byte)statics.next().number;
  }
  int gcNameLength=romEntry.getValue("String_Node_Str");
  for (  int offset : romEntry.staticPokemonGameCorner.keySet()) {
    rom[offset]=(byte)statics.next().number;
    rom[offset + 0x11]=rom[offset];
    rom[offset + 0x16]=rom[offset];
    writePaddedPokemonName(pokes[rom[offset] & 0xFF].name,gcNameLength,romEntry.staticPokemonGameCorner.get(offset));
  }
  for (  int offset : romEntry.staticPokemonCopy.keySet()) {
    int copyTo=romEntry.staticPokemonCopy.get(offset);
    rom[copyTo]=rom[offset];
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean setStaticPokemon(List<Pokemon> staticPokemon){
  if (romEntry.getValue("String_Node_Str") == 0) {
    return false;
  }
  if (!havePatchedFleeing) {
    patchFleeing();
  }
  if (staticPokemon.size() != romEntry.staticPokemonSingle.size() + romEntry.staticPokemonGameCorner.size()) {
    return false;
  }
  Iterator<Pokemon> statics=staticPokemon.iterator();
  for (  int offset : romEntry.staticPokemonSingle) {
    rom[offset]=(byte)statics.next().number;
  }
  int gcNameLength=romEntry.getValue("String_Node_Str");
  for (  int offset : romEntry.staticPokemonGameCorner.keySet()) {
    rom[offset]=(byte)statics.next().number;
    rom[offset + 0x11]=rom[offset];
    rom[offset + 0x16]=rom[offset];
    writePaddedPokemonName(pokes[rom[offset] & 0xFF].name,gcNameLength,romEntry.staticPokemonGameCorner.get(offset));
  }
  for (  int offset : romEntry.staticPokemonCopy.keySet()) {
    int copyTo=romEntry.staticPokemonCopy.get(offset);
    rom[copyTo]=rom[offset];
  }
  return true;
}
Program: 79882
Project: 79882
Buggy source:
public Builder setRequesterPaysBuckets(Collection<String> requesterPaysBuckets){
  this.requesterPaysBuckets=requesterPaysBuckets == null ? ImmutableSet.of() : ImmutableSet.copyOf(requesterPaysBuckets);
  return this;
}

Fixed version (ground truth):
public Builder setRequesterPaysBuckets(Collection<String> requesterPaysBuckets){
  this.requesterPaysBuckets=requesterPaysBuckets == null ? ImmutableSet.<String>of() : ImmutableSet.copyOf(requesterPaysBuckets);
  return this;
}
Program: 79883
Project: 79883
Buggy source:
/** 
 * Constructs a BigQuery from a given Credential.
 */
public Bigquery getBigQueryFromCredential(Credential credential,String appName){
  LOG.info("String_Node_Str");
  if (credential != null) {
    return new Bigquery.Builder(HTTP_TRANSPORT,JSON_FACTORY,new RetryHttpInitializer(credential,appName)).setApplicationName(appName).build();
  }
  return new Bigquery.Builder(HTTP_TRANSPORT,JSON_FACTORY,credential).setApplicationName(appName).build();
}

Fixed version (ground truth):
/** 
 * Constructs a BigQuery from a given Credential.
 */
public Bigquery getBigQueryFromCredential(Credential credential,String appName){
  LOG.info("String_Node_Str");
  if (credential != null) {
    return new Bigquery.Builder(HTTP_TRANSPORT,JSON_FACTORY,new RetryHttpInitializer(credential,appName)).setApplicationName(appName).build();
  }
  return new Bigquery.Builder(HTTP_TRANSPORT,JSON_FACTORY,null).setApplicationName(appName).build();
}
Program: 79884
Project: 79884
Buggy source:
/** 
 * Deletes the temporary dataset, including all of the work tables.
 * @param context the job's context.
 * @throws IOException
 */
@Override public void cleanupJob(JobContext context) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",HadoopToStringUtil.toString(context));
  }
  Bigquery.Datasets datasets=bigQueryHelper.getRawBigquery().datasets();
  Configuration config=context.getConfiguration();
  try {
    LOG.debug("String_Node_Str",tempTableRef.getDatasetId(),tempTableRef.getProjectId());
    datasets.delete(tempTableRef.getProjectId(),tempTableRef.getDatasetId()).setDeleteContents(true).execute();
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Deletes the temporary dataset, including all of the work tables.
 * @param context the job's context.
 * @throws IOException
 */
@Override public void cleanupJob(JobContext context) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",HadoopToStringUtil.toString(context));
  }
  Bigquery.Datasets datasets=bigQueryHelper.getRawBigquery().datasets();
  try {
    LOG.debug("String_Node_Str",tempTableRef.getDatasetId(),tempTableRef.getProjectId());
    datasets.delete(tempTableRef.getProjectId(),tempTableRef.getDatasetId()).setDeleteContents(true).execute();
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str",e);
  }
}
Program: 79885
Project: 79885
Buggy source:
/** 
 * Sets delegate that this OutputFormat will wrap. This is exposed for testing purposes.
 * @param delegate that this OutputFormat will wrap.
 */
@VisibleForTesting void setDelegate(FileOutputFormat<K,V> delegate){
  this.delegate=delegate;
}

Fixed version (ground truth):
/** 
 * Sets delegate that this OutputFormat will wrap. This is exposed for testing purposes.
 * @param delegate that this OutputFormat will wrap.
 */
@VisibleForTesting synchronized void setDelegate(FileOutputFormat<K,V> delegate){
  this.delegate=delegate;
}
Program: 79886
Project: 79886
Buggy source:
/** 
 * Tests the needsTaskCommit method of BigQueryOutputFormat.
 */
@Test public void testNeedsTaskCommit() throws IOException {
  Table tableToReturn=new Table().setId(TEMP_TABLE_ID);
  when(mockBigQueryHelper.tableExists(any(TableReference.class))).thenReturn(false).thenReturn(true);
  Assert.assertEquals(false,committerInstance.needsTaskCommit(mockTaskAttemptContext));
  Assert.assertEquals(true,committerInstance.needsTaskCommit(mockTaskAttemptContext));
  verify(mockBigQueryHelper,times(2)).tableExists(eq(tempTableRef));
  verify(mockBigQueryHelper,never()).getRawBigquery();
}

Fixed version (ground truth):
/** 
 * Tests the needsTaskCommit method of BigQueryOutputFormat.
 */
@Test public void testNeedsTaskCommit() throws IOException {
  when(mockBigQueryHelper.tableExists(any(TableReference.class))).thenReturn(false).thenReturn(true);
  Assert.assertEquals(false,committerInstance.needsTaskCommit(mockTaskAttemptContext));
  Assert.assertEquals(true,committerInstance.needsTaskCommit(mockTaskAttemptContext));
  verify(mockBigQueryHelper,times(2)).tableExists(eq(tempTableRef));
  verify(mockBigQueryHelper,never()).getRawBigquery();
}
Program: 79887
Project: 79887
Buggy source:
/** 
 * Verifies there are no more interactions.
 */
@After public void tearDown(){
  verifyNoMoreInteractions(mockBigquery);
  verifyNoMoreInteractions(mockBigqueryTables);
  verifyNoMoreInteractions(mockBigqueryTablesDelete);
  verifyNoMoreInteractions(mockBigqueryTablesGet);
  verifyNoMoreInteractions(mockBigqueryDatasets);
  verifyNoMoreInteractions(mockBigqueryDatasetsInsert);
  verifyNoMoreInteractions(mockBigqueryDatasetsDelete);
  verifyNoMoreInteractions(mockErrorExtractor);
  verifyNoMoreInteractions(mockBigQueryHelper);
}

Fixed version (ground truth):
/** 
 * Verifies there are no more interactions.
 */
@After public void tearDown(){
  verifyNoMoreInteractions(mockBigquery);
  verifyNoMoreInteractions(mockBigqueryTables);
  verifyNoMoreInteractions(mockBigqueryTablesDelete);
  verifyNoMoreInteractions(mockBigqueryTablesGet);
  verifyNoMoreInteractions(mockBigqueryDatasets);
  verifyNoMoreInteractions(mockBigqueryDatasetsInsert);
  verifyNoMoreInteractions(mockBigqueryDatasetsDelete);
  verifyNoMoreInteractions(mockBigQueryHelper);
}
Program: 79888
Project: 79888
Buggy source:
/** 
 * Sets up common objects for testing before each test.
 */
@Before public void setUp() throws IOException {
  MockitoAnnotations.initMocks(this);
  conf=InMemoryGoogleHadoopFileSystem.getSampleConfiguration();
  expectedTempDataset=new Dataset().setDatasetReference(new DatasetReference().setProjectId(TEMP_PROJECT_ID).setDatasetId(TEMP_DATASET_ID)).setLocation(conf.get(BigQueryConfiguration.DATA_LOCATION_KEY,BigQueryConfiguration.DATA_LOCATION_DEFAULT));
  CredentialConfigurationUtil.addTestConfigurationSettings(conf);
  jobContext=org.apache.hadoop.mapreduce.Job.getInstance(conf);
  tempTableRef=new TableReference().setProjectId(TEMP_PROJECT_ID).setDatasetId(TEMP_DATASET_ID).setTableId(TEMP_TABLE_ID);
  finalTableRef=new TableReference().setProjectId(FINAL_PROJECT_ID).setDatasetId(FINAL_DATASET_ID).setTableId(FINAL_TABLE_ID);
  fakeTaskId=new TaskAttemptID(new TaskID("String_Node_Str",123,false,42),2);
  when(mockBigQueryHelper.getRawBigquery()).thenReturn(mockBigquery);
  jobReference=new JobReference().setProjectId(JOB_PROJECT_ID).setJobId("String_Node_Str");
  when(mockBigquery.jobs()).thenReturn(mockBigqueryJobs);
  when(mockBigqueryJobs.insert(any(String.class),any(Job.class))).thenReturn(mockBigqueryJobsInsert);
  when(mockBigqueryJobs.get(any(String.class),any(String.class))).thenReturn(mockBigqueryJobsGet);
  committerInstance=new BigQueryOutputCommitter(JOB_PROJECT_ID,tempTableRef,finalTableRef,conf);
  committerInstance.setBigQueryHelper(mockBigQueryHelper);
  committerInstance.setErrorExtractor(mockErrorExtractor);
}

Fixed version (ground truth):
/** 
 * Sets up common objects for testing before each test.
 */
@Before public void setUp() throws IOException {
  MockitoAnnotations.initMocks(this);
  conf=InMemoryGoogleHadoopFileSystem.getSampleConfiguration();
  expectedTempDataset=new Dataset().setDatasetReference(new DatasetReference().setProjectId(TEMP_PROJECT_ID).setDatasetId(TEMP_DATASET_ID)).setLocation(conf.get(BigQueryConfiguration.DATA_LOCATION_KEY,BigQueryConfiguration.DATA_LOCATION_DEFAULT));
  CredentialConfigurationUtil.addTestConfigurationSettings(conf);
  jobContext=org.apache.hadoop.mapreduce.Job.getInstance(conf);
  tempTableRef=new TableReference().setProjectId(TEMP_PROJECT_ID).setDatasetId(TEMP_DATASET_ID).setTableId(TEMP_TABLE_ID);
  finalTableRef=new TableReference().setProjectId(FINAL_PROJECT_ID).setDatasetId(FINAL_DATASET_ID).setTableId(FINAL_TABLE_ID);
  fakeTaskId=new TaskAttemptID(new TaskID("String_Node_Str",123,false,42),2);
  when(mockBigQueryHelper.getRawBigquery()).thenReturn(mockBigquery);
  jobReference=new JobReference().setProjectId(JOB_PROJECT_ID).setJobId("String_Node_Str");
  when(mockBigquery.jobs()).thenReturn(mockBigqueryJobs);
  when(mockBigqueryJobs.insert(any(String.class),any(Job.class))).thenReturn(mockBigqueryJobsInsert);
  when(mockBigqueryJobs.get(any(String.class),any(String.class))).thenReturn(mockBigqueryJobsGet);
  committerInstance=new BigQueryOutputCommitter(JOB_PROJECT_ID,tempTableRef,finalTableRef,conf);
  committerInstance.setBigQueryHelper(mockBigQueryHelper);
}
Program: 79889
Project: 79889
Buggy source:
@Override protected void checkPath(Path path){
  URI uri=path.toUri();
  String scheme=uri.getScheme();
  if (scheme == null || scheme.equalsIgnoreCase(getScheme())) {
    return;
  }
 else {
    String msg=String.format("String_Node_Str",scheme,path,getScheme());
    throw new IllegalArgumentException(msg);
  }
}

Fixed version (ground truth):
@Override protected void checkPath(Path path){
  URI uri=path.toUri();
  String scheme=uri.getScheme();
  if (scheme == null || scheme.equalsIgnoreCase(getScheme())) {
    return;
  }
  String msg=String.format("String_Node_Str",scheme,path,getScheme());
  throw new IllegalArgumentException(msg);
}
Program: 79890
Project: 79890
Buggy source:
public static void main(String[] args) throws IOException {
  GenericOptionsParser parser=new GenericOptionsParser(args);
  args=parser.getRemainingArgs();
  Configuration configuration=parser.getConfiguration();
  if ("String_Node_Str".equals(configuration.get("String_Node_Str","String_Node_Str"))) {
    String fsStringPath=configuration.get("String_Node_Str","String_Node_Str");
    Preconditions.checkState(!Strings.isNullOrEmpty(fsStringPath));
    LOG.info("String_Node_Str",fsStringPath);
    Path path=Paths.get(fsStringPath);
    if (Files.exists(path)) {
      FileSystemBackedDirectoryListCache cache=new FileSystemBackedDirectoryListCache(fsStringPath);
      cleanCache(cache);
    }
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  GenericOptionsParser parser=new GenericOptionsParser(args);
  Configuration configuration=parser.getConfiguration();
  if ("String_Node_Str".equals(configuration.get("String_Node_Str","String_Node_Str"))) {
    String fsStringPath=configuration.get("String_Node_Str","String_Node_Str");
    Preconditions.checkState(!Strings.isNullOrEmpty(fsStringPath));
    LOG.info("String_Node_Str",fsStringPath);
    Path path=Paths.get(fsStringPath);
    if (Files.exists(path)) {
      FileSystemBackedDirectoryListCache cache=new FileSystemBackedDirectoryListCache(fsStringPath);
      cleanCache(cache);
    }
  }
  LOG.info("String_Node_Str");
}
Program: 79891
Project: 79891
Buggy source:
/** 
 * Helper for determining whether a CacheEntry is entirely expired and should be removed from the cache.
 */
protected synchronized boolean isCacheEntryExpired(CacheEntry entry){
  long creationTime=entry.getCreationTimeMillis();
  long entryAge=clock.currentTimeMillis() - creationTime;
  if (entryAge > cacheConfig.getMaxEntryAgeMillis()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Helper for determining whether a CacheEntry is entirely expired and should be removed from the cache.
 */
protected synchronized boolean isCacheEntryExpired(CacheEntry entry){
  long creationTime=entry.getCreationTimeMillis();
  long entryAge=clock.currentTimeMillis() - creationTime;
  return entryAge > cacheConfig.getMaxEntryAgeMillis();
}
Program: 79893
Project: 79893
Buggy source:
@Override public List<CacheEntry> getRawBucketList() throws IOException {
  LOG.debug("String_Node_Str");
  File[] bucketList=basePath.toFile().listFiles();
  List<CacheEntry> bucketEntries=new ArrayList<>();
  for (  File bucket : bucketList) {
    if (!bucket.isDirectory()) {
      LOG.error("String_Node_Str",bucket);
      continue;
    }
    StorageResourceId bucketId=new StorageResourceId(bucket.getName());
    CacheEntry entry=new CacheEntry(bucketId,bucket.lastModified());
    bucketEntries.add(entry);
  }
  return bucketEntries;
}

Fixed version (ground truth):
@Override public List<CacheEntry> getRawBucketList() throws IOException {
  LOG.debug("String_Node_Str");
  File[] bucketList=basePath.toFile().listFiles();
  if (bucketList == null) {
    throw new IOException("String_Node_Str" + basePath);
  }
  if (bucketList.length == 0) {
    return ImmutableList.of();
  }
  List<CacheEntry> bucketEntries=new ArrayList<>();
  for (  File bucket : bucketList) {
    if (!bucket.isDirectory()) {
      LOG.error("String_Node_Str",bucket);
      continue;
    }
    StorageResourceId bucketId=new StorageResourceId(bucket.getName());
    CacheEntry entry=new CacheEntry(bucketId,bucket.lastModified());
    bucketEntries.add(entry);
  }
  return bucketEntries;
}
Program: 79894
Project: 79894
Buggy source:
public void run(File candidateFile) throws IOException {
  Path objectNamePath=bucketBasePath.relativize(candidateFile.toPath());
  String objectNamePathString=objectNamePath.toString();
  if (candidateFile.isDirectory()) {
    objectNamePathString=StorageResourceId.convertToDirectoryPath(objectNamePathString);
  }
  StorageResourceId objectId=new StorageResourceId(bucketName,objectNamePathString);
  CacheEntry entry=new CacheEntry(objectId,candidateFile.lastModified());
  if (isCacheEntryExpired(entry)) {
    LOG.debug("String_Node_Str",objectId);
    removeResourceId(objectId);
  }
 else {
    String objectName=objectId.getObjectName();
    String matchedName=GoogleCloudStorageStrings.matchListPrefix(objectNamePrefix,delimiter,objectName);
    if (matchedName != null && objectName.equals(matchedName)) {
      LOG.debug("String_Node_Str",objectId);
      cacheEntries.add(entry);
    }
  }
}

Fixed version (ground truth):
@Override public void run(File candidateFile) throws IOException {
  Path objectNamePath=bucketBasePath.relativize(candidateFile.toPath());
  String objectNamePathString=objectNamePath.toString();
  if (candidateFile.isDirectory()) {
    objectNamePathString=StorageResourceId.convertToDirectoryPath(objectNamePathString);
  }
  StorageResourceId objectId=new StorageResourceId(bucketName,objectNamePathString);
  CacheEntry entry=new CacheEntry(objectId,candidateFile.lastModified());
  if (isCacheEntryExpired(entry)) {
    LOG.debug("String_Node_Str",objectId);
    removeResourceId(objectId);
  }
 else {
    String objectName=objectId.getObjectName();
    String matchedName=GoogleCloudStorageStrings.matchListPrefix(objectNamePrefix,delimiter,objectName);
    if (matchedName != null && objectName.equals(matchedName)) {
      LOG.debug("String_Node_Str",objectId);
      cacheEntries.add(entry);
    }
  }
}
Program: 79895
Project: 79895
Buggy source:
@Override public List<CacheEntry> getBucketList() throws IOException {
  LOG.debug("String_Node_Str");
  File[] bucketList=basePath.toFile().listFiles();
  List<CacheEntry> bucketEntries=new ArrayList<>();
  Set<StorageResourceId> expiredBuckets=new HashSet<>();
  for (  File bucket : bucketList) {
    if (!bucket.isDirectory()) {
      LOG.error("String_Node_Str",bucket);
      continue;
    }
    StorageResourceId bucketId=new StorageResourceId(bucket.getName());
    CacheEntry entry=new CacheEntry(bucketId,bucket.lastModified());
    if (isCacheEntryExpired(entry)) {
      expiredBuckets.add(bucketId);
    }
 else {
      bucketEntries.add(entry);
    }
  }
  for (  StorageResourceId expiredBucket : expiredBuckets) {
    LOG.debug("String_Node_Str",expiredBucket);
    removeResourceId(expiredBucket);
  }
  return bucketEntries;
}

Fixed version (ground truth):
@Override public List<CacheEntry> getBucketList() throws IOException {
  LOG.debug("String_Node_Str");
  File[] bucketList=basePath.toFile().listFiles();
  if (bucketList == null) {
    throw new IOException("String_Node_Str" + basePath);
  }
  if (bucketList.length == 0) {
    return ImmutableList.of();
  }
  List<CacheEntry> bucketEntries=new ArrayList<>();
  Set<StorageResourceId> expiredBuckets=new HashSet<>();
  for (  File bucket : bucketList) {
    if (!bucket.isDirectory()) {
      LOG.error("String_Node_Str",bucket);
      continue;
    }
    StorageResourceId bucketId=new StorageResourceId(bucket.getName());
    CacheEntry entry=new CacheEntry(bucketId,bucket.lastModified());
    if (isCacheEntryExpired(entry)) {
      expiredBuckets.add(bucketId);
    }
 else {
      bucketEntries.add(entry);
    }
  }
  for (  StorageResourceId expiredBucket : expiredBuckets) {
    LOG.debug("String_Node_Str",expiredBucket);
    removeResourceId(expiredBucket);
  }
  return bucketEntries;
}
Program: 79896
Project: 79896
Buggy source:
@Override public int getInternalNumBuckets() throws IOException {
  return basePath.toFile().listFiles().length;
}

Fixed version (ground truth):
@Override public int getInternalNumBuckets() throws IOException {
  File[] bucketList=basePath.toFile().listFiles();
  if (bucketList == null) {
    throw new IOException("String_Node_Str" + basePath);
  }
  return bucketList.length;
}
Program: 79897
Project: 79897
Buggy source:
@Test public void testMultipleSplits() throws IOException, InterruptedException {
  long fileLength=testAvroFile.length();
  List<FileSplit> splits=new ArrayList<>();
  Path hadoopPath=new Path("String_Node_Str" + testAvroFile.getAbsolutePath());
  for (int blockStart=0; blockStart < fileLength; blockStart+=AUTO_SYNC_INTERVAL) {
    splits.add(new FileSplit(hadoopPath,blockStart,AUTO_SYNC_INTERVAL,new String[0]));
  }
  List<String> allRecordKeys=new ArrayList<>();
  long totalFileRecords=0;
  for (  FileSplit split : splits) {
    try (AvroRecordReader reader=new AvroRecordReader()){
      reader.initializeInternal(split,new Configuration());
      List<String> keysInSplit=collectRecordKeys(reader);
      allRecordKeys.addAll(keysInSplit);
      int recordsInSplit=keysInSplit.size();
      totalFileRecords+=recordsInSplit;
      Truth.assertThat(recordsInSplit).isLessThan(RECORD_COUNT);
    }
   }
  Truth.assertThat(allRecordKeys).containsExactlyElementsIn(allAddedKeys);
  Assert.assertEquals(RECORD_COUNT,totalFileRecords);
}

Fixed version (ground truth):
@Test public void testMultipleSplits() throws IOException, InterruptedException {
  long fileLength=testAvroFile.length();
  List<FileSplit> splits=new ArrayList<>();
  Path hadoopPath=new Path("String_Node_Str" + testAvroFile.getAbsolutePath());
  for (int blockStart=0; blockStart < fileLength; blockStart+=AUTO_SYNC_INTERVAL) {
    splits.add(new FileSplit(hadoopPath,blockStart,AUTO_SYNC_INTERVAL,new String[0]));
  }
  List<String> allRecordKeys=new ArrayList<>();
  long totalFileRecords=0;
  for (  FileSplit split : splits) {
    try (AvroRecordReader reader=new AvroRecordReader()){
      reader.initializeInternal(split,new Configuration());
      List<String> keysInSplit=collectRecordKeys(reader);
      allRecordKeys.addAll(keysInSplit);
      int recordsInSplit=keysInSplit.size();
      totalFileRecords+=recordsInSplit;
      Truth.assertThat(recordsInSplit).isLessThan(RECORD_COUNT);
    }
   }
  Truth.assertThat(allRecordKeys).containsExactlyElementsIn(allAddedKeys);
  Truth.assertThat(totalFileRecords).isEqualTo(RECORD_COUNT);
}
Program: 79898
Project: 79898
Buggy source:
@Before public void setup() throws IOException {
  Schema schema=SchemaBuilder.record("String_Node_Str").fields().name("String_Node_Str").type().stringBuilder().endString().noDefault().name("String_Node_Str").type().stringBuilder().endString().noDefault().name("String_Node_Str").type().intBuilder().endInt().noDefault().endRecord();
  GenericDatumWriter<GenericData.Record> recordWriter=new GenericDatumWriter<>(schema);
  testAvroFile=temporaryFolder.newFile("String_Node_Str");
  if (testAvroFile.exists()) {
    testAvroFile.delete();
  }
  DataFileWriter<GenericData.Record> dataFileWriter=new DataFileWriter<>(recordWriter).create(schema,testAvroFile);
  dataFileWriter.setSyncInterval(AUTO_SYNC_INTERVAL);
  ImmutableList.Builder<String> addedKeysBuilder=ImmutableList.builder();
  for (int idx=0; idx < RECORD_COUNT; idx++) {
    GenericData.Record record=new GenericData.Record(schema);
    String key=String.format("String_Node_Str",idx);
    record.put("String_Node_Str",key);
    record.put("String_Node_Str",String.format("String_Node_Str",idx));
    record.put("String_Node_Str",new Integer(idx * RECORD_COUNT));
    dataFileWriter.append(record);
    addedKeysBuilder.add(key);
  }
  dataFileWriter.close();
  allAddedKeys=addedKeysBuilder.build();
}

Fixed version (ground truth):
@Before public void setup() throws IOException {
  Schema schema=SchemaBuilder.record("String_Node_Str").fields().name("String_Node_Str").type().stringBuilder().endString().noDefault().name("String_Node_Str").type().stringBuilder().endString().noDefault().name("String_Node_Str").type().intBuilder().endInt().noDefault().endRecord();
  GenericDatumWriter<GenericData.Record> recordWriter=new GenericDatumWriter<>(schema);
  testAvroFile=temporaryFolder.newFile("String_Node_Str");
  if (testAvroFile.exists()) {
    testAvroFile.delete();
  }
  DataFileWriter<GenericData.Record> dataFileWriter=new DataFileWriter<>(recordWriter).create(schema,testAvroFile);
  dataFileWriter.setSyncInterval(AUTO_SYNC_INTERVAL);
  ImmutableList.Builder<String> addedKeysBuilder=ImmutableList.builder();
  for (int idx=0; idx < RECORD_COUNT; idx++) {
    GenericData.Record record=new GenericData.Record(schema);
    String key=String.format("String_Node_Str",idx);
    record.put("String_Node_Str",key);
    record.put("String_Node_Str",String.format("String_Node_Str",idx));
    record.put("String_Node_Str",idx * RECORD_COUNT);
    dataFileWriter.append(record);
    addedKeysBuilder.add(key);
  }
  dataFileWriter.close();
  allAddedKeys=addedKeysBuilder.build();
}
Program: 79899
Project: 79899
Buggy source:
@Test public void testSingleSplit() throws IOException, InterruptedException {
  FileSplit fileSplit=new FileSplit(new Path("String_Node_Str" + testAvroFile.getAbsolutePath()),0,testAvroFile.length(),new String[0]);
  AvroRecordReader recordReader=new AvroRecordReader();
  recordReader.initializeInternal(fileSplit,new Configuration());
  Assert.assertEquals(RECORD_COUNT,remainingRecordCount(recordReader));
  recordReader.close();
}

Fixed version (ground truth):
@Test public void testSingleSplit() throws IOException, InterruptedException {
  FileSplit fileSplit=new FileSplit(new Path("String_Node_Str" + testAvroFile.getAbsolutePath()),0,testAvroFile.length(),new String[0]);
  AvroRecordReader recordReader=new AvroRecordReader();
  recordReader.initializeInternal(fileSplit,new Configuration());
  Truth.assertThat(remainingRecordCount(recordReader)).isEqualTo(RECORD_COUNT);
  recordReader.close();
}
Program: 79900
Project: 79900
Buggy source:
/** 
 * Extracts the error message.
 */
public String getErrorMessage(IOException e){
  if (e instanceof GoogleJsonResponseException) {
    GoogleJsonResponseException gjre=((GoogleJsonResponseException)e);
    if (gjre.getDetails() != null) {
      return gjre.getDetails().getMessage();
    }
  }
  return e.getMessage();
}

Fixed version (ground truth):
/** 
 * Extracts the error message. 
 */
public String getErrorMessage(IOException e){
  GoogleJsonResponseException gjre=getJsonResponseExceptionOrNull(e);
  if (gjre != null && gjre.getDetails() != null) {
    return gjre.getDetails().getMessage();
  }
  return e.getMessage();
}
Program: 79901
Project: 79901
Buggy source:
@Test public void testClose(){
  cache.putItem(ITEM_A_A);
  gcs.close();
  verify(gcsDelegate).close();
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.newArrayList());
}

Fixed version (ground truth):
@Test public void testClose(){
  cache.putItem(ITEM_A_A);
  gcs.close();
  verify(gcsDelegate).close();
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.<GoogleCloudStorageItemInfo>newArrayList());
}
Program: 79902
Project: 79902
Buggy source:
/** 
 * Test items can be removed. 
 */
@Test public void testRemoveItemNormal(){
  cache.putItem(ITEM_A_A);
  GoogleCloudStorageItemInfo actualItem=cache.removeItem(ITEM_A_A.getResourceId());
  assertEquals(actualItem,ITEM_A_A);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.newArrayList());
}

Fixed version (ground truth):
/** 
 * Test items can be removed. 
 */
@Test public void testRemoveItemNormal(){
  cache.putItem(ITEM_A_A);
  GoogleCloudStorageItemInfo actualItem=cache.removeItem(ITEM_A_A.getResourceId());
  assertEquals(actualItem,ITEM_A_A);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.<GoogleCloudStorageItemInfo>newArrayList());
}
Program: 79903
Project: 79903
Buggy source:
/** 
 * Test missing items cannot be removed. 
 */
@Test public void testRemoveItemMissing(){
  GoogleCloudStorageItemInfo actualItem=cache.removeItem(ITEM_A_AA.getResourceId());
  assertNull(actualItem);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.newArrayList());
}

Fixed version (ground truth):
/** 
 * Test missing items cannot be removed. 
 */
@Test public void testRemoveItemMissing(){
  GoogleCloudStorageItemInfo actualItem=cache.removeItem(ITEM_A_AA.getResourceId());
  assertNull(actualItem);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.<GoogleCloudStorageItemInfo>newArrayList());
}
Program: 79904
Project: 79904
Buggy source:
/** 
 * Test missing items cannot be retrieved. 
 */
@Test public void testGetItemMissing(){
  GoogleCloudStorageItemInfo actualItem=cache.getItem(ITEM_A_A.getResourceId());
  assertNull(actualItem);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.newArrayList());
}

Fixed version (ground truth):
/** 
 * Test missing items cannot be retrieved. 
 */
@Test public void testGetItemMissing(){
  GoogleCloudStorageItemInfo actualItem=cache.getItem(ITEM_A_A.getResourceId());
  assertNull(actualItem);
  assertContainsInAnyOrder(cache.getAllItemsRaw(),Lists.<GoogleCloudStorageItemInfo>newArrayList());
}