Program: 86031
Project: 86031
Buggy source:
public void leavePlayerRaw(final String playername,final boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  final ArenaPlayer ap=ArenaPlayer.getPlayerInstance(playername);
  if (p == null) {
    return;
  }
  if (p.isDead()) {
    System.out.println(p.getName() + "String_Node_Str");
    Effects.playRespawn(p,plugin);
    Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
      public void run(){
        leavePlayerRaw(playername,fullLeave);
      }
    }
,10L);
    return;
  }
  this.players.remove(playername);
  if (pli.containsGlobalPlayer(playername)) {
    pli.global_players.remove(playername);
  }
  if (fullLeave) {
    plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str",playername);
    plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str",plugin.getName());
    if (plugin.getConfig().getBoolean("String_Node_Str")) {
      for (      ItemStack i : ap.getInventory()) {
        if (i != null) {
          plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str"+ Integer.toString((int)Math.round(Math.random() * 10000))+ i.getType().toString(),i);
        }
      }
    }
    plugin.saveConfig();
    try {
      if (pli.global_lost.containsKey(playername)) {
        pli.getSpectatorManager().showSpectator(p);
        pli.global_lost.remove(playername);
      }
 else {
        pli.getSpectatorManager().showSpectators(p);
      }
      if (pli.global_arcade_spectator.containsKey(playername)) {
        pli.global_arcade_spectator.remove(playername);
      }
      if (p != null) {
        p.removePotionEffect(PotionEffectType.JUMP);
        Util.teleportPlayerFixed(p,this.mainlobby);
        p.setFireTicks(0);
        p.setFlying(false);
        if (!p.isOp()) {
          p.setAllowFlight(false);
        }
        p.setGameMode(ap.getOriginalGamemode());
        p.setLevel(ap.getOriginalXplvl());
        p.getInventory().setContents(ap.getInventory());
        p.getInventory().setArmorContents(ap.getArmorInventory());
        p.updateInventory();
        p.setWalkSpeed(0.2F);
        p.setFoodLevel(20);
        p.setHealth(20D);
        p.removePotionEffect(PotionEffectType.JUMP);
        pli.getSpectatorManager().setSpectate(p,false);
        pli.getStatsInstance().updateSQLKillsDeathsAfter(p,this);
      }
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
    return;
  }
  Util.clearInv(p);
  p.setWalkSpeed(0.2F);
  p.setFoodLevel(20);
  p.setHealth(20D);
  p.setFireTicks(0);
  p.removePotionEffect(PotionEffectType.JUMP);
  pli.getSpectatorManager().setSpectate(p,false);
  Bukkit.getServer().getPluginManager().callEvent(new PlayerLeaveArenaEvent(p,plugin,this));
  for (  PotionEffect effect : p.getActivePotionEffects()) {
    if (effect != null) {
      p.removePotionEffect(effect.getType());
    }
  }
  for (  Entity e : p.getNearbyEntities(50D,50D,50D)) {
    if (e.getType() == EntityType.DROPPED_ITEM || e.getType() == EntityType.SLIME || e.getType() == EntityType.ZOMBIE || e.getType() == EntityType.SKELETON || e.getType() == EntityType.SPIDER || e.getType() == EntityType.CREEPER) {
      e.remove();
    }
  }
  if (pli.global_arcade_spectator.containsKey(playername)) {
    pli.global_arcade_spectator.remove(playername);
  }
  if (pli.getPClasses().containsKey(playername)) {
    pli.getPClasses().remove(playername);
  }
  Util.updateSign(plugin,this);
  final String arenaname=this.getInternalName();
  final Arena a=this;
  final boolean started_=started;
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      if (p != null) {
        if (ai == null || a.isArcadeMain()) {
          if (a.mainlobby != null) {
            Util.teleportPlayerFixed(p,a.mainlobby);
          }
 else           if (a.waitinglobby != null) {
            Util.teleportPlayerFixed(p,a.waitinglobby);
          }
        }
        p.setFireTicks(0);
        p.setFlying(false);
        if (!p.isOp()) {
          p.setAllowFlight(false);
        }
        p.setGameMode(ap.getOriginalGamemode());
        p.setLevel(ap.getOriginalXplvl());
        p.getInventory().setContents(ap.getInventory());
        p.getInventory().setArmorContents(ap.getArmorInventory());
        p.updateInventory();
        p.updateInventory();
        if (started_) {
          pli.getStatsInstance().updateSQLKillsDeathsAfter(p,a);
          if (!ap.isNoReward()) {
            pli.getRewardsInstance().giveWinReward(playername,a,temp_players,global_coin_multiplier);
          }
 else {
            ap.setNoReward(false);
          }
        }
        if (plugin.getConfig().getBoolean("String_Node_Str")) {
          Util.sendStatsMessage(pli,p);
        }
        if (pli.global_lost.containsKey(playername)) {
          pli.getSpectatorManager().showSpectator(p);
          pli.global_lost.remove(playername);
        }
 else {
          pli.getSpectatorManager().showSpectators(p);
        }
        try {
          pli.scoreboardManager.removeScoreboard(arenaname,p);
        }
 catch (        Exception e) {
        }
      }
    }
  }
,5L);
  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(){
        BungeeUtil.connectToServer(MinigamesAPI.getAPI(),p.getName(),server);
      }
    }
,30L);
    return;
  }
}

