nus-yam/ex-repair huggingface dataset:
Program: 86033
Project: 86033
Buggy source:
public boolean stopArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (!sender.hasPermission(uber_permission + "String_Node_Str")) {
    sender.sendMessage(pli.getMessagesConfig().no_perm);
    return true;
  }
  if (args.length > 1) {
    Arena temp=pli.getArenaByName(args[1]);
    if (temp != null) {
      temp.stop();
      sender.sendMessage(pli.getMessagesConfig().arena_action.replaceAll("String_Node_Str",args[1]).replaceAll("String_Node_Str","String_Node_Str"));
    }
 else {
      sender.sendMessage(pli.getMessagesConfig().arena_invalid.replaceAll("String_Node_Str",args[1]));
    }
  }
 else {
    sender.sendMessage(pli.getMessagesConfig().arena_invalid.replaceAll("String_Node_Str","String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
public boolean stopArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (!sender.hasPermission(uber_permission + "String_Node_Str")) {
    sender.sendMessage(pli.getMessagesConfig().no_perm);
    return true;
  }
  if (args.length > 1) {
    Arena temp=pli.getArenaByName(args[1]);
    if (temp != null) {
      temp.stop();
      sender.sendMessage(pli.getMessagesConfig().arena_action.replaceAll("String_Node_Str",args[1]).replaceAll("String_Node_Str","String_Node_Str"));
    }
 else {
      sender.sendMessage(pli.getMessagesConfig().arena_invalid.replaceAll("String_Node_Str",args[1]));
    }
  }
 else {
    if (pli.containsGlobalPlayer(p.getName())) {
      Arena a=pli.global_players.get(p.getName());
      a.stop();
      sender.sendMessage(pli.getMessagesConfig().arena_action.replaceAll("String_Node_Str",args[1]).replaceAll("String_Node_Str","String_Node_Str"));
      return true;
    }
    sender.sendMessage(pli.getMessagesConfig().arena_invalid.replaceAll("String_Node_Str","String_Node_Str"));
  }
  return true;
}
Program: 86034
Project: 86034
Buggy source:
public static void sendStatsMessage(PluginInstance pli,Player p){
  if (pli.getMessagesConfig().getConfig().isSet("String_Node_Str")) {
    int kills_=pli.getStatsInstance().getKills(p.getName());
    int deaths_=pli.getStatsInstance().getDeaths(p.getName());
    int money_=(int)MinigamesAPI.econ.getBalance(p.getName());
    String wins=Integer.toString(pli.getStatsInstance().getWins(p.getName()));
    String loses=Integer.toString(pli.getStatsInstance().getLoses(p.getName()));
    String kills=Integer.toString(kills_);
    String deaths=Integer.toString(deaths_);
    String money=Integer.toString(money_);
    String points=Integer.toString(pli.getStatsInstance().getPoints(p.getName()));
    String kdr=Integer.toString(Math.max(kills_,1) / Math.max(deaths_,1));
    for (    String key : pli.getMessagesConfig().getConfig().getConfigurationSection("String_Node_Str").getKeys(false)) {
      String msg=pli.getMessagesConfig().getConfig().getString("String_Node_Str" + key).replaceAll("String_Node_Str",wins).replaceAll("String_Node_Str",loses).replaceAll("String_Node_Str",kills).replaceAll("String_Node_Str",deaths).replaceAll("String_Node_Str",points).replaceAll("String_Node_Str",kdr).replaceAll("String_Node_Str",money);
      Util.sendMessage(pli.getPlugin(),p,ChatColor.translateAlternateColorCodes('&',msg));
    }
  }
}

Fixed version (ground truth):
public static void sendStatsMessage(PluginInstance pli,Player p){
  if (pli.getMessagesConfig().getConfig().isSet("String_Node_Str")) {
    int kills_=pli.getStatsInstance().getKills(p.getName());
    int deaths_=pli.getStatsInstance().getDeaths(p.getName());
    int money_=0;
    if (MinigamesAPI.economy) {
      money_=(int)MinigamesAPI.econ.getBalance(p.getName());
    }
    String wins=Integer.toString(pli.getStatsInstance().getWins(p.getName()));
    String loses=Integer.toString(pli.getStatsInstance().getLoses(p.getName()));
    String kills=Integer.toString(kills_);
    String deaths=Integer.toString(deaths_);
    String money=Integer.toString(money_);
    String points=Integer.toString(pli.getStatsInstance().getPoints(p.getName()));
    String kdr=Integer.toString(Math.max(kills_,1) / Math.max(deaths_,1));
    for (    String key : pli.getMessagesConfig().getConfig().getConfigurationSection("String_Node_Str").getKeys(false)) {
      String msg=pli.getMessagesConfig().getConfig().getString("String_Node_Str" + key).replaceAll("String_Node_Str",wins).replaceAll("String_Node_Str",loses).replaceAll("String_Node_Str",kills).replaceAll("String_Node_Str",deaths).replaceAll("String_Node_Str",points).replaceAll("String_Node_Str",kdr).replaceAll("String_Node_Str",money);
      Util.sendMessage(pli.getPlugin(),p,ChatColor.translateAlternateColorCodes('&',msg));
    }
  }
}
Program: 86036
Project: 86036
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerTeleport(PlayerTeleportEvent event){
  final Player player=event.getPlayer();
  if (pli.containsGlobalPlayer(player.getName())) {
    final int visibleDistance=16;
    Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
      @Override public void run(){
        final List<Player> nearby=getPlayersWithin(player,visibleDistance);
        updateEntities(nearby,false);
        Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
          @Override public void run(){
            updateEntities(nearby,true);
          }
        }
,1);
      }
    }
,5L);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerTeleport(PlayerTeleportEvent event){
  if (event.getCause().equals(TeleportCause.UNKNOWN) && pli.spectator_mode_1_8) {
    return;
  }
  final Player player=event.getPlayer();
  if (pli.containsGlobalPlayer(player.getName())) {
    final int visibleDistance=16;
    Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
      @Override public void run(){
        final List<Player> nearby=getPlayersWithin(player,visibleDistance);
        updateEntities(nearby,false);
        Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
          @Override public void run(){
            updateEntities(nearby,true);
          }
        }
,1);
      }
    }
