nus-yam/ex-repair huggingface dataset:
Program: 86093
Project: 86093
Buggy source:
public void stopArcade(boolean stopOfGame){
  final ArrayList<String> temp=new ArrayList<String>(players);
  for (  String p_ : temp) {
    this.leaveArcade(p_);
  }
  players.clear();
  started=false;
  in_a_game=false;
  currentarena=null;
  this.currentindex=0;
  HashSet hs=new HashSet();
  hs.addAll(temp);
  temp.clear();
  temp.addAll(hs);
  final ArcadeInstance ai=this;
  if (stopOfGame && plugin.getConfig().getBoolean("String_Node_Str")) {
    for (    String p_ : temp) {
      Util.sendMessage(Bukkit.getPlayer(p_),MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().arcade_new_round.replaceAll("String_Node_Str",Integer.toString(plugin.getConfig().getInt("String_Node_Str"))));
    }
    Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
      public void run(){
        for (        String p_ : temp) {
          if (!players.contains(p_)) {
            players.add(p_);
          }
        }
        ai.startArcade();
      }
    }
,Math.max(40L,20L * plugin.getConfig().getInt("String_Node_Str")));
  }
}

Fixed version (ground truth):
public void stopArcade(){
  this.stopArcade(false);
}
Program: 86094
Project: 86094
Buggy source:
@SuppressWarnings("String_Node_Str") public static Sign getSignFromArena(JavaPlugin plugin,String arena){
  PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
  if (!pli.getArenasConfig().getConfig().isSet("String_Node_Str" + arena + "String_Node_Str")) {
    return null;
  }
  Location b_=new Location(Bukkit.getServer().getWorld(pli.getArenasConfig().getConfig().getString("String_Node_Str" + arena + "String_Node_Str")),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"));
  if (b_ != null) {
    BlockState bs=b_.getBlock().getState();
    Sign s_=null;
    if (bs instanceof Sign) {
      s_=(Sign)bs;
    }
    return s_;
  }
  return null;
}

Fixed version (ground truth):
public static Sign getSignFromArena(JavaPlugin plugin,String arena){
  PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
  if (!pli.getArenasConfig().getConfig().isSet("String_Node_Str" + arena + "String_Node_Str")) {
    return null;
  }
  Location b_=new Location(Bukkit.getServer().getWorld(pli.getArenasConfig().getConfig().getString("String_Node_Str" + arena + "String_Node_Str")),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"),pli.getArenasConfig().getConfig().getInt("String_Node_Str" + arena + "String_Node_Str"));
  if (b_ != null) {
    if (b_.getWorld() != null) {
      if (b_.getBlock().getState() != null) {
        BlockState bs=b_.getBlock().getState();
        Sign s_=null;
        if (bs instanceof Sign) {
          s_=(Sign)bs;
        }
        return s_;
      }
    }
  }
  return null;
}
Program: 86095
Project: 86095
Buggy source:
@EventHandler public void onEntityDamageByEntity(EntityDamageByEntityEvent event){
  if (event.getEntity() instanceof Player) {
    Player p=(Player)event.getEntity();
    Player attacker;
    if (event.getDamager() instanceof Projectile) {
      Projectile projectile=(Projectile)event.getDamager();
      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())) {
        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())) {
        Arena a=(Arena)pli.global_players.get(p.getName());
        if (a.getArenaState() == ArenaState.INGAME) {
          a.lastdamager.put(p.getName(),attacker.getName());
        }
      }
    }
  }
}
Program: 86096
Project: 86096
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));
    ItemMeta im=item.getItemMeta();
    im.setDisplayName(item_displaynames.get(i));
    if (item_enchid.get(i) > -1) {
      im.addEnchant(Enchantment.getById(item_enchid.get(i)),item_enchid_lv.get(i),true);
      item.addEnchantment(Enchantment.getById(item_enchid.get(i)),item_enchid_lv.get(i));
      item.addUnsafeEnchantment(Enchantment.getById(item_enchid.get(i)),item_enchid_lv.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));
    }
    System.out.println(item);
    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) {
      Potion potion=Potion.fromDamage(item.getDurability() & 0x3F);
      System.out.println("String_Node_Str" + item_splash.get(i));
      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;
    }
    System.out.println(item);
    ret.add(item);
  }
  return ret;
}
Program: 86097
Project: 86097
Buggy source:
public void spectateArcade(String playername){
  Player p=Bukkit.getPlayer(playername);
  pli.global_players.put(playername,currentarena);
  pli.global_arcade_spectator.put(playername,currentarena);
  Util.teleportPlayerFixed(p,currentarena.getSpawns().get(0).clone().add(0D,30D,0D));
  p.setAllowFlight(true);
  p.setFlying(true);
}

