nus-yam/ex-repair huggingface dataset:
Program: 16906
Project: 16906
Buggy source:
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Long maxId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  Long sinceId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  return new SearchResults(tweets,maxId,sinceId,response.get("String_Node_Str") == null);
}

Fixed version (ground truth):
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Number maxId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  Number sinceId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  return new SearchResults(tweets,maxId.longValue(),sinceId.longValue(),response.get("String_Node_Str") == null);
}
Program: 16907
Project: 16907
Buggy source:
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}

Fixed version (ground truth):
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str",42);
  response.put("String_Node_Str",24);
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}
Program: 16908
Project: 16908
Buggy source:
/** 
 * Search commits between the given start commit id and end revision string.
 * @param start
 * @param end
 * @param filter
 * @return this service
 */
public CommitService walkBetween(ObjectId start,String end,RevFilter filter){
  for (  Repository repository : repositories)   searchBetween(start,lookup(repository,end),filter);
  return this;
}

Fixed version (ground truth):
/** 
 * Search commits between the given start commit id and end revision string.
 * @param start
 * @param end
 * @param filter
 * @return this service
 */
public CommitService walkBetween(ObjectId start,String end,RevFilter filter){
  for (  Repository repository : this)   searchBetween(start,lookup(repository,end),filter);
  return this;
}
Program: 16909
Project: 16909
Buggy source:
/** 
 * @param gitDir
 */
public CommitService(String gitDir){
  super(gitDir);
}

Fixed version (ground truth):
/** 
 * @param gitDirs
 */
public CommitService(String... gitDirs){
  super(gitDirs);
}
Program: 16910
Project: 16910
Buggy source:
/** 
 * Search commits starting from the given revision string.
 * @param start
 * @param filter
 * @return this service
 */
public CommitService searchFrom(String start,RevFilter filter){
  for (  Repository repository : repositories)   searchFrom(lookup(repository,start),filter);
  return this;
}

Fixed version (ground truth):
/** 
 * Search commits starting from the given revision string.
 * @param start
 * @param filter
 * @return this service
 */
public CommitService searchFrom(String start,RevFilter filter){
  for (  Repository repository : this)   walk(repository,null,lookup(repository,start),null,filter);
  return this;
}
Program: 16911
Project: 16911
Buggy source:
/** 
 * Search commits between the given start revision string and the given end revision string.
 * @param start
 * @param end
 * @param filter
 * @return this service
 */
public CommitService searchBetween(String start,String end,RevFilter filter){
  for (  Repository repository : repositories)   searchBetween(lookup(repository,start),lookup(repository,end),filter);
  return this;
}

Fixed version (ground truth):
/** 
 * Search commits between the given start revision string and the given end revision string.
 * @param start
 * @param end
 * @param filter
 * @return this service
 */
public CommitService searchBetween(String start,String end,RevFilter filter){
  for (  Repository repository : this)   searchBetween(lookup(repository,start),lookup(repository,end),filter);
  return this;
}
Program: 16912
Project: 16912
Buggy source:
/** 
 * Get an iterator over all repositories configured for this service. This iterator will always have at least one element.
 */
public Iterator<Repository> iterator(){
  return this.repositories.iterator();
}

Fixed version (ground truth):
/** 
 * Get an iterator over all repositories configured for this service. This iterator will always have at least one element.
 */
public final Iterator<Repository> iterator(){
  return this.repositories.iterator();
}
Program: 16913
Project: 16913
Buggy source:
/** 
 * Add file to test repository
 * @param path
 * @param content
 * @param message
 * @return commit
 * @throws Exception
 */
protected RevCommit add(String path,String content,String message) throws Exception {
  File file=new File(testRepo.getParentFile(),path);
  if (!file.getParentFile().exists())   assertTrue(file.getParentFile().mkdirs());
  if (!file.exists())   assertTrue(file.createNewFile());
  PrintWriter writer=new PrintWriter(file);
  if (content == null)   content="String_Node_Str";
  try {
    writer.print(content);
  }
  finally {
    writer.close();
  }
  Git git=Git.open(testRepo);
  git.add().addFilepattern(path).call();
  RevCommit commit=git.commit().setOnly(path).setMessage(message).setAuthor(author).setCommitter(committer).call();
  assertNotNull(commit);
  return commit;
}

Fixed version (ground truth):
/** 
 * Add file to test repository
 * @param repo
 * @param path
 * @param content
 * @param message
 * @return commit
 * @throws Exception
 */
protected RevCommit add(File repo,String path,String content,String message) throws Exception {
  File file=new File(repo.getParentFile(),path);
  if (!file.getParentFile().exists())   assertTrue(file.getParentFile().mkdirs());
  if (!file.exists())   assertTrue(file.createNewFile());
  PrintWriter writer=new PrintWriter(file);
  if (content == null)   content="String_Node_Str";
  try {
    writer.print(content);
  }
  finally {
    writer.close();
  }
  Git git=Git.open(repo);
  git.add().addFilepattern(path).call();
  RevCommit commit=git.commit().setOnly(path).setMessage(message).setAuthor(author).setCommitter(committer).call();
  assertNotNull(commit);
  return commit;
}
Program: 16914
Project: 16914
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  String tmpDir=System.getProperty("String_Node_Str");
  assertNotNull("String_Node_Str",tmpDir);
  File dir=new File(tmpDir,"String_Node_Str" + System.nanoTime());
  assertTrue(dir.mkdir());
  Git.init().setDirectory(dir).setBare(false).call();
  testRepo=new File(dir,Constants.DOT_GIT);
  testRepo.deleteOnExit();
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  testRepo=initRepo();
}
Program: 16915
Project: 16915
Buggy source:
/** 
 * Create branch with name and checkout
 * @param name
 * @return branch ref
 * @throws Exception
 */
protected Ref branch(String name) throws Exception {
  Git git=Git.open(testRepo);
  git.branchCreate().setName(name).call();
  Ref ref=git.checkout().setName(name).call();
  assertNotNull(ref);
  return ref;
}