,5L);
  }
}
Program: 86038
Project: 86038
Buggy source:
@EventHandler public void onBlockPhysics(BlockPhysicsEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (a.getArenaState() == ArenaState.INGAME) {
          if (c.containsLocWithoutY(event.getBlock().getLocation())) {
            if (event.getChangedType() == Material.CARPET || event.getChangedType() == Material.BED_BLOCK) {
              return;
            }
            a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.PHYSICS);
          }
        }
 else         if (a.getArenaState() == ArenaState.RESTARTING) {
          event.setCancelled(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockPhysics(BlockPhysicsEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (a.getArenaState() == ArenaState.INGAME) {
          if (c.containsLocWithoutY(event.getBlock().getLocation())) {
            if (event.getChangedType() == Material.CARPET || event.getChangedType() == Material.BED_BLOCK) {
              return;
            }
            a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.PHYSICS);
          }
        }
 else         if (a.getArenaState() == ArenaState.RESTARTING) {
          event.setCancelled(true);
        }
      }
    }
  }
}
Program: 86039
Project: 86039
Buggy source:
@EventHandler public void onBlockSpread(BlockSpreadEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (a.getArenaState() == ArenaState.INGAME) {
          a.getSmartReset().addChanged(event.getBlock().getLocation());
        }
 else         if (a.getArenaState() == ArenaState.RESTARTING) {
          event.setCancelled(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockSpread(BlockSpreadEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (a.getArenaState() == ArenaState.INGAME) {
          a.getSmartReset().addChanged(event.getBlock().getLocation());
        }
 else         if (a.getArenaState() == ArenaState.RESTARTING) {
          event.setCancelled(true);
        }
      }
    }
  }
}
Program: 86040
Project: 86040
Buggy source:
@EventHandler public void onEntityChangeBlock(EntityChangeBlockEvent event){
  if (event.getEntity() instanceof Enderman) {
    for (    Arena a : pli.getArenas()) {
      if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION) {
        Cuboid c=a.getBoundaries();
        if (c != null) {
          if (c.containsLocWithoutY(event.getEntity().getLocation())) {
            a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.ENTITY_CHANGE);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onEntityChangeBlock(EntityChangeBlockEvent event){
  if (event.getEntity() instanceof Enderman) {
    for (    Arena a : pli.getArenas()) {
      if (a.getArenaType() == ArenaType.REGENERATION) {
        Cuboid c=a.getBoundaries();
        if (c != null) {
          if (c.containsLocWithoutY(event.getEntity().getLocation())) {
            a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.ENTITY_CHANGE);
          }
        }
      }
    }
  }
}
Program: 86041
Project: 86041
Buggy source:
@EventHandler public void onExplode(EntityExplodeEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (event.getEntity() != null) {
          if (c.containsLocWithoutY(event.getEntity().getLocation())) {
            for (            Block b : event.blockList()) {
              a.getSmartReset().addChanged(b,b.getType().equals(Material.CHEST));
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onExplode(EntityExplodeEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (event.getEntity() != null) {
          if (c.containsLocWithoutY(event.getEntity().getLocation())) {
            for (            Block b : event.blockList()) {
              a.getSmartReset().addChanged(b,b.getType().equals(Material.CHEST));
            }
          }
        }
      }
    }
  }
}
Program: 86042
Project: 86042
Buggy source:
@EventHandler public void onLeavesDecay(LeavesDecayEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION && a.getArenaState() == ArenaState.INGAME) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST));
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onLeavesDecay(LeavesDecayEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION && a.getArenaState() == ArenaState.INGAME) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST));
        }
      }
    }
  }
}
Program: 86043
Project: 86043
Buggy source:
@EventHandler public void onBlockFromTo(BlockFromToEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          if (a.getArenaState() == ArenaState.INGAME) {
            a.getSmartReset().addChanged(event.getToBlock(),event.getToBlock().getType().equals(Material.CHEST),ChangeCause.FROM_TO);
          }
 else           if (a.getArenaState() == ArenaState.RESTARTING) {
            event.setCancelled(true);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockFromTo(BlockFromToEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          if (a.getArenaState() == ArenaState.INGAME) {
            a.getSmartReset().addChanged(event.getToBlock(),event.getToBlock().getType().equals(Material.CHEST),ChangeCause.FROM_TO);
          }
 else           if (a.getArenaState() == ArenaState.RESTARTING) {
            event.setCancelled(true);
          }
        }
      }
    }
  }
}
Program: 86044
Project: 86044
Buggy source:
@EventHandler public void onBlockFade(BlockFadeEvent event){
  for (  Arena a : pli.getArenas()) {
    if (Validator.isArenaValid(plugin,a) && a.getArenaType() == ArenaType.REGENERATION && a.getArenaState() == ArenaState.INGAME) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.FADE);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockFade(BlockFadeEvent event){
  for (  Arena a : pli.getArenas()) {
    if (a.getArenaType() == ArenaType.REGENERATION && a.getArenaState() == ArenaState.INGAME) {
      Cuboid c=a.getBoundaries();
      if (c != null) {
        if (c.containsLocWithoutY(event.getBlock().getLocation())) {
          a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST),ChangeCause.FADE);
        }
      }
    }
  }
}
Program: 86046
Project: 86046
Buggy source:
public void resetSmartResetBlock(SmartArenaBlock ablock){
  final Block b_=ablock.getBlock().getWorld().getBlockAt(ablock.getBlock().getLocation());
  if (b_.getType() == Material.FURNACE) {
    ((Furnace)b_.getState()).getInventory().clear();
    ((Furnace)b_.getState()).update();
  }
  if (b_.getType() == Material.CHEST) {
    ((Chest)b_.getState()).getBlockInventory().clear();
    ((Chest)b_.getState()).update();
  }
  if (!b_.getType().toString().equalsIgnoreCase(ablock.getMaterial().toString())) {
    b_.setType(ablock.getMaterial());
    b_.setData(ablock.getData());
  }
  if (b_.getType() == Material.CHEST) {
    ((Chest)b_.getState()).getBlockInventory().clear();
    ((Chest)b_.getState()).update();
    HashMap<Integer,ItemStack> chestinv=ablock.getNewInventory();
    for (    Integer i : chestinv.keySet()) {
      ItemStack item=chestinv.get(i);
      if (item != null) {
        ((Chest)b_.getState()).getBlockInventory().setItem(i,item);
      }
    }
    ((Chest)b_.getState()).update();
  }
}