Fixed version (ground truth):
public void spectateArcade(String playername){
  Player p=Bukkit.getPlayer(playername);
  pli.global_players.put(playername,currentarena);
  pli.global_arcade_spectator.put(playername,currentarena);
  Util.teleportPlayerFixed(p,currentarena.getSpawns().get(0).clone().add(0D,30D,0D));
  p.setAllowFlight(true);
  p.setFlying(true);
  SpectatorManager.setSpectate(p,true);
}
Program: 86099
Project: 86099
Buggy source:
public static void setup(){
  if (Bukkit.getScoreboardManager().getMainScoreboard().getTeam("String_Node_Str") == null) {
    Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("String_Node_Str");
  }
  Bukkit.getScoreboardManager().getMainScoreboard().getTeam("String_Node_Str").setCanSeeFriendlyInvisibles(true);
}

Fixed version (ground truth):
public static void setup(){
  if (Bukkit.getScoreboardManager().getMainScoreboard().getTeam("String_Node_Str") == null) {
    Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("String_Node_Str");
  }
  Bukkit.getScoreboardManager().getMainScoreboard().getTeam("String_Node_Str").setCanSeeFriendlyInvisibles(true);
  clear();
}
Program: 86100
Project: 86100
Buggy source:
public void leaveArcade(final String playername){
  if (players.contains(playername)) {
    players.remove(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());
      }
    }
  }
,20L);
  clean();
  if (players.size() < 2) {
    stopArcade();
  }
}

Fixed version (ground truth):
public void leaveArcade(final String playername){
  if (players.contains(playername)) {
    players.remove(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());
        SpectatorManager.setSpectate(p,false);
        if (!p.isOp()) {
          p.setFlying(false);
          p.setAllowFlight(false);
        }
      }
    }
  }