Fixed version (ground truth):
/** 
 * Create branch with name and checkout
 * @param repo
 * @param name
 * @return branch ref
 * @throws Exception
 */
protected Ref branch(File repo,String name) throws Exception {
  Git git=Git.open(repo);
  git.branchCreate().setName(name).call();
  Ref ref=git.checkout().setName(name).call();
  assertNotNull(ref);
  return ref;
}
Program: 16916
Project: 16916
Buggy source:
public void reloadConfig(){
  boolean wasEnabled=isEnabled();
  if (wasEnabled)   setEnabled(false);
  for (  Arena a : arenas) {
    a.forceEnd();
  }
  plugin.reloadConfigFile();
  config=plugin.getConfig();
  initialize();
  if (wasEnabled)   setEnabled(true);
}

Fixed version (ground truth):
public void reloadConfig(){
  boolean wasEnabled=isEnabled();
  if (wasEnabled)   setEnabled(false);
  for (  Arena a : arenas) {
    a.forceEnd();
  }
  plugin.reloadConfig();
  config=plugin.getConfig();
  initialize();
  if (wasEnabled)   setEnabled(true);
}
Program: 16917
Project: 16917
Buggy source:
public void onEnable(){
  reloadConfigFile();
  loadAnnouncementsFile();
  loadAbilities();
  setupVault();
  setupMagicSpells();
  arenaMaster=new ArenaMasterImpl(this);
  arenaMaster.initialize();
  registerInventories();
  registerListeners();
  startMetrics();
  Messenger.info("String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
  if (getConfig().getBoolean("String_Node_Str",false)) {
    VersionChecker.checkForUpdates(this,null);
  }
}

Fixed version (ground truth):
public void onEnable(){
  configFile=new File(getDataFolder(),"String_Node_Str");
  config=new YamlConfiguration();
  reloadConfig();
  getConfig().options().header(getHeader());
  saveConfig();
  loadAnnouncementsFile();
  loadAbilities();
  setupVault();
  setupMagicSpells();
  arenaMaster=new ArenaMasterImpl(this);
  arenaMaster.initialize();
  registerInventories();
  registerListeners();
  startMetrics();
  Messenger.info("String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
  if (getConfig().getBoolean("String_Node_Str",false)) {
    VersionChecker.checkForUpdates(this,null);
  }
}
Program: 16918
Project: 16918
Buggy source:
@Override public boolean takeFee(Player p){
  if (entryFee.isEmpty())   return true;
  PlayerInventory inv=p.getInventory();
  for (  ItemStack stack : InventoryUtils.extractAll(MobArena.ECONOMY_MONEY_ID,entryFee)) {
    plugin.takeMoney(p,stack);
  }
  for (  ItemStack fee : entryFee) {
    int remaining=fee.getAmount();
    while (remaining > 0) {
      int slot=inv.first(fee.getType());
      ItemStack item=inv.getItem(slot);
      remaining-=item.getAmount();
      if (remaining >= 0) {
        inv.setItem(slot,null);
      }
 else {
        item.setAmount(-remaining);
        inv.setItem(slot,item);
      }
    }
  }
  Messenger.tell(p,Msg.JOIN_FEE_PAID.format(MAUtils.listToString(entryFee,plugin)));
  return true;
}

Fixed version (ground truth):
@Override public boolean takeFee(Player p){
  if (entryFee.isEmpty())   return true;
  PlayerInventory inv=p.getInventory();
  for (  ItemStack stack : InventoryUtils.extractAll(MobArena.ECONOMY_MONEY_ID,entryFee)) {
    plugin.takeMoney(p,stack);
  }
  for (  ItemStack fee : entryFee) {
    if (fee.getTypeId() < 0)     continue;
    int remaining=fee.getAmount();
    while (remaining > 0) {
      int slot=inv.first(fee.getType());
      if (slot < 0)       break;
      ItemStack item=inv.getItem(slot);
      remaining-=item.getAmount();
      if (remaining >= 0) {
        inv.setItem(slot,null);
      }
 else {
        item.setAmount(-remaining);
        inv.setItem(slot,item);
      }
    }
  }
  Messenger.tell(p,Msg.JOIN_FEE_PAID.format(MAUtils.listToString(entryFee,plugin)));
  return true;
}
Program: 16919
Project: 16919
Buggy source:
@Override public boolean takeFee(Player p){
  if (entryFee.isEmpty())   return true;
  PlayerInventory inv=p.getInventory();
  for (  ItemStack stack : InventoryUtils.extractAll(MobArena.ECONOMY_MONEY_ID,entryFee)) {
    plugin.takeMoney(p,stack);
  }
  for (  ItemStack stack : entryFee) {
    inv.removeItem(stack);
  }
  Messenger.tell(p,Msg.JOIN_FEE_PAID.format(MAUtils.listToString(entryFee,plugin)));
  return true;
}

Fixed version (ground truth):
@Override public boolean takeFee(Player p){
  if (entryFee.isEmpty())   return true;
  PlayerInventory inv=p.getInventory();
  for (  ItemStack stack : InventoryUtils.extractAll(MobArena.ECONOMY_MONEY_ID,entryFee)) {
    plugin.takeMoney(p,stack);
  }
  for (  ItemStack fee : entryFee) {
    int remaining=fee.getAmount();
    while (remaining > 0) {
      int slot=inv.first(fee.getType());
      ItemStack item=inv.getItem(slot);
      remaining-=item.getAmount();
      if (remaining >= 0) {
        inv.setItem(slot,null);
      }
 else {
        item.setAmount(-remaining);
        inv.setItem(slot,item);
      }
    }
  }
  Messenger.tell(p,Msg.JOIN_FEE_PAID.format(MAUtils.listToString(entryFee,plugin)));
  return true;
}
Program: 16920
Project: 16920
Buggy source:
public void expandP1(int x,int z){
  Location l=new Location(p1.getWorld(),p1.getX() - x,p1.getY(),p1.getZ() - z);
  setLocation(coords,"String_Node_Str",l);
  save();
  reloadRegion();
}

Fixed version (ground truth):
public void expandP1(int dx,int dz){
  int x=p1.getBlockX() - dx;
  int y=p1.getBlockY();
  int z=p1.getBlockZ() - dz;
  setSaveReload(coords,"String_Node_Str",p1.getWorld(),x,y,z);
}
Program: 16921
Project: 16921
Buggy source:
public void expandL1(int x,int z){
  l1.setX(l1.getX() - x);
  l1.setZ(l1.getZ() - z);
  set(RegionPoint.L1,l1);
}

Fixed version (ground truth):
public void expandL1(int dx,int dz){
  int x=l1.getBlockX() - dx;
  int y=l1.getBlockY();
  int z=l1.getBlockZ() - dz;
  setSaveReload(coords,"String_Node_Str",l1.getWorld(),x,y,z);
}
Program: 16922
Project: 16922
Buggy source:
public void expandP2(int x,int z){
  Location l=new Location(p2.getWorld(),p2.getX() + x,p2.getY(),p2.getZ() + z);
  setLocation(coords,"String_Node_Str",l);
  save();
  reloadRegion();
}

Fixed version (ground truth):
public void expandP2(int dx,int dz){
  int x=p2.getBlockX() + dx;
  int y=p2.getBlockY();
  int z=p2.getBlockZ() + dz;
  setSaveReload(coords,"String_Node_Str",p2.getWorld(),x,y,z);
}
Program: 16923
Project: 16923
Buggy source:
public void expandLobbyUp(int amount){
  l2.setY(Math.min(arena.getWorld().getMaxHeight(),l2.getY() + amount));
  set(RegionPoint.L2,l2);
}

Fixed version (ground truth):
public void expandLobbyUp(int amount){
  int x=l2.getBlockX();
  int y=Math.min(l2.getWorld().getMaxHeight(),l2.getBlockY() + amount);
  int z=l2.getBlockZ();
  setSaveReload(coords,"String_Node_Str",l2.getWorld(),x,y,z);
}
Program: 16924
Project: 16924
Buggy source:
public void expandLobbyDown(int amount){
  l1.setY(Math.max(0D,l1.getY() + amount));
  set(RegionPoint.L1,l1);
}

Fixed version (ground truth):
public void expandLobbyDown(int amount){
  int x=l1.getBlockX();
  int y=Math.max(0,l1.getBlockY() - amount);
  int z=l1.getBlockZ();
  setSaveReload(coords,"String_Node_Str",l1.getWorld(),x,y,z);
}
Program: 16925
Project: 16925
Buggy source:
public void expandUp(int amount){
  Location l=new Location(p2.getWorld(),p2.getX(),Math.min(p2.getWorld().getMaxHeight(),p2.getY() + amount),p2.getZ());
  setLocation(coords,"String_Node_Str",l);
  save();
  reloadRegion();
}

Fixed version (ground truth):
public void expandUp(int amount){
  int x=p2.getBlockX();
  int y=Math.min(p2.getWorld().getMaxHeight(),p2.getBlockY() + amount);
  int z=p2.getBlockZ();
  setSaveReload(coords,"String_Node_Str",p2.getWorld(),x,y,z);
}
Program: 16926
Project: 16926
Buggy source:
public void expandL2(int x,int z){
  l2.setX(l2.getX() + x);
  l2.setZ(l2.getZ() + z);
  set(RegionPoint.L2,l2);
}

Fixed version (ground truth):
public void expandL2(int dx,int dz){
  int x=l2.getBlockX() + dx;
  int y=l2.getBlockY();
  int z=l2.getBlockZ() + dz;
  setSaveReload(coords,"String_Node_Str",l2.getWorld(),x,y,z);
}
Program: 16927
Project: 16927
Buggy source:
public void expandDown(int amount){
  Location l=new Location(p1.getWorld(),p1.getX(),Math.max(0D,p1.getY() - amount),p1.getZ());
  setLocation(coords,"String_Node_Str",l);
  save();
  reloadRegion();
}

Fixed version (ground truth):
public void expandDown(int amount){
  int x=p1.getBlockX();
  int y=Math.max(0,p1.getBlockY() - amount);
  int z=p1.getBlockZ();
  setSaveReload(coords,"String_Node_Str",p1.getWorld(),x,y,z);
}
Program: 16928
Project: 16928
Buggy source:
/** 
 * DAMAGE LISTENERS
 */
public void onEntityDamage(EntityDamageEvent event){
  Entity damagee=event.getEntity();
  if (!arena.isRunning() || !arena.getRegion().contains(damagee.getLocation())) {
    return;
  }
  EntityDamageByEntityEvent edbe=(event instanceof EntityDamageByEntityEvent) ? (EntityDamageByEntityEvent)event : null;
  Entity damager=null;
  if (edbe != null) {
    damager=edbe.getDamager();
    if (damager instanceof Projectile) {
      damager=((Projectile)damager).getShooter();
    }
    if (damager instanceof Player) {
      repairWeapon((Player)damager);
    }
 else     if (damager instanceof TNTPrimed) {
      damager=getPlanter(damager);
    }
  }
  if (damagee instanceof Wolf && arena.hasPet(damagee)) {
    onPetDamage(event,(Wolf)damagee,damager);
  }
 else   if (damagee instanceof Player) {
    onPlayerDamage(event,(Player)damagee,damager);
  }
 else   if (damagee instanceof Snowman && event.getCause() == DamageCause.MELTING) {
    event.setCancelled(true);
  }
 else   if (monsters.getMonsters().contains(damagee)) {
    onMonsterDamage(event,damagee,damager);
  }
 else   if (monsters.getGolems().contains(damagee)) {
    onGolemDamage(event,damagee,damager);
  }
}

Fixed version (ground truth):
/** 
 * DAMAGE LISTENERS
 */
public void onEntityDamage(EntityDamageEvent event){
  Entity damagee=event.getEntity();
  if (!arena.isRunning() && !arena.getRegion().contains(damagee.getLocation())) {
    return;
  }
  EntityDamageByEntityEvent edbe=(event instanceof EntityDamageByEntityEvent) ? (EntityDamageByEntityEvent)event : null;
  Entity damager=null;
  if (edbe != null) {
    damager=edbe.getDamager();
    if (damager instanceof Projectile) {
      damager=((Projectile)damager).getShooter();
    }
    if (damager instanceof Player) {
      repairWeapon((Player)damager);
    }
 else     if (damager instanceof TNTPrimed) {
      damager=getPlanter(damager);
    }
  }
  if (damagee instanceof Wolf && arena.hasPet(damagee)) {
    onPetDamage(event,(Wolf)damagee,damager);
  }
 else   if (damagee instanceof Player) {
    onPlayerDamage(event,(Player)damagee,damager);
  }
 else   if (damagee instanceof Snowman && event.getCause() == DamageCause.MELTING) {
    event.setCancelled(true);
  }
 else   if (monsters.getMonsters().contains(damagee)) {
    onMonsterDamage(event,damagee,damager);
  }
 else   if (monsters.getGolems().contains(damagee)) {
    onGolemDamage(event,damagee,damager);
  }
}
Program: 16929
Project: 16929
Buggy source:
public void onEnable(){
  FileUtils.extractResource(this.getDataFolder(),"String_Node_Str");
  loadConfigFile();
  loadAbilities();
  setupVault();
  setupHeroes();
  setupSpout();
  setupMagicSpells();
  setupStrategies();
  arenaMaster=new ArenaMasterImpl(this);
  arenaMaster.initialize();
  registerInventories();
  MAMessages.init(this);
  registerListeners();
  startMetrics();
  Messenger.info("String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
  if (config.getBoolean("String_Node_Str",false)) {
    VersionChecker.checkForUpdates(this,null);
  }
}

Fixed version (ground truth):
public void onEnable(){
  FileUtils.extractResource(this.getDataFolder(),"String_Node_Str",getClass());
  loadConfigFile();
  loadAbilities();
  setupVault();
  setupHeroes();
  setupSpout();
  setupMagicSpells();
  setupStrategies();
  arenaMaster=new ArenaMasterImpl(this);
  arenaMaster.initialize();
  registerInventories();
  MAMessages.init(this);
  registerListeners();
  startMetrics();
  Messenger.info("String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
  if (config.getBoolean("String_Node_Str",false)) {
    VersionChecker.checkForUpdates(this,null);
  }
}
Program: 16930
Project: 16930
Buggy source:
private void loadAbilities(){
  File dir=new File(this.getDataFolder(),"String_Node_Str");
  if (!dir.exists())   dir.mkdir();
  AbilityManager.loadAbilities(dir);
}

Fixed version (ground truth):
private void loadAbilities(){
  File dir=new File(this.getDataFolder(),"String_Node_Str");
  if (!dir.exists())   dir.mkdir();
  AbilityManager.loadAbilities(dir,getClass());
}
Program: 16931
Project: 16931
Buggy source:
public MagicSpellsListener(MobArena plugin){
  this.plugin=plugin;
  File spellFile=FileUtils.extractResource(plugin.getDataFolder(),"String_Node_Str");
  Config spellConfig=new Config(spellFile);
  spellConfig.load();
  setupSpells(spellConfig);
}

Fixed version (ground truth):
public MagicSpellsListener(MobArena plugin){
  this.plugin=plugin;
  File spellFile=FileUtils.extractResource(plugin.getDataFolder(),"String_Node_Str",plugin.getClass());
  Config spellConfig=new Config(spellFile);
  spellConfig.load();
  setupSpells(spellConfig);
}
Program: 16932
Project: 16932
Buggy source:
/** 
 * Extracts all of the given resources to the given directory. Convenience method, used if one is too lazy to create a new list for the resource names.
 * @param dir a directory
 * @param resources an array of resources to extract
 * @return a list of all the files that were written
 */
public static List<File> extractResources(File dir,String... resources){
  return extractResources(dir,Arrays.asList(resources));
}

Fixed version (ground truth):
public static List<File> extractResources(File dir,String path,List<String> filenames,Class<?> cls){
  List<File> files=new ArrayList<File>();
  if (!path.equals("String_Node_Str")) {
    if (path.startsWith("String_Node_Str")) {
      path=path.substring(1);
    }
    if (!path.endsWith("String_Node_Str")) {
      path=path + "String_Node_Str";
    }
  }
  for (  String filename : filenames) {
    File file=extractResource(dir,path + filename,cls);
    if (file != null) {
      files.add(file);
    }
  }
  return files;
}
Program: 16933
Project: 16933
Buggy source:
/** 
 * Extracts the given resource to the given directory.
 * @param dir a directory
 * @param resource a resource to extract
 * @return the file that was written, or null
 */
public static File extractResource(File dir,String resource){
  if (!dir.exists())   dir.mkdirs();
  String filename=getFilename(resource);
  File file=new File(dir,filename);
  if (file.exists())   return file;
  InputStream in=MobArena.class.getResourceAsStream("String_Node_Str" + resource);
  if (in == null)   return null;
  try {
    FileOutputStream out=new FileOutputStream(file);
    byte[] buffer=new byte[4096];
    int read=0;
    while ((read=in.read(buffer)) > 0) {
      out.write(buffer,0,read);
    }
    in.close();
    out.close();
    return file;
  }
 catch (  Exception e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Extracts the given resource to the given directory.
 * @param dir a directory
 * @param resource a resource to extract
 * @return the file that was written, or null
 */
public static File extractResource(File dir,String resource,Class<?> cls){
  if (!dir.exists())   dir.mkdirs();
  String filename=getFilename(resource);
  File file=new File(dir,filename);
  if (file.exists())   return file;
  InputStream in=cls.getResourceAsStream("String_Node_Str" + resource);
  if (in == null)   return null;
  try {
    FileOutputStream out=new FileOutputStream(file);
    byte[] buffer=new byte[4096];
    int read=0;
    while ((read=in.read(buffer)) > 0) {
      out.write(buffer,0,read);
    }
    in.close();
    out.close();
    return file;
  }
 catch (  Exception e) {
  }
  return null;
}
Program: 16934
Project: 16934
Buggy source:
public static YamlConfiguration getConfig(MobArena plugin,String filename){
  InputStream in=MobArena.class.getResourceAsStream("String_Node_Str" + filename);
  if (in == null) {
    Messenger.severe("String_Node_Str" + filename + "String_Node_Str");
    return null;
  }
  try {
    YamlConfiguration result=new YamlConfiguration();
    result.load(in);
    return result;
  }
 catch (  Exception e) {
    e.printStackTrace();
    Messenger.warning("String_Node_Str" + filename + "String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public static YamlConfiguration getConfig(MobArena plugin,String filename,Class<?> cls){
  InputStream in=cls.getResourceAsStream("String_Node_Str" + filename);
  if (in == null) {
    Messenger.severe("String_Node_Str" + filename + "String_Node_Str");
    return null;
  }
  try {
    YamlConfiguration result=new YamlConfiguration();
    result.load(in);
    return result;
  }
 catch (  Exception e) {
    e.printStackTrace();
    Messenger.warning("String_Node_Str" + filename + "String_Node_Str");
  }
  return null;
}
Program: 16935
Project: 16935
Buggy source:
/** 
 * Load the known abilities as well as all custom abilities from the specified directory.
 * @param dir a directory of .class (and/or .java) files
 */
public static void loadAbilities(File classDir){
  abilities=new HashMap<String,Ability>();
  File javaDir=new File(classDir,"String_Node_Str");
  if (javaDir.exists()) {
    if (ToolProvider.getSystemJavaCompiler() != null) {
      compileAbilities(javaDir,classDir);
    }
 else {
      Messenger.warning("String_Node_Str");
    }
  }
  String[] files=classDir.list();
  if (files.length == 0 || (files.length == 1 && files[0].equals("String_Node_Str"))) {
    Messenger.info("String_Node_Str");
    extractDefaultAbilities(classDir);
  }
  loadClasses(classDir);
}

Fixed version (ground truth):
/** 
 * Load the known abilities as well as all custom abilities from the specified directory.
 * @param dir a directory of .class (and/or .java) files
 */
public static void loadAbilities(File classDir,Class<?> cls){
  abilities=new HashMap<String,Ability>();
  File javaDir=new File(classDir,"String_Node_Str");
  if (javaDir.exists()) {
    if (ToolProvider.getSystemJavaCompiler() != null) {
      compileAbilities(javaDir,classDir);
    }
 else {
      Messenger.warning("String_Node_Str");
    }
  }
  String[] files=classDir.list();
  if (files.length == 0 || (files.length == 1 && files[0].equals("String_Node_Str"))) {
    Messenger.info("String_Node_Str");
    extractDefaultAbilities(classDir,cls);
  }
  loadClasses(classDir);
}
Program: 16936
Project: 16936
Buggy source:
private static void extractDefaultAbilities(File classDir){
  List<String> resources=FileUtils.listFilesOnPath("String_Node_Str","String_Node_Str");
  if (resources == null || resources.isEmpty()) {
    Messenger.severe("String_Node_Str");
    return;
  }
  List<File> files=FileUtils.extractResources(classDir,"String_Node_Str",resources);
  Messenger.info("String_Node_Str" + fileListToString(files,"String_Node_Str"));
}

Fixed version (ground truth):
private static void extractDefaultAbilities(File classDir,Class<?> cls){
  List<String> resources=FileUtils.listFilesOnPath("String_Node_Str","String_Node_Str");
  if (resources == null || resources.isEmpty()) {
    Messenger.severe("String_Node_Str");
    return;
  }
  List<File> files=FileUtils.extractResources(classDir,"String_Node_Str",resources,cls);
  Messenger.info("String_Node_Str" + fileListToString(files,"String_Node_Str"));
}
Program: 16937
Project: 16937
Buggy source:
/** 
 * Load all arena-related stuff.
 */
public void loadArenas(){
  Set<String> arenanames=config.getKeys("String_Node_Str");
  if (arenanames == null || arenanames.isEmpty()) {
    createArenaNode("String_Node_Str",plugin.getServer().getWorlds().get(0));
  }
  arenas=new LinkedList<Arena>();
  for (  World w : Bukkit.getServer().getWorlds()) {
    loadArenasInWorld(w.getName());
  }
}

Fixed version (ground truth):
/** 
 * Load all arena-related stuff.
 */
public void loadArenas(){
  Set<String> arenanames=config.getKeys("String_Node_Str");
  if (arenanames == null || arenanames.isEmpty()) {
    createArenaNode("String_Node_Str",plugin.getServer().getWorlds().get(0),false);
  }
  arenas=new LinkedList<Arena>();
  for (  World w : Bukkit.getServer().getWorlds()) {
    loadArenasInWorld(w.getName());
  }
}
Program: 16938
Project: 16938
Buggy source:
public Arena createArenaNode(String arenaName,World world){
  String path="String_Node_Str" + arenaName;
  if (config.getConfigSection(path) != null)   throw new IllegalArgumentException("String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.set(path + "String_Node_Str",world.getName());
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.save();
  return loadArena(arenaName);
}

Fixed version (ground truth):
private Arena createArenaNode(String arenaName,World world,boolean load){
  String path="String_Node_Str" + arenaName;
  if (config.getConfigSection(path) != null)   throw new IllegalArgumentException("String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.set(path + "String_Node_Str",world.getName());
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.save();
  return (load ? loadArena(arenaName) : null);
}
Program: 16939
Project: 16939
Buggy source:
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  if (!Commands.isPlayer(sender)) {
    Messenger.tellPlayer(sender,Msg.MISC_NOT_FROM_CONSOLE);
    return false;
  }
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  Player p=(Player)sender;
  if (!arg1.matches("String_Node_Str")) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return true;
  }
  am.getSelectedArena().getRegion().addSpawn(arg1,p.getLocation());
  Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  if (!Commands.isPlayer(sender)) {
    Messenger.tellPlayer(sender,Msg.MISC_NOT_FROM_CONSOLE);
    return false;
  }
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  Player p=(Player)sender;
  if (!arg1.matches("String_Node_Str")) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return true;
  }
  if (am.getSelectedArena().getRegion().contains(p.getLocation())) {
    am.getSelectedArena().getRegion().addSpawn(arg1,p.getLocation());
    Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
  }
 else {
    if (am.getSelectedArena().getRegion().isDefined()) {
      Messenger.tellPlayer(sender,"String_Node_Str");
    }
 else {
      Messenger.tellPlayer(sender,"String_Node_Str");
    }
  }
  return true;
}
Program: 16940
Project: 16940
Buggy source:
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  if (!arg1.matches("String_Node_Str")) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return false;
  }
  if (am.getSelectedArena().getRegion().removeSpawn(arg1))   Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
 else   Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  if (!arg1.matches("String_Node_Str")) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return false;
  }
  if (am.getSelectedArena().getRegion().removeChest(arg1))   Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
 else   Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
  return true;
}
Program: 16941
Project: 16941
Buggy source:
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  if (!Commands.isPlayer(sender)) {
    Messenger.tellPlayer(sender,Msg.MISC_NOT_FROM_CONSOLE);
    return false;
  }
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  Player p=(Player)sender;
  if (!(arg1.equals("String_Node_Str") || arg1.equals("String_Node_Str") || arg1.equals("String_Node_Str"))) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return true;
  }
  am.getSelectedArena().getRegion().set(arg1,p.getLocation());
  Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
  Messenger.tellPlayer(sender,"String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(ArenaMaster am,CommandSender sender,String... args){
  if (!Commands.isPlayer(sender)) {
    Messenger.tellPlayer(sender,Msg.MISC_NOT_FROM_CONSOLE);
    return false;
  }
  String arg1=(args.length > 0 ? args[0] : "String_Node_Str");
  Player p=(Player)sender;
  if (!(arg1.equals("String_Node_Str") || arg1.equals("String_Node_Str") || arg1.equals("String_Node_Str"))) {
    Messenger.tellPlayer(sender,"String_Node_Str");
    return true;
  }
  if (arg1.equals("String_Node_Str") && !am.getSelectedArena().getRegion().contains(p.getLocation())) {
    if (am.getSelectedArena().getRegion().isDefined()) {
      Messenger.tellPlayer(sender,"String_Node_Str");
    }
 else {
      Messenger.tellPlayer(sender,"String_Node_Str");
    }
  }
 else {
    am.getSelectedArena().getRegion().set(arg1,p.getLocation());
    Messenger.tellPlayer(sender,"String_Node_Str" + arg1 + "String_Node_Str"+ am.getSelectedArena().configName()+ "String_Node_Str");
    Messenger.tellPlayer(sender,"String_Node_Str");
  }
  return true;
}
Program: 16942
Project: 16942
Buggy source:
public void reloadRegion(){
  p1=coords.getLocation("String_Node_Str",world);
  p2=coords.getLocation("String_Node_Str",world);
  l1=coords.getLocation("String_Node_Str",world);
  l2=coords.getLocation("String_Node_Str",world);
}

Fixed version (ground truth):
public void reloadRegion(){
  p1=coords.getLocation("String_Node_Str",world);
  p2=coords.getLocation("String_Node_Str",world);
  fixRegion();
  l1=coords.getLocation("String_Node_Str",world);
  l2=coords.getLocation("String_Node_Str",world);
  fixLobbyRegion();
}
Program: 16943
Project: 16943
Buggy source:
public boolean removeSpawn(String name){
  if (spawns.getString(name) == null) {
    return false;
  }
  spawns.set(name,null);
  reloadSpawnpoints();
  verifyData();
  save();
  return true;
}

Fixed version (ground truth):
public boolean removeSpawn(String name){
  if (spawns.getString(name) == null) {
    return false;
  }
  spawns.set(name,null);
  save();
  reloadSpawnpoints();
  verifyData();
  return true;
}
Program: 16944
Project: 16944
Buggy source:
private void fix(String location1,String location2){
  Location loc1=coords.getLocation(location1,world);
  Location loc2=coords.getLocation(location2,world);
  if (loc1 == null || loc2 == null) {
    return;
  }
  if (loc1.getX() > loc2.getX()) {
    double tmp=loc1.getX();
    loc1.setX(loc2.getX());
    loc2.setX(tmp);
  }
  if (loc1.getZ() > loc2.getZ()) {
    double tmp=loc1.getZ();
    loc1.setZ(loc2.getZ());
    loc2.setZ(tmp);
  }
  if (loc1.getY() > loc2.getY()) {
    double tmp=loc1.getY();
    loc1.setY(loc2.getY());
    loc2.setY(tmp);
  }
  if (!arena.getWorld().getName().equals(world.getName()))   arena.setWorld(world);
  coords.set(location1,loc1);
  coords.set(location2,loc2);
}

Fixed version (ground truth):
private void fix(String location1,String location2){
  Location loc1=coords.getLocation(location1,world);
  Location loc2=coords.getLocation(location2,world);
  if (loc1 == null || loc2 == null) {
    return;
  }
  boolean modified=false;
  if (loc1.getX() > loc2.getX()) {
    double tmp=loc1.getX();
    loc1.setX(loc2.getX());
    loc2.setX(tmp);
    modified=true;
  }
  if (loc1.getZ() > loc2.getZ()) {
    double tmp=loc1.getZ();
    loc1.setZ(loc2.getZ());
    loc2.setZ(tmp);
    modified=true;
  }
  if (loc1.getY() > loc2.getY()) {
    double tmp=loc1.getY();
    loc1.setY(loc2.getY());
    loc2.setY(tmp);
    modified=true;
  }
  if (!arena.getWorld().getName().equals(world.getName())) {
    arena.setWorld(world);
    modified=true;
  }
  if (!modified) {
    return;
  }
  coords.set(location1,loc1);
  coords.set(location2,loc2);
}
Program: 16945
Project: 16945
Buggy source:
public void addChest(String name,Location loc){
  chests.set(name,loc);
  reloadChests();
  save();
}

Fixed version (ground truth):
public void addChest(String name,Location loc){
  chests.set(name,loc);
  save();
  reloadChests();
}
Program: 16946
Project: 16946
Buggy source:
public boolean removeChest(String name){
  if (chests.getString(name) == null) {
    return false;
  }
  chests.set(name,null);
  reloadChests();
  save();
  return true;
}

Fixed version (ground truth):
public boolean removeChest(String name){
  if (chests.getString(name) == null) {
    return false;
  }
  chests.set(name,null);
  save();
  reloadChests();
  return true;
}
Program: 16947
Project: 16947
Buggy source:
public boolean contains(Location l,int radius){
  if (!l.getWorld().getName().equals(world.getName()) || !setup) {
    return false;
  }
  int x=l.getBlockX();
  int y=l.getBlockY();
  int z=l.getBlockZ();
  if (lobbySetup) {
    if ((x + radius >= l1.getBlockX() && x - radius <= l2.getBlockX()) && (z + radius >= l1.getBlockZ() && z - radius <= l2.getBlockZ()) && (y + radius >= l1.getBlockY() && y - radius <= l2.getBlockY()))     return true;
  }
  return ((x + radius >= p1.getBlockX() && x - radius <= p2.getBlockX()) && (z + radius >= p1.getBlockZ() && z - radius <= p2.getBlockZ()) && (y + radius >= p1.getBlockY() && y - radius <= p2.getBlockY()));
}

Fixed version (ground truth):
public boolean contains(Location l,int radius){
  if (!l.getWorld().getName().equals(world.getName()) || !isDefined()) {
    return false;
  }
  int x=l.getBlockX();
  int y=l.getBlockY();
  int z=l.getBlockZ();
  if (lobbySetup) {
    if ((x + radius >= l1.getBlockX() && x - radius <= l2.getBlockX()) && (z + radius >= l1.getBlockZ() && z - radius <= l2.getBlockZ()) && (y + radius >= l1.getBlockY() && y - radius <= l2.getBlockY()))     return true;
  }
  return ((x + radius >= p1.getBlockX() && x - radius <= p2.getBlockX()) && (z + radius >= p1.getBlockZ() && z - radius <= p2.getBlockZ()) && (y + radius >= p1.getBlockY() && y - radius <= p2.getBlockY()));
}
Program: 16948
Project: 16948
Buggy source:
public ArenaRegion(ConfigSection coords,Arena arena){
  this.arena=arena;
  this.world=arena.getWorld();
  this.coords=coords;
  this.spawns=coords.getConfigSection("String_Node_Str");
  this.chests=coords.getConfigSection("String_Node_Str");
  reloadAll();
  adjustRegion();
}

Fixed version (ground truth):
public ArenaRegion(ConfigSection coords,Arena arena){
  this.arena=arena;
  this.world=arena.getWorld();
  this.coords=coords;
  this.spawns=coords.getConfigSection("String_Node_Str");
  this.chests=coords.getConfigSection("String_Node_Str");
  reloadAll();
}
Program: 16949
Project: 16949
Buggy source:
public void set(String point,Location loc){
  coords.set(point,loc);
  if (point.equals("String_Node_Str") || point.equals("String_Node_Str") || point.equals("String_Node_Str")) {
    readjustRegion(loc);
  }
  fixRegion();
  fixLobbyRegion();
  reloadRegion();
  reloadWarps();
  reloadLeaderboards();
  verifyData();
  save();
}

Fixed version (ground truth):
public void set(String point,Location loc){
  coords.set(point,loc);
  save();
  reloadRegion();
  reloadWarps();
  reloadLeaderboards();
  verifyData();
}
Program: 16950
Project: 16950
Buggy source:
public void addSpawn(String name,Location loc){
  spawns.set(name,loc);
  readjustRegion(loc);
  reloadSpawnpoints();
  verifyData();
  save();
}

Fixed version (ground truth):
public void addSpawn(String name,Location loc){
  spawns.set(name,loc);
  save();
  reloadSpawnpoints();
  verifyData();
}
Program: 16951
Project: 16951
Buggy source:
/** 
 * Load the global settings.
 */
public void loadSettings(){
  ConfigUtils.replaceAllNodes(plugin,config,"String_Node_Str","String_Node_Str");
  ConfigSection section=config.getConfigSection("String_Node_Str");
  String cmds=section.getString("String_Node_Str","String_Node_Str");
  String[] parts=cmds.split("String_Node_Str");
  allowedCommands.add("String_Node_Str");
  for (  String part : parts) {
    allowedCommands.add(part.trim().toLowerCase());
  }
}

Fixed version (ground truth):
/** 
 * Load the global settings.
 */
public void loadSettings(){
  ConfigUtils.replaceAllNodes(config,"String_Node_Str","String_Node_Str");
  ConfigSection section=config.getConfigSection("String_Node_Str");
  String cmds=section.getString("String_Node_Str","String_Node_Str");
  String[] parts=cmds.split("String_Node_Str");
  allowedCommands.add("String_Node_Str");
  for (  String part : parts) {
    allowedCommands.add(part.trim().toLowerCase());
  }
}
Program: 16952
Project: 16952
Buggy source:
/** 
 * Loads the classes in res/classes.yml into the config-file.
 */
public void loadDefaultClasses(){
  ConfigUtils.addMissingNodes(plugin,config,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Loads the classes in res/classes.yml into the config-file.
 */
public void loadDefaultClasses(){
  ConfigUtils.addMissingNodes(config,"String_Node_Str","String_Node_Str");
}
Program: 16953
Project: 16953
Buggy source:
private Arena loadArena(String arenaname){
  String path="String_Node_Str" + arenaname;
  String worldName=config.getString(path + "String_Node_Str","String_Node_Str");
  World world=null;
  if (!worldName.equals("String_Node_Str")) {
    world=plugin.getServer().getWorld(worldName);
    if (world == null) {
      Messenger.warning("String_Node_Str" + worldName + "String_Node_Str"+ arenaname+ "String_Node_Str");
      return null;
    }
  }
 else {
    world=plugin.getServer().getWorlds().get(0);
    Messenger.warning("String_Node_Str" + arenaname + "String_Node_Str"+ world.getName()+ "String_Node_Str");
  }
  ConfigUtils.replaceAllNodes(plugin,config,path + "String_Node_Str","String_Node_Str");
  Arena arena=new ArenaImpl(plugin,config,arenaname,world);
  registerPermission("String_Node_Str" + arenaname.toLowerCase(),PermissionDefault.TRUE);
  if (selectedArena == null) {
    selectedArena=arena;
  }
  arenas.add(arena);
  Messenger.info("String_Node_Str" + arenaname + "String_Node_Str");
  return arena;
}

Fixed version (ground truth):
private Arena loadArena(String arenaname){
  String path="String_Node_Str" + arenaname;
  String worldName=config.getString(path + "String_Node_Str","String_Node_Str");
  World world=null;
  if (!worldName.equals("String_Node_Str")) {
    world=plugin.getServer().getWorld(worldName);
    if (world == null) {
      Messenger.warning("String_Node_Str" + worldName + "String_Node_Str"+ arenaname+ "String_Node_Str");
      return null;
    }
  }
 else {
    world=plugin.getServer().getWorlds().get(0);
    Messenger.warning("String_Node_Str" + arenaname + "String_Node_Str"+ world.getName()+ "String_Node_Str");
  }
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  Arena arena=new ArenaImpl(plugin,config,arenaname,world);
  registerPermission("String_Node_Str" + arenaname.toLowerCase(),PermissionDefault.TRUE);
  if (selectedArena == null) {
    selectedArena=arena;
  }
  arenas.add(arena);
  Messenger.info("String_Node_Str" + arenaname + "String_Node_Str");
  return arena;
}
Program: 16954
Project: 16954
Buggy source:
public Arena createArenaNode(String arenaName,World world){
  String path="String_Node_Str" + arenaName;
  if (config.getConfigSection(path) != null)   throw new IllegalArgumentException("String_Node_Str");
  ConfigUtils.replaceAllNodes(plugin,config,path + "String_Node_Str","String_Node_Str");
  config.set(path + "String_Node_Str",world.getName());
  ConfigUtils.replaceAllNodes(plugin,config,path + "String_Node_Str","String_Node_Str");
  ConfigUtils.replaceAllNodes(plugin,config,path + "String_Node_Str","String_Node_Str");
  config.save();
  return loadArena(arenaName);
}

Fixed version (ground truth):
public Arena createArenaNode(String arenaName,World world){
  String path="String_Node_Str" + arenaName;
  if (config.getConfigSection(path) != null)   throw new IllegalArgumentException("String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.set(path + "String_Node_Str",world.getName());
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  ConfigUtils.replaceAllNodes(config,path + "String_Node_Str","String_Node_Str");
  config.save();
  return loadArena(arenaName);
}
Program: 16955
Project: 16955
Buggy source:
private void updateSettings(Config config){
  Set<String> arenas=config.getKeys("String_Node_Str");
  if (arenas == null)   return;
  for (  String arena : arenas) {
    String path="String_Node_Str" + arena + "String_Node_Str";
    ConfigUtils.replaceAllNodes(this,config,path,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void updateSettings(Config config){
  Set<String> arenas=config.getKeys("String_Node_Str");
  if (arenas == null)   return;
  for (  String arena : arenas) {
    String path="String_Node_Str" + arena + "String_Node_Str";
    ConfigUtils.replaceAllNodes(config,path,"String_Node_Str");
  }
}
Program: 16956
Project: 16956
Buggy source:
public static YamlConfiguration getConfig(MobArena plugin,String filename,Class<?> cls){
  InputStream in=cls.getResourceAsStream("String_Node_Str" + filename);
  if (in == null) {
    Messenger.severe("String_Node_Str" + filename + "String_Node_Str");
    return null;
  }
  try {
    YamlConfiguration result=new YamlConfiguration();
    result.load(in);
    return result;
  }
 catch (  Exception e) {
    e.printStackTrace();
    Messenger.warning("String_Node_Str" + filename + "String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get a YamlConfiguration of a given resource.
 * @param filename the name of the resource
 * @return a YamlConfiguration for the given resource
 * @throws IOException if the resource does not exist
 * @throws InvalidConfigurationException if the resource is not a valid config
 */
public static YamlConfiguration getConfig(String filename) throws IOException, InvalidConfigurationException {
  ZipFile zip=new ZipFile(JAR);
  ZipEntry entry=zip.getEntry(RES + filename);
  YamlConfiguration yaml=new YamlConfiguration();
  yaml.load(zip.getInputStream(entry));
  return yaml;
}
Program: 16957
Project: 16957
Buggy source:
public static void replaceAllNodes(MobArena plugin,Config config,String path,String filename){
  assertNodes(plugin,config,path,filename,false);
}

Fixed version (ground truth):
public static void replaceAllNodes(Config config,String path,String filename){
  assertNodes(config,path,filename,false);
}
Program: 16958
Project: 16958
Buggy source:
public static void addMissingNodes(MobArena plugin,Config config,String path,String filename){
  assertNodes(plugin,config,path,filename,true);
}

Fixed version (ground truth):
public static void addMissingNodes(Config config,String path,String filename){
  assertNodes(config,path,filename,true);
}