Fixed version (ground truth):
public void resetSmartResetBlock(SmartArenaBlock ablock){
  final Block b_=ablock.getBlock().getWorld().getBlockAt(ablock.getBlock().getLocation());
  if (b_.getType() == Material.FURNACE) {
    ((Furnace)b_.getState()).getInventory().clear();
    ((Furnace)b_.getState()).update();
  }
  if (b_.getType() == Material.CHEST) {
    ((Chest)b_.getState()).getBlockInventory().clear();
    ((Chest)b_.getState()).update();
  }
  if (!b_.getType().toString().equalsIgnoreCase(ablock.getMaterial().toString()) || b_.getData() != ablock.getData()) {
    b_.setType(ablock.getMaterial());
    b_.setData(ablock.getData());
  }
  if (b_.getType() == Material.CHEST) {
    if (ablock.isDoubleChest()) {
      DoubleChest dc=ablock.getDoubleChest();
      System.out.println(dc.getLocation());
      HashMap<Integer,ItemStack> chestinv=ablock.getNewInventory();
      for (      Integer i : chestinv.keySet()) {
        ItemStack item=chestinv.get(i);
        if (item != null) {
          dc.getInventory().setItem(i,item);
        }
      }
      ((Chest)b_.getState()).update();
      return;
    }
    ((Chest)b_.getState()).getBlockInventory().clear();
    ((Chest)b_.getState()).update();
    HashMap<Integer,ItemStack> chestinv=ablock.getNewInventory();
    for (    Integer i : chestinv.keySet()) {
      ItemStack item=chestinv.get(i);
      if (item != null) {
        ((Chest)b_.getState()).getBlockInventory().setItem(i,item);
      }
    }
    ((Chest)b_.getState()).update();
  }
  if (b_.getType() == Material.WALL_SIGN || b_.getType() == Material.SIGN_POST) {
    Sign sign=(Sign)b_.getState();
    if (sign != null) {
      int i=0;
      for (      String line : ablock.getSignLines()) {
        sign.setLine(i,line);
        i++;
        if (i > 3) {
          break;
        }
      }
      sign.update();
    }
  }
}
Program: 86048
Project: 86048
Buggy source:
public Stats(JavaPlugin plugin){
  this.plugin=plugin;
  this.stats_kill_points=plugin.getConfig().getInt("String_Node_Str");
  this.stats_win_points=plugin.getConfig().getInt("String_Node_Str");
}