,20L);
  clean();
  if (players.size() < 2) {
    stopArcade();
  }
}
Program: 86102
Project: 86102
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;
      for (      String p_ : temp) {
        Bukkit.getPlayer(p_).sendMessage(mg.getMessagesConfig().arcade_next_minigame.replaceAll("String_Node_Str",mg.getArenaListener().getName()));
        a.joinPlayerLobby(p_,ai,plugin.getConfig().getBoolean("String_Node_Str"),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;
      for (      String p_ : temp) {
        Bukkit.getPlayer(p_).sendMessage(mg.getMessagesConfig().arcade_next_minigame.replaceAll("String_Node_Str",mg.getArenaListener().getName()));
        a.joinPlayerLobby(p_,ai,plugin.getConfig().getBoolean("String_Node_Str"),false);
        SpectatorManager.setSpectate(Bukkit.getPlayer(p_),false);
      }
    }
 else {
      nextMinigame(5L);
    }
  }
 else {
    nextMinigame(5L);
  }
}
Program: 86103
Project: 86103
Buggy source:
public void createTables(){
  if (!plugin.getConfig().getBoolean("String_Node_Str")) {
    return;
  }
  if (!mysql) {
  }
  Connection c=MySQL.open();
  try {
    c.createStatement().execute("String_Node_Str" + plugin.getConfig().getString("String_Node_Str"));
    c.createStatement().execute("String_Node_Str" + plugin.getName() + "String_Node_Str");
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void createTables(){
  if (!plugin.getConfig().getBoolean("String_Node_Str")) {
    return;
  }
  if (!mysql) {
  }
  Connection c=MySQL.open();
  try {
    c.createStatement().execute("String_Node_Str" + plugin.getConfig().getString("String_Node_Str") + "String_Node_Str");
    c.createStatement().execute("String_Node_Str" + plugin.getName() + "String_Node_Str");
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
}
Program: 86104
Project: 86104
Buggy source:
/** 
 * Will shuffle all arenas and join the next available arena
 * @param players
 */
public void nextArenaOnMapRotation(ArrayList<String> players){
  ArrayList<Arena> arenas=pli.getArenas();
  Collections.shuffle(arenas);
  for (  Arena a : arenas) {
    if (a.getArenaState() == ArenaState.JOIN && a != this) {
      System.out.println(plugin.getName() + "String_Node_Str" + a.getName());
      for (      String p_ : players) {
        a.joinPlayerLobby(p_,false);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Will shuffle all arenas and join the next available arena
 * @param players
 */
public void nextArenaOnMapRotation(ArrayList<String> players){
  ArrayList<Arena> arenas=pli.getArenas();
  Collections.shuffle(arenas);
  for (  Arena a : arenas) {
    if (a.getArenaState() == ArenaState.JOIN && a != this) {
      System.out.println(plugin.getName() + "String_Node_Str" + a.getName());
      for (      String p_ : players) {
        if (!a.containsPlayer(p_)) {
          a.joinPlayerLobby(p_,false);
        }
      }
    }
  }
}
Program: 86105
Project: 86105
Buggy source:
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(final String playername,boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  this.players.remove(playername);
  pli.global_players.remove(playername);
  if (fullLeave) {
    plugin.getConfig().set("String_Node_Str" + playername,playername);
    plugin.saveConfig();
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  Util.clearInv(p);
  p.getInventory().setContents(pinv.get(playername));
  p.getInventory().setArmorContents(pinv_armor.get(playername));
  p.updateInventory();
  p.setWalkSpeed(0.2F);
  p.removePotionEffect(PotionEffectType.JUMP);
  if (started) {
    pli.getRewardsInstance().giveWinReward(playername);
  }
  pli.global_players.remove(playername);
  if (pli.global_lost.containsKey(playername)) {
    pli.global_lost.remove(playername);
  }
  Util.updateSign(plugin,this);
  final String arenaname=this.getName();
  final Arena a=this;
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      Util.teleportPlayerFixed(p,a.mainlobby);
      p.setFlying(false);
      if (!p.isOp()) {
        p.setAllowFlight(false);
      }
      if (pgamemode.containsKey(p.getName())) {
        p.setGameMode(pgamemode.get(p.getName()));
      }
      try {
        pli.scoreboardManager.removeScoreboard(arenaname,p);
      }
 catch (      Exception e) {
      }
    }
  }
,5L);
  if (this.getAllPlayers().size() < 2) {
    this.stop();
  }
}

Fixed version (ground truth):
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(final String playername,boolean fullLeave){
  this.leavePlayerRaw(playername,fullLeave);
  if (this.getAllPlayers().size() < 2) {
    this.stop();
  }
}
Program: 86106
Project: 86106
Buggy source:
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(final String playername,boolean fullLeave){
  this.leavePlayerRaw(playername,fullLeave);
  if (this.getAllPlayers().size() < 2) {
    this.stop();
  }
}

Fixed version (ground truth):
public void leavePlayer(final String playername,boolean fullLeave,boolean endofGame){
  this.leavePlayerRaw(playername,fullLeave);
}
Program: 86107
Project: 86107
Buggy source:
/** 
 * Stops the arena and teleports all players to the mainlobby
 */
public void stop(){
  final Arena a=this;
  try {
    Bukkit.getScheduler().cancelTask(currenttaskid);
  }
 catch (  Exception e) {
  }
  this.setArenaState(ArenaState.RESTARTING);
  ArrayList<String> temp=new ArrayList<String>(this.getAllPlayers());
  for (  String p_ : temp) {
    leavePlayer(p_,false);
  }
  if (a.getArenaType() == ArenaType.REGENERATION) {
    reset();
  }
 else {
    a.setArenaState(ArenaState.JOIN);
    Util.updateSign(plugin,a);
  }
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      players.clear();
      pinv.clear();
      pinv_armor.clear();
    }
  }
,10L);
  started=false;
  if (plugin.getConfig().getBoolean("String_Node_Str")) {
    String[] cmds=plugin.getConfig().getString("String_Node_Str").split("String_Node_Str");
    for (    String cmd : cmds) {
      Bukkit.dispatchCommand(Bukkit.getConsoleSender(),cmd);
    }
  }
  if (plugin.getConfig().getBoolean("String_Node_Str")) {
    final String server=plugin.getConfig().getString("String_Node_Str");
    Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
      public void run(){
        for (        Player p : Bukkit.getOnlinePlayers()) {
          BungeeUtil.connectToServer(MinigamesAPI.getAPI(),p.getName(),server);
        }
      }
    }
,30L);
    return;
  }
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      if (ai != null) {
        ai.nextMinigame();
        ai=null;
      }
    }
  }
,10L);
}