Fixed version (ground truth):
public void leavePlayerRaw(final String playername,final boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  final ArenaPlayer ap=ArenaPlayer.getPlayerInstance(playername);
  if (p == null) {
    return;
  }
  if (p.isDead()) {
    System.out.println(p.getName() + "String_Node_Str");
    Effects.playRespawn(p,plugin);
    Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
      public void run(){
        leavePlayerRaw(playername,fullLeave);
      }
    }
,10L);
    return;
  }
  this.players.remove(playername);
  if (pli.containsGlobalPlayer(playername)) {
    pli.global_players.remove(playername);
  }
  if (fullLeave) {
    plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str",playername);
    plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str",plugin.getName());
    if (plugin.getConfig().getBoolean("String_Node_Str")) {
      for (      ItemStack i : ap.getInventory()) {
        if (i != null) {
          plugin.getConfig().set("String_Node_Str" + playername + "String_Node_Str"+ Integer.toString((int)Math.round(Math.random() * 10000))+ i.getType().toString(),i);
        }
      }
    }
    plugin.saveConfig();
    try {
      if (pli.global_lost.containsKey(playername)) {
        pli.getSpectatorManager().showSpectator(p);
        pli.global_lost.remove(playername);
      }
 else {
        pli.getSpectatorManager().showSpectators(p);
      }
      if (pli.global_arcade_spectator.containsKey(playername)) {
        pli.global_arcade_spectator.remove(playername);
      }
      if (p != null) {
        p.removePotionEffect(PotionEffectType.JUMP);
        Util.teleportPlayerFixed(p,this.mainlobby);
        p.setFireTicks(0);
        p.setFlying(false);
        if (!p.isOp()) {
          p.setAllowFlight(false);
        }
        p.setGameMode(ap.getOriginalGamemode());
        p.setLevel(ap.getOriginalXplvl());
        p.getInventory().setContents(ap.getInventory());
        p.getInventory().setArmorContents(ap.getArmorInventory());
        p.updateInventory();
        p.setWalkSpeed(0.2F);
        p.setFoodLevel(20);
        p.setHealth(20D);
        p.removePotionEffect(PotionEffectType.JUMP);
        pli.getSpectatorManager().setSpectate(p,false);
        pli.getStatsInstance().updateSQLKillsDeathsAfter(p,this);
      }
      if (pli.getClassesHandler().lasticonm.containsKey(p.getName())) {
        IconMenu iconm=pli.getClassesHandler().lasticonm.get(p.getName());
        iconm.destroy();
        pli.getClassesHandler().lasticonm.remove(p.getName());
      }
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
    return;
  }
  Util.clearInv(p);
  p.setWalkSpeed(0.2F);
  p.setFoodLevel(20);
  p.setHealth(20D);
  p.setFireTicks(0);
  p.removePotionEffect(PotionEffectType.JUMP);
  pli.getSpectatorManager().setSpectate(p,false);
  Bukkit.getServer().getPluginManager().callEvent(new PlayerLeaveArenaEvent(p,plugin,this));
  for (  PotionEffect effect : p.getActivePotionEffects()) {
    if (effect != null) {
      p.removePotionEffect(effect.getType());
    }
  }
  for (  Entity e : p.getNearbyEntities(50D,50D,50D)) {
    if (e.getType() == EntityType.DROPPED_ITEM || e.getType() == EntityType.SLIME || e.getType() == EntityType.ZOMBIE || e.getType() == EntityType.SKELETON || e.getType() == EntityType.SPIDER || e.getType() == EntityType.CREEPER) {
      e.remove();
    }
  }
  if (pli.global_arcade_spectator.containsKey(playername)) {
    pli.global_arcade_spectator.remove(playername);
  }
  if (pli.getPClasses().containsKey(playername)) {
    pli.getPClasses().remove(playername);
  }
  Util.updateSign(plugin,this);
  if (pli.getClassesHandler().lasticonm.containsKey(p.getName())) {
    IconMenu iconm=pli.getClassesHandler().lasticonm.get(p.getName());
    iconm.destroy();
    pli.getClassesHandler().lasticonm.remove(p.getName());
  }
  final String arenaname=this.getInternalName();
  final Arena a=this;
  final boolean started_=started;
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      if (p != null) {
        if (ai == null || a.isArcadeMain()) {
          if (a.mainlobby != null) {
            Util.teleportPlayerFixed(p,a.mainlobby);
          }
 else           if (a.waitinglobby != null) {
            Util.teleportPlayerFixed(p,a.waitinglobby);
          }
        }
        p.setFireTicks(0);
        p.setFlying(false);
        if (!p.isOp()) {
          p.setAllowFlight(false);
        }
        p.setGameMode(ap.getOriginalGamemode());
        p.setLevel(ap.getOriginalXplvl());
        p.getInventory().setContents(ap.getInventory());
        p.getInventory().setArmorContents(ap.getArmorInventory());
        p.updateInventory();
        p.updateInventory();
        if (started_) {
          pli.getStatsInstance().updateSQLKillsDeathsAfter(p,a);
          if (!ap.isNoReward()) {
            pli.getRewardsInstance().giveWinReward(playername,a,temp_players,global_coin_multiplier);
          }
 else {
            ap.setNoReward(false);
          }
        }
        if (plugin.getConfig().getBoolean("String_Node_Str")) {
          Util.sendStatsMessage(pli,p);
        }
        if (pli.global_lost.containsKey(playername)) {
          pli.getSpectatorManager().showSpectator(p);
          pli.global_lost.remove(playername);
        }
 else {
          pli.getSpectatorManager().showSpectators(p);
        }
        try {
          pli.scoreboardManager.removeScoreboard(arenaname,p);
        }
 catch (        Exception e) {
        }
      }
    }
  }
,5L);
  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(){
        BungeeUtil.connectToServer(MinigamesAPI.getAPI(),p.getName(),server);
      }
    }
,30L);
    return;
  }
}