Fixed version (ground truth):
public Stats(JavaPlugin plugin){
  this.plugin=plugin;
  reloadVariables();
}
Program: 86063
Project: 86063
Buggy source:
@EventHandler public void onPlayerPickupItem(PlayerPickupItemEvent event){
  if (pli.global_lost.containsKey(event.getPlayer().getName()) || pli.getSpectatorManager().isSpectating(event.getPlayer())) {
    Arena a=pli.global_lost.get(event.getPlayer().getName());
    if (a != null) {
      if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
        event.setCancelled(true);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerPickupItem(PlayerPickupItemEvent event){
  if (pli.global_lost.containsKey(event.getPlayer().getName()) || pli.getSpectatorManager().isSpectating(event.getPlayer())) {
    Arena a=pli.global_lost.get(event.getPlayer().getName());
    if (a != null) {
      if (a.getArenaState() == ArenaState.INGAME && a.getArcadeInstance() == null) {
        event.setCancelled(true);
      }
    }
  }
}
Program: 86064
Project: 86064
Buggy source:
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  if (event.getPlayer().getName().equalsIgnoreCase(p.getName())) {
    String d=event.getName();
    Player p=event.getPlayer();
    Player p_=Bukkit.getPlayer(d);
    if (p_ != null && p != null) {
      Util.teleportPlayerFixed(p,p_.getLocation());
    }
  }
  event.setWillClose(true);
}

Fixed version (ground truth):
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  if (event.getPlayer().getName().equalsIgnoreCase(p.getName())) {
    String d=event.getName();
    Player p=event.getPlayer();
    Player p_=Bukkit.getPlayer(d);
    if (p_ != null && p != null) {
      Util.teleportPlayerFixed(p,p_.getLocation().add(0D,0.5D,0D));
    }
  }
  event.setWillClose(true);
}
Program: 86065
Project: 86065
Buggy source:
public void openSpectatorGUI(final Player p,Arena a){
  IconMenu iconm;
  int mincount=a.getAllPlayers().size();
  if (lasticonm.containsKey(p.getName())) {
    iconm=lasticonm.get(p.getName());
  }
 else {
    iconm=new IconMenu(MinigamesAPI.getAPI().getPluginInstance(plugin).getMessagesConfig().spectator_item,(9 > mincount - 1) ? 9 : Math.round(mincount / 9) * 9 + 9,new IconMenu.OptionClickEventHandler(){
      @Override public void onOptionClick(      IconMenu.OptionClickEvent event){
        if (event.getPlayer().getName().equalsIgnoreCase(p.getName())) {
          String d=event.getName();
          Player p=event.getPlayer();
          Player p_=Bukkit.getPlayer(d);
          if (p_ != null && p != null) {
            Util.teleportPlayerFixed(p,p_.getLocation());
          }
        }
        event.setWillClose(true);
      }
    }
,plugin);
  }
  PluginInstance pli=MinigamesAPI.getAPI().getPluginInstance(plugin);
  int c=0;
  for (  String p__ : a.getAllPlayers()) {
    Player p_=Bukkit.getPlayer(p__);
    if (p_ != null) {
      if (pli.global_players.containsKey(p__) && !pli.global_lost.containsKey(p__)) {
        if (a.getName().equalsIgnoreCase(pli.global_players.get(p__).getName())) {
          iconm.setOption(c,Util.getCustomHead(p__),p__,"String_Node_Str");
          c++;
        }
      }
    }
  }
  iconm.open(p);
  lasticonm.put(p.getName(),iconm);
}

Fixed version (ground truth):
public void openSpectatorGUI(final Player p,Arena a){
  IconMenu iconm;
  int mincount=a.getAllPlayers().size();
  if (lasticonm.containsKey(p.getName())) {
    iconm=lasticonm.get(p.getName());
  }
 else {
    iconm=new IconMenu(MinigamesAPI.getAPI().getPluginInstance(plugin).getMessagesConfig().spectator_item,(9 > mincount - 1) ? 9 : Math.round(mincount / 9) * 9 + 9,new IconMenu.OptionClickEventHandler(){
      @Override public void onOptionClick(      IconMenu.OptionClickEvent event){
        if (event.getPlayer().getName().equalsIgnoreCase(p.getName())) {
          String d=event.getName();
          Player p=event.getPlayer();
          Player p_=Bukkit.getPlayer(d);
          if (p_ != null && p != null) {
            Util.teleportPlayerFixed(p,p_.getLocation().add(0D,0.5D,0D));
          }
        }
        event.setWillClose(true);
      }
    }
,plugin);
  }
  PluginInstance pli=MinigamesAPI.getAPI().getPluginInstance(plugin);
  int c=0;
  for (  String p__ : a.getAllPlayers()) {
    Player p_=Bukkit.getPlayer(p__);
    if (p_ != null) {
      if (pli.global_players.containsKey(p__) && !pli.global_lost.containsKey(p__)) {
        if (a.getName().equalsIgnoreCase(pli.global_players.get(p__).getName())) {
          iconm.setOption(c,Util.getCustomHead(p__),p__,"String_Node_Str");
          c++;
        }
      }
    }
  }
  iconm.open(p);
  lasticonm.put(p.getName(),iconm);
}
Program: 86074
Project: 86074
Buggy source:
@EventHandler public void onBlockBreak(BlockBreakEvent event){
  Player p=event.getPlayer();
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArenaState() != ArenaState.INGAME || pli.global_lost.containsKey(p.getName())) {
      event.setCancelled(true);
      return;
    }
    a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST));
    if (event.getBlock().getType() == Material.DOUBLE_PLANT) {
      a.getSmartReset().addChanged(event.getBlock().getLocation().clone().add(0D,-1D,0D).getBlock(),event.getBlock().getType().equals(Material.CHEST));
      a.getSmartReset().addChanged(event.getBlock().getLocation().clone().add(0D,+1D,0D).getBlock(),event.getBlock().getType().equals(Material.CHEST));
    }
  }
  if (event.getBlock().getType() == Material.SIGN_POST || event.getBlock().getType() == Material.WALL_SIGN) {
    Arena arena=Util.getArenaBySignLocation(plugin,event.getBlock().getLocation());
    if (arena != null) {
      pli.getArenasConfig().getConfig().set("String_Node_Str" + arena.getName() + "String_Node_Str",null);
      pli.getArenasConfig().saveConfig();
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockBreak(BlockBreakEvent event){
  Player p=event.getPlayer();
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArenaState() != ArenaState.INGAME || pli.global_lost.containsKey(p.getName())) {
      event.setCancelled(true);
      return;
    }
    if (pli.getSpectatorManager().isSpectating(p)) {
      event.setCancelled(true);
      return;
    }
    a.getSmartReset().addChanged(event.getBlock(),event.getBlock().getType().equals(Material.CHEST));
    if (event.getBlock().getType() == Material.DOUBLE_PLANT) {
      a.getSmartReset().addChanged(event.getBlock().getLocation().clone().add(0D,-1D,0D).getBlock(),event.getBlock().getType().equals(Material.CHEST));
      a.getSmartReset().addChanged(event.getBlock().getLocation().clone().add(0D,+1D,0D).getBlock(),event.getBlock().getType().equals(Material.CHEST));
    }
  }
  if (event.getBlock().getType() == Material.SIGN_POST || event.getBlock().getType() == Material.WALL_SIGN) {
    Arena arena=Util.getArenaBySignLocation(plugin,event.getBlock().getLocation());
    if (arena != null) {
      pli.getArenasConfig().getConfig().set("String_Node_Str" + arena.getName() + "String_Node_Str",null);
      pli.getArenasConfig().saveConfig();
    }
  }
}
Program: 86075
Project: 86075
Buggy source:
@EventHandler public void onEntityDamageByEntity(EntityDamageByEntityEvent event){
  if (event.getEntity() instanceof Player) {
    Player p=(Player)event.getEntity();
    Player attacker=null;
    if (event.getDamager() instanceof Projectile) {
      Projectile projectile=(Projectile)event.getDamager();
      if (projectile.getShooter() instanceof Player) {
        attacker=(Player)projectile.getShooter();
      }
    }
 else     if (event.getDamager() instanceof Player) {
      attacker=(Player)event.getDamager();
    }
 else {
      return;
    }
    if (p != null && attacker != null) {
      if (pli.global_players.containsKey(p.getName()) && pli.global_players.containsKey(attacker.getName())) {
        if (pli.global_lost.containsKey(attacker.getName())) {
          event.setCancelled(true);
          return;
        }
        Arena a=(Arena)pli.global_players.get(p.getName());
        if (a.getArenaState() == ArenaState.INGAME) {
          a.lastdamager.put(p.getName(),attacker.getName());
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onEntityDamageByEntity(EntityDamageByEntityEvent event){
  if (event.getEntity() instanceof Player) {
    Player p=(Player)event.getEntity();
    Player attacker=null;
    if (event.getDamager() instanceof Projectile) {
      Projectile projectile=(Projectile)event.getDamager();
      if (projectile.getShooter() instanceof Player) {
        attacker=(Player)projectile.getShooter();
      }
    }
 else     if (event.getDamager() instanceof Player) {
      attacker=(Player)event.getDamager();
    }
 else {
      return;
    }
    if (p != null && attacker != null) {
      if (pli.global_players.containsKey(p.getName()) && pli.global_players.containsKey(attacker.getName())) {
        if (pli.global_lost.containsKey(attacker.getName()) || pli.getSpectatorManager().isSpectating(p)) {
          event.setCancelled(true);
          return;
        }
        Arena a=(Arena)pli.global_players.get(p.getName());
        if (a.getArenaState() == ArenaState.INGAME) {
          a.lastdamager.put(p.getName(),attacker.getName());
        }
      }
    }
  }
}
Program: 86076
Project: 86076
Buggy source:
@EventHandler public void onBlockPlace(BlockPlaceEvent event){
  Player p=event.getPlayer();
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArenaState() != ArenaState.INGAME) {
      event.setCancelled(true);
      return;
    }
    a.getSmartReset().addChanged(event.getBlock().getLocation());
  }
  if (pli.getStatsInstance().skullsetup.contains(p.getName())) {
    if (event.getBlock().getType() == Material.SKULL_ITEM || event.getBlock().getType() == Material.SKULL) {
      if (event.getItemInHand().hasItemMeta()) {
        pli.getStatsInstance().saveSkull(event.getBlock().getLocation(),Integer.parseInt(event.getItemInHand().getItemMeta().getDisplayName()));
        pli.getStatsInstance().skullsetup.remove(p.getName());
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onBlockPlace(BlockPlaceEvent event){
  Player p=event.getPlayer();
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArenaState() != ArenaState.INGAME || pli.global_lost.containsKey(p.getName()) || pli.getSpectatorManager().isSpectating(p)) {
      event.setCancelled(true);
      return;
    }
    a.getSmartReset().addChanged(event.getBlock().getLocation());
  }
  if (pli.getStatsInstance().skullsetup.contains(p.getName())) {
    if (event.getBlock().getType() == Material.SKULL_ITEM || event.getBlock().getType() == Material.SKULL) {
      if (event.getItemInHand().hasItemMeta()) {
        pli.getStatsInstance().saveSkull(event.getBlock().getLocation(),Integer.parseInt(event.getItemInHand().getItemMeta().getDisplayName()));
        pli.getStatsInstance().skullsetup.remove(p.getName());
      }
    }
  }
}
Program: 86077
Project: 86077
Buggy source:
@EventHandler public void onInventoryClick(InventoryClickEvent event){
  if (event.getWhoClicked() instanceof Player) {
    Player p=(Player)event.getWhoClicked();
    if (pli.global_players.containsKey(p.getName())) {
      Arena a=pli.global_players.get(p.getName());
      if (a.getArenaState() == ArenaState.STARTING && a.getArcadeInstance() != null) {
        event.setCancelled(true);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onInventoryClick(InventoryClickEvent event){
  if (event.getWhoClicked() instanceof Player) {
    Player p=(Player)event.getWhoClicked();
    if (pli.global_players.containsKey(p.getName())) {
      Arena a=pli.global_players.get(p.getName());
      if (a != null) {
        if (a.getArenaState() == ArenaState.STARTING && a.getArcadeInstance() != null) {
          event.setCancelled(true);
        }
      }
    }
  }
}
Program: 86078
Project: 86078
Buggy source:
@EventHandler public void onEntityDamage(EntityDamageEvent event){
  if (event.getEntity() instanceof Player) {
    Player p=(Player)event.getEntity();
    if (event.getCause().equals(DamageCause.ENTITY_ATTACK)) {
      if (pli.global_players.containsKey(p.getName())) {
        Arena a=pli.global_players.get(p.getName());
        if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null && !a.getAlwaysPvP()) {
          event.setCancelled(true);
        }
 else {
          if (plugin.getConfig().getBoolean("String_Node_Str")) {
            Effects.playBloodEffect(p);
          }
        }
      }
      if (pli.global_lost.containsKey(p.getName())) {
        event.setCancelled(true);
      }
    }
 else     if (event.getCause().equals(DamageCause.FALL)) {
      if (pli.global_players.containsKey(p.getName())) {
        Arena a=pli.global_players.get(p.getName());
        if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
          event.setCancelled(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onEntityDamage(EntityDamageEvent event){
  if (event.getEntity() instanceof Player) {
    Player p=(Player)event.getEntity();
    if (event.getCause().equals(DamageCause.ENTITY_ATTACK)) {
      if (pli.global_players.containsKey(p.getName())) {
        Arena a=pli.global_players.get(p.getName());
        if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null && !a.getAlwaysPvP()) {
          event.setCancelled(true);
        }
 else {
          if (plugin.getConfig().getBoolean("String_Node_Str")) {
            Effects.playBloodEffect(p);
          }
        }
      }
      if (pli.global_lost.containsKey(p.getName()) || pli.getSpectatorManager().isSpectating(p)) {
        event.setCancelled(true);
      }
    }
 else     if (event.getCause().equals(DamageCause.FALL)) {
      if (pli.global_players.containsKey(p.getName())) {
        Arena a=pli.global_players.get(p.getName());
        if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
          event.setCancelled(true);
        }
      }
    }
  }
}
Program: 86079
Project: 86079
Buggy source:
@EventHandler public void onPlayerDrop(PlayerDropItemEvent event){
  if (pli.global_players.containsKey(event.getPlayer().getName())) {
    Arena a=pli.global_players.get(event.getPlayer().getName());
    if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerDrop(PlayerDropItemEvent event){
  if (pli.global_players.containsKey(event.getPlayer().getName())) {
    Arena a=pli.global_players.get(event.getPlayer().getName());
    if (a != null) {
      if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
        event.setCancelled(true);
      }
    }
  }
}
Program: 86080
Project: 86080
Buggy source:
@EventHandler public void onPlayerPickupItem(PlayerPickupItemEvent event){
  if (pli.global_lost.containsKey(event.getPlayer().getName())) {
    Arena a=pli.global_lost.get(event.getPlayer().getName());
    if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerPickupItem(PlayerPickupItemEvent event){
  if (pli.global_lost.containsKey(event.getPlayer().getName()) || pli.getSpectatorManager().isSpectating(event.getPlayer())) {
    Arena a=pli.global_lost.get(event.getPlayer().getName());
    if (a != null) {
      if (a.getArenaState() != ArenaState.INGAME && a.getArcadeInstance() != null) {
        event.setCancelled(true);
      }
    }
  }
}
Program: 86081
Project: 86081
Buggy source:
public void leaveArcade(final String playername){
  if (players.contains(playername)) {
    players.remove(playername);
  }
  if (arena.containsPlayer(playername)) {
    arena.removePlayer(playername);
  }
  if (minigames.get(currentindex).getArenas().size() > 0) {
    if (minigames.get(currentindex).getArenas().get(0).containsPlayer(playername)) {
      minigames.get(currentindex).getArenas().get(0).leavePlayer(playername,false,false);
    }
  }
  Bukkit.getScheduler().runTaskLater(MinigamesAPI.getAPI(),new Runnable(){
    public void run(){
      Player p=Bukkit.getPlayer(playername);
      if (p != null) {
        Util.teleportPlayerFixed(p,arena.getMainLobbyTemp());
        MinigamesAPI.getAPI().pinstances.get(plugin).getSpectatorManager().setSpectate(p,false);
        if (!p.isOp()) {
          p.setFlying(false);
          p.setAllowFlight(false);
        }
      }
    }
  }
,20L);
  clean();
  if (players.size() < 2) {
    stopArcade(false);
  }
}

Fixed version (ground truth):
public void leaveArcade(final String playername,boolean endOfGame){
  final PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
  if (players.contains(playername)) {
    players.remove(playername);
  }
  if (arena.containsPlayer(playername)) {
    arena.removePlayer(playername);
  }
  if (minigames.get(currentindex).getArenas().size() > 0) {
    if (minigames.get(currentindex).getArenas().get(0).containsPlayer(playername)) {
      minigames.get(currentindex).getArenas().get(0).leavePlayer(playername,false,false);
    }
  }
  Bukkit.getScheduler().runTaskLater(MinigamesAPI.getAPI(),new Runnable(){
    public void run(){
      Player p=Bukkit.getPlayer(playername);
      if (p != null) {
        Util.teleportPlayerFixed(p,arena.getMainLobbyTemp());
        pli.getSpectatorManager().setSpectate(p,false);
        if (!p.isOp()) {
          p.setFlying(false);
          p.setAllowFlight(false);
        }
      }
    }
  }
,20L);
  clean();
  if (pli.global_players.containsKey(playername)) {
    pli.global_players.remove(playername);
  }
  if (pli.global_lost.containsKey(playername)) {
    pli.global_lost.remove(playername);
  }
  if (currentarena != null) {
    PluginInstance pli_=MinigamesAPI.getAPI().pinstances.get(currentarena.getPlugin());
    if (pli_ != null) {
      if (pli_.global_players.containsKey(playername)) {
        pli_.global_players.remove(playername);
      }
      if (pli_.global_lost.containsKey(playername)) {
        pli_.global_lost.remove(playername);
      }
    }
  }
  if (endOfGame) {
    if (players.size() < 2) {
      stopArcade(false);
    }
  }
}
Program: 86084
Project: 86084
Buggy source:
public void run(){
  ArrayList<String> temp=new ArrayList<String>(players);
  PluginInstance mg=minigames.get(currentindex);
  if (mg.getPlugin().getConfig().getBoolean("String_Node_Str")) {
    Arena a=null;
    if (mg.getPlugin().getConfig().getBoolean("String_Node_Str")) {
      String arenaname=mg.getPlugin().getConfig().getString("String_Node_Str");
      a=mg.getArenaByName(arenaname);
      if (a == null) {
        for (        Arena a_ : mg.getArenas()) {
          if (a_.getArenaState() == ArenaState.JOIN || a_.getArenaState() == ArenaState.STARTING) {
            a=a_;
            break;
          }
        }
      }
    }
 else {
      for (      Arena a_ : mg.getArenas()) {
        if (a_.getArenaState() == ArenaState.JOIN || a_.getArenaState() == ArenaState.STARTING) {
          a=a_;
          break;
        }
      }
    }
    if (a != null) {
      in_a_game=true;
      currentarena=a;
      PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
      for (      String p_ : temp) {
        String minigame=mg.getArenaListener().getName();
        Bukkit.getPlayer(p_).sendMessage(mg.getMessagesConfig().arcade_next_minigame.replaceAll("String_Node_Str",Character.toUpperCase(minigame.charAt(0)) + minigame.substring(1)));
        a.joinPlayerLobby(p_,ai,plugin.getConfig().getBoolean("String_Node_Str"),false);
        pli.getSpectatorManager().setSpectate(Bukkit.getPlayer(p_),false);
      }
    }
 else {
      nextMinigame(5L);
    }
  }
 else {
    nextMinigame(5L);
  }
}

Fixed version (ground truth):
public void run(){
  ArrayList<String> temp=new ArrayList<String>(players);
  PluginInstance mg=minigames.get(currentindex);
  if (mg.getPlugin().getConfig().getBoolean("String_Node_Str")) {
    Arena a=null;
    if (mg.getPlugin().getConfig().getBoolean("String_Node_Str")) {
      String arenaname=mg.getPlugin().getConfig().getString("String_Node_Str");
      a=mg.getArenaByName(arenaname);
      if (a == null) {
        for (        Arena a_ : mg.getArenas()) {
          if (a_.getArenaState() == ArenaState.JOIN || a_.getArenaState() == ArenaState.STARTING) {
            a=a_;
            break;
          }
        }
      }
    }
 else {
      for (      Arena a_ : mg.getArenas()) {
        if (a_.getArenaState() == ArenaState.JOIN || a_.getArenaState() == ArenaState.STARTING) {
          a=a_;
          break;
        }
      }
    }
    if (a != null) {
      in_a_game=true;
      currentarena=a;
      PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
      for (      String p_ : temp) {
        String minigame=mg.getArenaListener().getName();
        if (!a.containsPlayer(p_)) {
          Bukkit.getPlayer(p_).sendMessage(mg.getMessagesConfig().arcade_next_minigame.replaceAll("String_Node_Str",Character.toUpperCase(minigame.charAt(0)) + minigame.substring(1)));
          a.joinPlayerLobby(p_,ai,plugin.getConfig().getBoolean("String_Node_Str"),false);
        }
        pli.getSpectatorManager().setSpectate(Bukkit.getPlayer(p_),false);
      }
    }
 else {
      nextMinigame(5L);
    }
  }
 else {
    nextMinigame(5L);
  }
}
Program: 86085
Project: 86085
Buggy source:
public boolean leaveArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArcadeInstance() != null) {
      a.getArcadeInstance().leaveArcade(p.getName());
    }
    a.leavePlayer(p.getName(),false,false);
  }
 else {
    sender.sendMessage(pli.getMessagesConfig().not_in_arena);
  }
  return true;
}

Fixed version (ground truth):
public boolean leaveArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (pli.global_players.containsKey(p.getName())) {
    Arena a=pli.global_players.get(p.getName());
    if (a.getArcadeInstance() != null) {
      a.getArcadeInstance().leaveArcade(p.getName(),true);
    }
    a.leavePlayer(p.getName(),false,false);
  }
 else {
    sender.sendMessage(pli.getMessagesConfig().not_in_arena);
  }
  return true;
}
Program: 86087
Project: 86087
Buggy source:
/** 
 * Sets the current class of a player
 * @param classname the INTERNAL classname
 * @param player
 */
public void setClass(String internalname,String player){
  if (!kitPlayerHasPermission(internalname,Bukkit.getPlayer(player))) {
    Bukkit.getPlayer(player).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().no_perm);
    return;
  }
  boolean continue_=true;
  if (kitRequiresMoney(internalname)) {
    continue_=kitTakeMoney(Bukkit.getPlayer(player),internalname.toLowerCase());
  }
  if (continue_) {
    MinigamesAPI.getAPI().pinstances.get(plugin).setPClass(player,this.getClassByInternalname(internalname));
    Bukkit.getPlayer(player).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().set_kit.replaceAll("String_Node_Str",ChatColor.translateAlternateColorCodes('&',getClassByInternalname(internalname).getName())));
  }
}

Fixed version (ground truth):
/** 
 * Sets the current class of a player
 * @param classname the INTERNAL classname
 * @param player
 */
public void setClass(String internalname,String player){
  if (!kitPlayerHasPermission(internalname,Bukkit.getPlayer(player))) {
    Bukkit.getPlayer(player).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().no_perm);
    return;
  }
  boolean continue_=true;
  if (kitRequiresMoney(internalname)) {
    continue_=kitTakeMoney(Bukkit.getPlayer(player),internalname);
  }
  if (continue_) {
    MinigamesAPI.getAPI().pinstances.get(plugin).setPClass(player,this.getClassByInternalname(internalname));
    Bukkit.getPlayer(player).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().set_kit.replaceAll("String_Node_Str",ChatColor.translateAlternateColorCodes('&',getClassByInternalname(internalname).getName())));
  }
}
Program: 86089
Project: 86089
Buggy source:
public void onDisable(){
  for (  PluginInstance pli : this.pinstances.values()) {
    for (    Arena a : pli.getArenas()) {
      ArrayList<String> temp=new ArrayList<String>(a.getAllPlayers());
      for (      String p_ : temp) {
        a.leavePlayer(p_,true);
      }
    }
  }
}

Fixed version (ground truth):
public void onDisable(){
  for (  PluginInstance pli : this.pinstances.values()) {
    for (    Arena a : pli.getArenas()) {
      ArrayList<String> temp=new ArrayList<String>(a.getAllPlayers());
      for (      String p_ : temp) {
        a.leavePlayer(p_,true);
      }
      try {
        a.getSmartReset().resetRaw();
      }
 catch (      Exception e) {
        System.out.println("String_Node_Str" + e.getMessage());
      }
    }
  }
}
Program: 86090
Project: 86090
Buggy source:
public ArrayList<ItemStack> getNewInventory(){
  int c=0;
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  for (int i=0; i < item_mats.size(); i++) {
    ItemStack item=new ItemStack(item_mats.get(i),item_amounts.get(i),item_data.get(i));
    ItemMeta im=item.getItemMeta();
    im.setDisplayName(item_displaynames.get(i));
    item.setItemMeta(im);
    if (item.getType() == Material.POTION) {
      Potion potion=Potion.fromDamage(item.getDurability() & 0x3F);
      potion.setSplash(item_splash.get(i));
      item=potion.toItemStack(item_amounts.get(i));
    }
    ret.add(item);
  }
  return ret;
}

Fixed version (ground truth):
public ArrayList<ItemStack> getNewInventory(){
  int c=0;
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  for (int i=0; i < item_mats.size(); i++) {
    ItemStack item=new ItemStack(item_mats.get(i),item_amounts.get(i),item_data.get(i));
    ItemMeta im=item.getItemMeta();
    im.setDisplayName(item_displaynames.get(i));
    item.setItemMeta(im);
    if (item.getType() == Material.POTION && item.getDurability() > 0) {
      Potion potion=Potion.fromDamage(item.getDurability() & 0x3F);
      potion.setSplash(item_splash.get(i));
      item=potion.toItemStack(item_amounts.get(i));
    }
    ret.add(item);
  }
  return ret;
}
Program: 86091
Project: 86091
Buggy source:
public ArrayList<ItemStack> getNewInventory(){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  for (int i=0; i < item_mats.size(); i++) {
    ItemStack item=new ItemStack(item_mats.get(i),item_amounts.get(i),item_data.get(i));
    item.setDurability(item_durability.get(i));
    ItemMeta im=item.getItemMeta();
    im.setDisplayName(item_displaynames.get(i));
    if (item_enchid.get(i) != null) {
      int c=0;
      for (      Integer ench : item_enchid.get(i)) {
        im.addEnchant(Enchantment.getById(ench),item_enchid_lv.get(i).get(c),true);
        c++;
      }
    }
    item.setItemMeta(im);
    if (item.getType() == Material.POTION) {
      Potion potion=Potion.fromDamage(item.getDurability() & 0x3F);
      potion.setSplash(item_splash.get(i));
    }
 else     if (item.getType() == Material.ENCHANTED_BOOK) {
      ItemStack neww=new ItemStack(Material.ENCHANTED_BOOK);
      EnchantmentStorageMeta meta=(EnchantmentStorageMeta)neww.getItemMeta();
      int c_=0;
      for (      Integer ench : enchbook_id.get(i)) {
        meta.addStoredEnchant(Enchantment.getById(ench),enchbook_id_lv.get(i).get(c_),true);
        c_++;
      }
      neww.setItemMeta(meta);
      item=neww;
    }
    ret.add(item);
  }
  return ret;
}

Fixed version (ground truth):
public ArrayList<ItemStack> getNewInventory(){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  for (int i=0; i < item_mats.size(); i++) {
    ItemStack item=new ItemStack(item_mats.get(i),item_amounts.get(i),item_data.get(i));
    item.setDurability(item_durability.get(i));
    ItemMeta im=item.getItemMeta();
    im.setDisplayName(item_displaynames.get(i));
    if (item_enchid.get(i) != null) {
      int c=0;
      for (      Integer ench : item_enchid.get(i)) {
        im.addEnchant(Enchantment.getById(ench),item_enchid_lv.get(i).get(c),true);
        c++;
      }
    }
    item.setItemMeta(im);
    if (item.getType() == Material.POTION && item.getDurability() > 0) {
      Potion potion=Potion.fromDamage(item.getDurability() & 0x3F);
      potion.setSplash(item_splash.get(i));
    }
 else     if (item.getType() == Material.ENCHANTED_BOOK) {
      ItemStack neww=new ItemStack(Material.ENCHANTED_BOOK);
      EnchantmentStorageMeta meta=(EnchantmentStorageMeta)neww.getItemMeta();
      int c_=0;
      for (      Integer ench : enchbook_id.get(i)) {
        meta.addStoredEnchant(Enchantment.getById(ench),enchbook_id_lv.get(i).get(c_),true);
        c_++;
      }
      neww.setItemMeta(meta);
      item=neww;
    }
    ret.add(item);
  }
  return ret;
}
Program: 86092
Project: 86092
Buggy source:
public ArenaListener(JavaPlugin plugin,PluginInstance pinstance,String minigame,ArrayList<String> cmds){
  this.plugin=plugin;
  this.pli=pinstance;
  this.setName(minigame);
  this.cmds=cmds;
  this.leave_cmd=plugin.getConfig().getString("String_Node_Str");
}

Fixed version (ground truth):
public ArenaListener(JavaPlugin plugin,PluginInstance pinstance,String minigame,ArrayList<String> cmds){
  this(plugin,pinstance,minigame);
  this.cmds=cmds;
}