Fixed version (ground truth):
/** 
 * Stops the arena and teleports all players to the mainlobby
 */
public void stop(){
  final Arena a=this;
  try {
    Bukkit.getScheduler().cancelTask(currenttaskid);
  }
 catch (  Exception e) {
  }
  this.setArenaState(ArenaState.RESTARTING);
  ArrayList<String> temp=new ArrayList<String>(this.getAllPlayers());
  for (  String p_ : temp) {
    leavePlayer(p_,false,true);
  }
  if (a.getArenaType() == ArenaType.REGENERATION) {
    reset();
  }
 else {
    a.setArenaState(ArenaState.JOIN);
    Util.updateSign(plugin,a);
  }
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      players.clear();
      pinv.clear();
      pinv_armor.clear();
    }
  }
,10L);
  started=false;
  if (plugin.getConfig().getBoolean("String_Node_Str")) {
    String[] cmds=plugin.getConfig().getString("String_Node_Str").split("String_Node_Str");
    for (    String cmd : cmds) {
      Bukkit.dispatchCommand(Bukkit.getConsoleSender(),cmd);
    }
  }
  if (plugin.getConfig().getBoolean("String_Node_Str")) {
    final String server=plugin.getConfig().getString("String_Node_Str");
    Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
      public void run(){
        for (        Player p : Bukkit.getOnlinePlayers()) {
          BungeeUtil.connectToServer(MinigamesAPI.getAPI(),p.getName(),server);
        }
      }
    }
,30L);
    return;
  }
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      if (ai != null) {
        ai.nextMinigame();
        ai=null;
      }
    }
  }
,10L);
}
Program: 86108
Project: 86108
Buggy source:
@EventHandler public void onPlayerDeath(PlayerDeathEvent event){
  if (pli.global_players.containsKey(event.getEntity().getName())) {
    event.getEntity().setHealth(20D);
    final Player p=event.getEntity();
    pli.global_lost.put(p.getName(),pli.global_players.get(p.getName()));
    final Arena arena=pli.global_players.get(p.getName());
    Bukkit.getScheduler().runTaskLater(MinigamesAPI.getAPI(),new Runnable(){
      public void run(){
        try {
          pli.global_players.get(p.getName()).spectate(p.getName());
          for (          String p_ : arena.getAllPlayers()) {
            if (Validator.isPlayerOnline(p_)) {
              Player p__=Bukkit.getPlayer(p_);
              p__.sendMessage(pli.getMessagesConfig().broadcast_players_left.replaceAll("String_Node_Str",arena.getPlayerCount()));
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
,5);
    int count=0;
    for (    String p_ : pli.global_players.keySet()) {
      if (Validator.isPlayerOnline(p_)) {
        if (pli.global_players.get(p_).getName().equalsIgnoreCase(arena.getName())) {
          if (!pli.global_lost.containsKey(p_)) {
            count++;
          }
        }
      }
    }
    if (count < 2) {
      arena.stop();
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerDeath(PlayerDeathEvent event){
  if (pli.global_players.containsKey(event.getEntity().getName())) {
    event.getEntity().setHealth(20D);
    final Player p=event.getEntity();
    pli.global_lost.put(p.getName(),pli.global_players.get(p.getName()));
    final Arena arena=pli.global_players.get(p.getName());
    Bukkit.getScheduler().runTaskLater(MinigamesAPI.getAPI(),new Runnable(){
      public void run(){
        try {
          if (pli.global_players.containsKey(p.getName())) {
            pli.global_players.get(p.getName()).spectate(p.getName());
          }
          for (          String p_ : arena.getAllPlayers()) {
            if (Validator.isPlayerOnline(p_)) {
              Player p__=Bukkit.getPlayer(p_);
              p__.sendMessage(pli.getMessagesConfig().broadcast_players_left.replaceAll("String_Node_Str",arena.getPlayerCount()));
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
,5);
    int count=0;
    for (    String p_ : pli.global_players.keySet()) {
      if (Validator.isPlayerOnline(p_)) {
        if (pli.global_players.get(p_).getName().equalsIgnoreCase(arena.getName())) {
          if (!pli.global_lost.containsKey(p_)) {
            count++;
          }
        }
      }
    }
    if (count < 2) {
      arena.stop();
    }
  }
}
Program: 86109
Project: 86109
Buggy source:
public boolean startArena(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.start(true);
      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",args[1]));
  }
  return true;
}

Fixed version (ground truth):
public boolean startArena(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.start(true);
      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;
}
Program: 86110
Project: 86110
Buggy source:
public boolean joinArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (args.length > 1) {
    Arena temp=pli.getArenaByName(args[1]);
    if (temp != null) {
      if (!temp.containsPlayer(p.getName())) {
        temp.joinPlayerLobby(p.getName());
      }
 else {
        p.sendMessage(pli.getMessagesConfig().arena_action.replaceAll("String_Node_Str",temp.getName()).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",args[1]));
  }
  return true;
}

Fixed version (ground truth):
public boolean joinArena(PluginInstance pli,CommandSender sender,String[] args,String uber_permission,String cmd,String action,JavaPlugin plugin,Player p){
  if (args.length > 1) {
    Arena temp=pli.getArenaByName(args[1]);
    if (temp != null) {
      if (!temp.containsPlayer(p.getName())) {
        temp.joinPlayerLobby(p.getName());
      }
 else {
        p.sendMessage(pli.getMessagesConfig().arena_action.replaceAll("String_Node_Str",temp.getName()).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;
}
Program: 86111
Project: 86111
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());
    a.leavePlayer(p.getName(),false);
    if (a.getArcadeInstance() != null) {
      a.getArcadeInstance().leaveArcade(p.getName());
    }
  }
 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());
    }
    a.leavePlayer(p.getName(),false);
  }
 else {
    sender.sendMessage(pli.getMessagesConfig().not_in_arena);
  }
  return true;
}
Program: 86112
Project: 86112
Buggy source:
public void setWins(String playername,int count){
  String uuid=Bukkit.getPlayer(playername).getUniqueId().toString();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().getConfig().set("String_Node_Str" + uuid + "String_Node_Str",count);
}

Fixed version (ground truth):
public void setWins(String playername,int count){
  String uuid=Bukkit.getPlayer(playername).getUniqueId().toString();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().getConfig().set("String_Node_Str" + uuid + "String_Node_Str",count);
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().saveConfig();
}
Program: 86113
Project: 86113
Buggy source:
public void setPoints(String playername,int count){
  String uuid=Bukkit.getPlayer(playername).getUniqueId().toString();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().getConfig().set("String_Node_Str" + uuid + "String_Node_Str",count);
}

Fixed version (ground truth):
public void setPoints(String playername,int count){
  String uuid=Bukkit.getPlayer(playername).getUniqueId().toString();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().getConfig().set("String_Node_Str" + uuid + "String_Node_Str",count);
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsConfig().saveConfig();
}
Program: 86114
Project: 86114
Buggy source:
public static void openGunMainEditGUI(final JavaPlugin plugin,String p,final String g){
  IconMenu iconm=new IconMenu("String_Node_Str",9,new IconMenu.OptionClickEventHandler(){
    @Override public void onOptionClick(    IconMenu.OptionClickEvent event){
      String d=event.getName();
      Player p=event.getPlayer();
      if (d.startsWith("String_Node_Str")) {
        setPlayerGunMain(plugin,p.getName(),g,true);
      }
 else       if (d.startsWith("String_Node_Str")) {
        setPlayerGunMain(plugin,p.getName(),g,false);
      }
      event.setWillClose(false);
      openGUI(plugin,p.getName());
    }
  }
,plugin);
  iconm.setOption(0,new ItemStack(Material.WOOL,1,(short)5),"String_Node_Str" + g + "String_Node_Str","String_Node_Str");
  iconm.setOption(8,new ItemStack(Material.WOOL,1,(short)14),"String_Node_Str" + g + "String_Node_Str","String_Node_Str");
  iconm.open(Bukkit.getPlayerExact(p));
}

Fixed version (ground truth):
public static void openGunMainEditGUI(final JavaPlugin plugin,String p,final String g){
  IconMenu iconm;
  if (lastmainediticonm.containsKey(p)) {
    iconm=lastmainediticonm.get(p);
  }
 else {
    iconm=new IconMenu("String_Node_Str",9,new IconMenu.OptionClickEventHandler(){
      @Override public void onOptionClick(      IconMenu.OptionClickEvent event){
        String d=event.getName();
        Player p=event.getPlayer();
        if (d.startsWith("String_Node_Str")) {
          setPlayerGunMain(plugin,p.getName(),g,true);
        }
 else         if (d.startsWith("String_Node_Str")) {
          setPlayerGunMain(plugin,p.getName(),g,false);
        }
        openGUI(plugin,p.getName());
        event.setWillClose(false);
        event.setWillDestroy(true);
      }
    }
,plugin);
  }
  iconm.setOption(0,new ItemStack(Material.WOOL,1,(short)5),"String_Node_Str" + g + "String_Node_Str","String_Node_Str");
  iconm.setOption(8,new ItemStack(Material.WOOL,1,(short)14),"String_Node_Str" + g + "String_Node_Str","String_Node_Str");
  iconm.open(Bukkit.getPlayerExact(p));
}
Program: 86115
Project: 86115
Buggy source:
public static void setPlayerGunMain(JavaPlugin plugin,String p,String g,boolean val){
  FileConfiguration config=MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().getConfig();
  String path="String_Node_Str" + p + "String_Node_Str"+ g+ "String_Node_Str";
  if (getPlayerAllMainGunsCount(plugin,p) > 1) {
    Bukkit.getPlayer(p).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().too_many_main_guns);
    return;
  }
  config.set(path,val);
  MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().saveConfig();
}

Fixed version (ground truth):
public static void setPlayerGunMain(JavaPlugin plugin,String p,String g,boolean val){
  FileConfiguration config=MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().getConfig();
  String path="String_Node_Str" + p + "String_Node_Str"+ g+ "String_Node_Str";
  if (getPlayerAllMainGunsCount(plugin,p) > 1 && val) {
    Bukkit.getPlayer(p).sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().too_many_main_guns);
    return;
  }
  config.set(path,val);
  MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().saveConfig();
}
Program: 86117
Project: 86117
Buggy source:
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  String d=event.getName();
  Player p=event.getPlayer();
  if (d.startsWith("String_Node_Str")) {
    setPlayerGunLevel(plugin,p.getName(),g,attribute,level,cost);
    p.sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().attributelevel_increased.replaceAll("String_Node_Str",attribute));
  }
  event.setWillClose(false);
  openGUI(plugin,p.getName());
}

Fixed version (ground truth):
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  String d=event.getName();
  Player p=event.getPlayer();
  if (d.startsWith("String_Node_Str")) {
    setPlayerGunLevel(plugin,p.getName(),g,attribute,level,cost);
    p.sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().attributelevel_increased.replaceAll("String_Node_Str",attribute));
  }
  openGUI(plugin,p.getName());
  event.setWillClose(false);
  event.setWillDestroy(true);
}
Program: 86118
Project: 86118
Buggy source:
public static void openUpgradeGUI(final JavaPlugin plugin,String p,final String g,final String attribute,final int level,final double cost){
  IconMenu iconm=new IconMenu("String_Node_Str",9,new IconMenu.OptionClickEventHandler(){
    @Override public void onOptionClick(    IconMenu.OptionClickEvent event){
      String d=event.getName();
      Player p=event.getPlayer();
      if (d.startsWith("String_Node_Str")) {
        setPlayerGunLevel(plugin,p.getName(),g,attribute,level,cost);
        p.sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().attributelevel_increased.replaceAll("String_Node_Str",attribute));
      }
      event.setWillClose(false);
      openGUI(plugin,p.getName());
    }
  }
,plugin);
  iconm.setOption(0,new ItemStack(Material.WOOL,1,(short)5),"String_Node_Str" + attribute + "String_Node_Str","String_Node_Str");
  iconm.setOption(8,new ItemStack(Material.WOOL,1,(short)14),"String_Node_Str" + attribute + "String_Node_Str","String_Node_Str");
  iconm.open(Bukkit.getPlayerExact(p));
}

Fixed version (ground truth):
public static void openUpgradeGUI(final JavaPlugin plugin,String p,final String g,final String attribute,final int level,final double cost){
  IconMenu iconm;
  if (lastupgradeiconm.containsKey(p)) {
    iconm=lastupgradeiconm.get(p);
  }
 else {
    iconm=new IconMenu("String_Node_Str",9,new IconMenu.OptionClickEventHandler(){
      @Override public void onOptionClick(      IconMenu.OptionClickEvent event){
        String d=event.getName();
        Player p=event.getPlayer();
        if (d.startsWith("String_Node_Str")) {
          setPlayerGunLevel(plugin,p.getName(),g,attribute,level,cost);
          p.sendMessage(MinigamesAPI.getAPI().pinstances.get(plugin).getMessagesConfig().attributelevel_increased.replaceAll("String_Node_Str",attribute));
        }
        openGUI(plugin,p.getName());
        event.setWillClose(false);
        event.setWillDestroy(true);
      }
    }
,plugin);
  }
  iconm.setOption(0,new ItemStack(Material.WOOL,1,(short)5),"String_Node_Str" + attribute + "String_Node_Str","String_Node_Str");
  iconm.setOption(8,new ItemStack(Material.WOOL,1,(short)14),"String_Node_Str" + attribute + "String_Node_Str","String_Node_Str");
  iconm.open(Bukkit.getPlayerExact(p));
}
Program: 86119
Project: 86119
Buggy source:
public static void setPlayerGunLevel(JavaPlugin plugin,String p,String g,String attribute,int level,double cost){
  int credits=MinigamesAPI.getAPI().pinstances.get(plugin).getStatsInstance().getPoints(p);
  FileConfiguration config=MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().getConfig();
  String path="String_Node_Str" + p + "String_Node_Str"+ g+ "String_Node_Str";
  config.set(path + attribute,level);
  MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().saveConfig();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsInstance().setPoints(p,(int)(cost - credits));
}

Fixed version (ground truth):
public static void setPlayerGunLevel(JavaPlugin plugin,String p,String g,String attribute,int level,double cost){
  int credits=MinigamesAPI.getAPI().pinstances.get(plugin).getStatsInstance().getPoints(p);
  FileConfiguration config=MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().getConfig();
  String path="String_Node_Str" + p + "String_Node_Str"+ g+ "String_Node_Str";
  config.set(path + attribute,level);
  MinigamesAPI.getAPI().pinstances.get(plugin).getGunsConfig().saveConfig();
  MinigamesAPI.getAPI().pinstances.get(plugin).getStatsInstance().setPoints(p,(int)(credits - cost));
}
Program: 86120
Project: 86120
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",args[1]));
  }
  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 {
    sender.sendMessage(pli.getMessagesConfig().arena_invalid.replaceAll("String_Node_Str","String_Node_Str"));
  }
  return true;
}
Program: 86121
Project: 86121
Buggy source:
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(String playername,boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  this.players.remove(playername);
  MinigamesAPI.global_players.remove(playername);
  if (fullLeave) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  Util.clearInv(p);
  p.getInventory().setContents(pinv.get(playername));
  p.getInventory().setArmorContents(pinv_armor.get(playername));
  p.updateInventory();
  MinigamesAPI.getAPI().pinstances.get(plugin).getRewardsInstance().giveReward(playername);
  MinigamesAPI.global_players.remove(playername);
  final String arenaname=this.getName();
  Util.teleportPlayerFixed(p,this.mainlobby);
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      p.setFlying(false);
      if (!p.isOp()) {
        p.setAllowFlight(false);
      }
      if (pgamemode.containsKey(p.getName())) {
        p.setGameMode(pgamemode.get(p.getName()));
      }
      try {
        MinigamesAPI.getAPI().pinstances.get(plugin).scoreboardManager.removeScoreboard(arenaname,p);
      }
 catch (      Exception e) {
      }
    }
  }
,5L);
  if (this.getAllPlayers().size() < 1) {
    this.stop();
  }
}

Fixed version (ground truth):
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(String playername,boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  this.players.remove(playername);
  MinigamesAPI.global_players.remove(playername);
  if (fullLeave) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  Util.clearInv(p);
  p.getInventory().setContents(pinv.get(playername));
  p.getInventory().setArmorContents(pinv_armor.get(playername));
  p.updateInventory();
  p.setWalkSpeed(0.2F);
  MinigamesAPI.getAPI().pinstances.get(plugin).getRewardsInstance().giveReward(playername);
  MinigamesAPI.global_players.remove(playername);
  final String arenaname=this.getName();
  Util.teleportPlayerFixed(p,this.mainlobby);
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      p.setFlying(false);
      if (!p.isOp()) {
        p.setAllowFlight(false);
      }
      if (pgamemode.containsKey(p.getName())) {
        p.setGameMode(pgamemode.get(p.getName()));
      }
      try {
        MinigamesAPI.getAPI().pinstances.get(plugin).scoreboardManager.removeScoreboard(arenaname,p);
      }
 catch (      Exception e) {
      }
    }
  }
,5L);
  if (this.getAllPlayers().size() < 1) {
    this.stop();
  }
}
Program: 86122
Project: 86122
Buggy source:
/** 
 * Saves a given arena if it was set up properly.
 * @return Arena or null if setup failed
 */
public Arena saveArena(JavaPlugin plugin,String arenaname){
  if (!Validator.isArenaValid(plugin,arenaname)) {
    Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "String_Node_Str" + arenaname+ "String_Node_Str");
    return null;
  }
  PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
  if (pli.getArenaByName(arenaname) != null) {
    pli.removeArenaByName(arenaname);
  }
  Arena a=Util.initArena(plugin,arenaname);
  this.setArenaVIP(plugin,arenaname,false);
  pli.addArena(a);
  return a;
}

Fixed version (ground truth):
/** 
 * Saves a given arena if it was set up properly.
 * @return Arena or null if setup failed
 */
public Arena saveArena(JavaPlugin plugin,String arenaname){
  if (!Validator.isArenaValid(plugin,arenaname)) {
    Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "String_Node_Str" + arenaname+ "String_Node_Str");
    return null;
  }
  PluginInstance pli=MinigamesAPI.getAPI().pinstances.get(plugin);
  if (pli.getArenaByName(arenaname) != null) {
    pli.removeArenaByName(arenaname);
  }
  Arena a=Util.initArena(plugin,arenaname);
  if (a.getArenaType() == ArenaType.REGENERATION) {
    if (Util.isComponentForArenaValid(plugin,arenaname,"String_Node_Str")) {
      Util.saveArenaToFile(plugin,arenaname);
    }
 else {
      Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
  this.setArenaVIP(plugin,arenaname,false);
  pli.addArena(a);
  return a;
}
Program: 86123
Project: 86123
Buggy source:
public static void saveArenaToFile(JavaPlugin plugin,String arena){
  File f=new File(plugin.getDataFolder() + "String_Node_Str" + arena);
  Cuboid c=new Cuboid(Util.getComponentForArena(plugin,arena,"String_Node_Str","String_Node_Str"),Util.getComponentForArena(plugin,arena,"String_Node_Str","String_Node_Str"));
  Location start=c.getLowLoc();
  Location end=c.getHighLoc();
  int width=end.getBlockX() - start.getBlockX();
  int length=end.getBlockZ() - start.getBlockZ();
  int height=end.getBlockY() - start.getBlockY();
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str" + Integer.toString(width) + "String_Node_Str"+ Integer.toString(height)+ "String_Node_Str"+ Integer.toString(length));
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str" + Integer.toString(width * height * length));
  FileOutputStream fos;
  ObjectOutputStream oos=null;
  try {
    fos=new FileOutputStream(f);
    oos=new BukkitObjectOutputStream(fos);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  for (int i=0; i <= width; i++) {
    for (int j=0; j <= height; j++) {
      for (int k=0; k <= length; k++) {
        Block change=c.getWorld().getBlockAt(start.getBlockX() + i,start.getBlockY() + j,start.getBlockZ() + k);
        ArenaBlock bl=new ArenaBlock(change);
        try {
          oos.writeObject(bl);
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  try {
    oos.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str");
}

Fixed version (ground truth):
public static void saveArenaToFile(JavaPlugin plugin,String arena){
  File f=new File(plugin.getDataFolder() + "String_Node_Str" + arena);
  Cuboid c=new Cuboid(Util.getComponentForArena(plugin,arena,"String_Node_Str"),Util.getComponentForArena(plugin,arena,"String_Node_Str"));
  Location start=c.getLowLoc();
  Location end=c.getHighLoc();
  int width=end.getBlockX() - start.getBlockX();
  int length=end.getBlockZ() - start.getBlockZ();
  int height=end.getBlockY() - start.getBlockY();
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str" + Integer.toString(width) + "String_Node_Str"+ Integer.toString(height)+ "String_Node_Str"+ Integer.toString(length));
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str" + Integer.toString(width * height * length));
  FileOutputStream fos;
  ObjectOutputStream oos=null;
  try {
    fos=new FileOutputStream(f);
    oos=new BukkitObjectOutputStream(fos);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  for (int i=0; i <= width; i++) {
    for (int j=0; j <= height; j++) {
      for (int k=0; k <= length; k++) {
        Block change=c.getWorld().getBlockAt(start.getBlockX() + i,start.getBlockY() + j,start.getBlockZ() + k);
        ArenaBlock bl=new ArenaBlock(change);
        try {
          oos.writeObject(bl);
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  try {
    oos.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  MinigamesAPI.getAPI().getLogger().info("String_Node_Str");
}