nus-yam/ex-repair huggingface dataset:
Program: 93987
Project: 93987
Buggy source:
public boolean register(Player theplayer,String password,String email,String ipAddress) throws IOException, SQLException {
  if (password.length() < Integer.parseInt(Config.password_minimum)) {
    Messages.sendMessage(Message.password_minimum,theplayer,null);
    return false;
  }
 else   if (password.length() > Integer.parseInt(Config.password_maximum)) {
    Messages.sendMessage(Message.password_maximum,theplayer,null);
    return false;
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.connect();
  }
  String player=theplayer.getName();
  if (!Util.checkFilter("String_Node_Str",password)) {
    Messages.sendMessage(Message.filter_password,theplayer,null);
  }
 else {
    if (Util.checkScript("String_Node_Str",Config.script_name,player,password,email,ipAddress)) {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
    }
 else {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
    }
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.close();
  }
  return true;
}

Fixed version (ground truth):
public boolean register(Player theplayer,String password,String email,String ipAddress) throws IOException, SQLException {
  if (password.length() < Integer.parseInt(Config.password_minimum)) {
    Messages.sendMessage(Message.password_minimum,theplayer,null);
    return false;
  }
 else   if (password.length() > Integer.parseInt(Config.password_maximum)) {
    Messages.sendMessage(Message.password_maximum,theplayer,null);
    return false;
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.connect();
  }
  String player=theplayer.getName();
  if (!Util.checkFilter("String_Node_Str",password)) {
    Messages.sendMessage(Message.filter_password,theplayer,null);
  }
 else {
    if (Util.checkScript("String_Node_Str",Config.script_name,player,password,email,ipAddress)) {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
    }
 else {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
      if (!Config.database_keepalive) {
        Util.databaseManager.close();
      }
      return false;
    }
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.close();
  }
  return true;
}
Program: 93989
Project: 93989
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      event.getPlayer().teleport(event.getFrom());
    }
  }
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
        if (jointime + 1 < Util.timeStamp()) {
          this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}
Program: 93990
Project: 93990
Buggy source:
public static Location landLocation(Location location){
  while (location.getBlock().getType().getId() == 0) {
    location.setY(location.getY() - 1);
  }
  location.setY(location.getY() + 1);
  return location;
}

Fixed version (ground truth):
public static Location landLocation(Location location){
  while (location.getBlock().getType().getId() == 0) {
    location.setY(location.getY() - 1);
  }
  location.setY(location.getY() + 2);
  return location;
}
Program: 93992
Project: 93992
Buggy source:
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      EBean.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  MySQL.close();
}

Fixed version (ground truth):
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  MySQL.close();
}
Program: 93996
Project: 93996
Buggy source:
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv=new ItemStack[36];
    player.getInventory().setContents(theinv);
  }
  Processes.Logout(player);
}

Fixed version (ground truth):
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_enabled && Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player,true);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv=new ItemStack[36];
    player.getInventory().setContents(theinv);
  }
  Processes.Logout(player);
}
Program: 93997
Project: 93997
Buggy source:
public void checkTimeout(Player player){
  Util.logging.Debug("String_Node_Str");
  EBean eBeanClass=EBean.checkPlayer(player);
  int timeoutid=eBeanClass.getTimeoutid();
  if (plugin.isAuthorized(player) == false && (AuthDB.AuthDB_Timeouts.containsKey(player.getName()) || timeoutid != 0)) {
    eBeanClass.setTimeoutid(0);
    EBean.save(eBeanClass);
    if (plugin.isRegistered("String_Node_Str",player.getName())) {
      Messages.sendMessage(Message.login_timeout,player,null);
    }
 else {
      Messages.sendMessage(Message.register_timeout,player,null);
    }
  }
}

Fixed version (ground truth):
public void checkTimeout(Player player){
  Util.logging.Debug("String_Node_Str");
  EBean eBeanClass=EBean.checkPlayer(player,true);
  int timeoutid=eBeanClass.getTimeoutid();
  if (plugin.isAuthorized(player) == false && (AuthDB.AuthDB_Timeouts.containsKey(player.getName()) || timeoutid != 0)) {
    eBeanClass.setTimeoutid(0);
    EBean.save(eBeanClass);
    if (plugin.isRegistered("String_Node_Str",player.getName())) {
      Messages.sendMessage(Message.login_timeout,player,null);
    }
 else {
      Messages.sendMessage(Message.register_timeout,player,null);
    }
  }
}
Program: 94000
Project: 94000
Buggy source:
public void popGUI(Player player){
  ContribPlayer contribPlayer=(ContribPlayer)player;
  if (contribPlayer.isBukkitContribEnabled()) {
    PopupScreen popup=new GenericPopup();
    contribPlayer.getMainScreen().attachPopupScreen(popup);
    contribPlayer.getMainScreen().attachWidget((new GenericTexture("String_Node_Str")).setX(250).setY(75).setHeight(128).setWidth(64));
    popup.attachWidget((new GenericButton()).setText("String_Node_Str").setWidth(200).setHeight(20).setX(100).setY(100));
  }
}

Fixed version (ground truth):
public void popGUI(Player player){
  if (Config.hasBukkitContrib) {
    ContribPlayer contribPlayer=(ContribPlayer)player;
    if (contribPlayer.isBukkitContribEnabled()) {
      PopupScreen popup=new GenericPopup();
      contribPlayer.getMainScreen().attachPopupScreen(popup);
      popup.attachWidget((new ChatTextBox()).setWidth(300).setHeight(20).setX(100).setY(30));
      Button button=new GenericButton();
      button.setText("String_Node_Str");
      button.setCentered(true);
      button.setWidth(200).setHeight(20).setX(100).setY(100);
      button.setHoverText("String_Node_Str");
      popup.attachWidget(button);
    }
  }
}
Program: 94006
Project: 94006
Buggy source:
public static ItemStack[] getInventory(Player player){
  EBean eBeanClass=EBean.find(player);
  if (eBeanClass != null) {
    String data=eBeanClass.getInventory();
    if (data != "String_Node_Str" && data != null) {
      String[] inv=Util.split(data,"String_Node_Str");
      ItemStack[] inventory=new ItemStack[36];
      for (int i=0; i < inv.length; i++) {
        String line=inv[i];
        String[] split=line.split("String_Node_Str");
        if (split.length == 4) {
          int type=Integer.valueOf(split[0]).intValue();
          inventory[i]=new ItemStack(type,Integer.valueOf(split[1]).intValue());
          short dur=Short.valueOf(split[3]).shortValue();
          if (dur > 0) {
            inventory[i].setDurability(dur);
          }
          byte dd;
          if (split[2].length() == 0) {
            dd=0;
          }
 else {
            dd=Byte.valueOf(split[2]).byteValue();
          }
          Material mat=Material.getMaterial(type);
          if (mat == null) {
            inventory[i].setData(new MaterialData(type,dd));
          }
 else {
            inventory[i].setData(mat.getNewData(dd));
          }
        }
      }
      eBeanClass.setInventory(null);
      AuthDB.database.save(eBeanClass);
      return inventory;
    }
  }
  return null;
}

Fixed version (ground truth):
public static ItemStack[] getInventory(Player player){
  EBean eBeanClass=EBean.find(player);
  if (eBeanClass != null) {
    String data=eBeanClass.getInventory();
    if (data != "String_Node_Str" && data != null) {
      String[] inv=Util.split(data,"String_Node_Str");
      ItemStack[] inventory;
      if (Config.hasBackpack) {
        inventory=new ItemStack[252];
      }
 else {
        inventory=new ItemStack[36];
      }
      for (int i=0; i < inv.length; i++) {
        String line=inv[i];
        String[] split=line.split("String_Node_Str");
        if (split.length == 4) {
          int type=Integer.valueOf(split[0]).intValue();
          inventory[i]=new ItemStack(type,Integer.valueOf(split[1]).intValue());
          short dur=Short.valueOf(split[3]).shortValue();
          if (dur > 0) {
            inventory[i].setDurability(dur);
          }
          byte dd;
          if (split[2].length() == 0) {
            dd=0;
          }
 else {
            dd=Byte.valueOf(split[2]).byteValue();
          }
          Material mat=Material.getMaterial(type);
          if (mat == null) {
            inventory[i].setData(new MaterialData(type,dd));
          }
 else {
            inventory[i].setData(mat.getNewData(dd));
          }
        }
      }
      eBeanClass.setInventory(null);
      AuthDB.database.save(eBeanClass);
      return inventory;
    }
  }
  return null;
}
Program: 94007
Project: 94007
Buggy source:
public boolean register(Player theplayer,String password,String email,String ipAddress) throws IOException, SQLException {
  if (password.length() < Integer.parseInt(Config.password_minimum)) {
    Messages.sendMessage(Message.password_minimum,theplayer,null);
    return false;
  }
 else   if (password.length() > Integer.parseInt(Config.password_maximum)) {
    Messages.sendMessage(Message.password_maximum,theplayer,null);
    return false;
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.connect();
  }
  String player=theplayer.getName();
  if (!Util.checkFilter("String_Node_Str",password)) {
    Messages.sendMessage(Message.filter_password,theplayer,null);
  }
 else {
    Util.checkScript("String_Node_Str",Config.script_name,player,password,email,ipAddress);
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.close();
  }
  return true;
}

Fixed version (ground truth):
public boolean register(Player theplayer,String password,String email,String ipAddress) throws IOException, SQLException {
  if (password.length() < Integer.parseInt(Config.password_minimum)) {
    Messages.sendMessage(Message.password_minimum,theplayer,null);
    return false;
  }
 else   if (password.length() > Integer.parseInt(Config.password_maximum)) {
    Messages.sendMessage(Message.password_maximum,theplayer,null);
    return false;
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.connect();
  }
  String player=theplayer.getName();
  if (!Util.checkFilter("String_Node_Str",password)) {
    Messages.sendMessage(Message.filter_password,theplayer,null);
  }
 else {
    if (Util.checkScript("String_Node_Str",Config.script_name,player,password,email,ipAddress)) {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
    }
 else {
      Util.logging.Debug("String_Node_Str" + theplayer.getName());
    }
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.close();
  }
  return true;
}
Program: 94010
Project: 94010
Buggy source:
public void onScreenClose(ScreenCloseEvent event){
  Util.logging.Debug("String_Node_Str");
  if (!AuthDB.isAuthorized(event.getPlayer())) {
    Util.logging.Debug("String_Node_Str");
    if (Util.toLoginMethod(Config.login_method).equalsIgnoreCase("String_Node_Str")) {
      Util.logging.Debug("String_Node_Str");
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
public void onScreenClose(ScreenCloseEvent event){
  if (!AuthDB.isAuthorized(event.getPlayer())) {
    if (Util.toLoginMethod(Config.login_method).equalsIgnoreCase("String_Node_Str")) {
      event.setCancelled(true);
    }
  }
}
Program: 94012
Project: 94012
Buggy source:
public static void sync(Player player){
  try {
    if (!Config.database_keepalive) {
      Util.databaseManager.connect();
    }
    EBean eBeanClass=checkPlayer(player.getName(),true);
    String registred=eBeanClass.getRegistred();
    if (!Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null)) {
      if (registred != null && registred.equalsIgnoreCase("String_Node_Str")) {
        Util.logging.Debug("String_Node_Str" + player.getName() + "String_Node_Str");
        eBeanClass.setRegistred("String_Node_Str");
        save(eBeanClass);
        registred="String_Node_Str";
      }
    }
    if (registred != null && registred.equalsIgnoreCase("String_Node_Str")) {
      Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null);
      Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null);
    }
    if (!Config.database_keepalive) {
      Util.databaseManager.close();
    }
  }
 catch (  SQLException e) {
    Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
  }
}

Fixed version (ground truth):
public static void sync(Player player){
  try {
    if (!Config.database_keepalive) {
      Util.databaseManager.connect();
    }
    EBean eBeanClass=checkPlayer(player.getName(),true);
    String registred=eBeanClass.getRegistred();
    if (Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null)) {
      eBeanClass.setRegistred("String_Node_Str");
      save(eBeanClass);
      registred="String_Node_Str";
    }
 else {
      if (registred != null && registred.equalsIgnoreCase("String_Node_Str")) {
        Util.logging.Debug("String_Node_Str" + player.getName() + "String_Node_Str");
        eBeanClass.setRegistred("String_Node_Str");
        save(eBeanClass);
        registred="String_Node_Str";
      }
    }
    if (registred != null && registred.equalsIgnoreCase("String_Node_Str")) {
      Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null);
      Util.checkScript("String_Node_Str",Config.script_name,player.getName(),null,null,null);
    }
    if (!Config.database_keepalive) {
      Util.databaseManager.close();
    }
  }
 catch (  SQLException e) {
    Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
  }
}
Program: 94014
Project: 94014
Buggy source:
public boolean checkGuest(Player player,boolean what){
  if (what && (this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false)) {
    return true;
  }
 else   if (Config.protection_notify && this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}

Fixed version (ground truth):
boolean checkGuest(Player player,boolean what){
  if (what) {
    if (this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
      return true;
    }
  }
 else   if (Config.protection_notify && !AuthDB.isAuthorized(player)) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}
Program: 94015
Project: 94015
Buggy source:
public boolean checkGuest(Player player,boolean what){
  if (what == true && this.plugin.isRegistered("String_Node_Str",player.getName()) == false) {
    return true;
  }
 else   if (Config.protection_notify && this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else   if (this.plugin.isRegistered("String_Node_Str",player.getName()) == true && plugin.isAuthorized(player) == true) {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
    return true;
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}

Fixed version (ground truth):
boolean checkGuest(Player player,boolean what){
  if (what) {
    if (this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
      return true;
    }
  }
 else   if (Config.protection_notify && !AuthDB.isAuthorized(player)) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else   if (this.plugin.isRegistered("String_Node_Str",player.getName()) == true && plugin.isAuthorized(player) == true) {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
    return true;
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}
Program: 94017
Project: 94017
Buggy source:
boolean checkGuest(Player player,boolean what){
  if (what) {
    if (this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
      return true;
    }
  }
 else   if (Config.protection_notify && this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}

Fixed version (ground truth):
boolean checkGuest(Player player,boolean what){
  if (what) {
    if (this.plugin.isRegistered("String_Node_Str",player.getName()) == false || this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
      return true;
    }
  }
 else   if (Config.protection_notify && !AuthDB.isAuthorized(player)) {
    if (!this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      Messages.sendMessage(Message.guest_notauthorized,player,null);
    }
 else {
      if (this.plugin.AuthDB_RemindLogin.get(player.getName()) < Util.timeStamp()) {
        Messages.sendMessage(Message.guest_notauthorized,player,null);
        this.plugin.AuthDB_RemindLogin.put(player.getName(),Util.timeStamp() + Config.protection_delay);
      }
    }
  }
 else {
    if (Config.protection_notify && this.plugin.AuthDB_RemindLogin.containsKey(player.getName())) {
      this.plugin.AuthDB_RemindLogin.remove(player.getName());
    }
  }
  return false;
}
Program: 94018
Project: 94018
Buggy source:
public void storeInventory(Player player,ItemStack[] inventory,ItemStack[] armorinventory) throws IOException {
  StringBuffer inv=new StringBuffer();
  StringBuffer armorinv=new StringBuffer();
  for (short i=0; i < inventory.length; i=(short)(i + 1)) {
    if (inventory[i] != null) {
      inv.append(inventory[i].getTypeId() + "String_Node_Str" + inventory[i].getAmount()+ "String_Node_Str"+ (inventory[i].getData() == null ? "String_Node_Str" : Byte.valueOf(inventory[i].getData().getData()))+ "String_Node_Str"+ inventory[i].getDurability()+ "String_Node_Str");
    }
 else {
      inv.append("String_Node_Str");
    }
  }
  for (short i=0; i < armorinventory.length; i=(short)(i + 1)) {
    if (armorinventory[i] != null) {
      armorinv.append(armorinventory[i].getTypeId() + "String_Node_Str" + armorinventory[i].getAmount()+ "String_Node_Str"+ (armorinventory[i].getData() == null ? "String_Node_Str" : Byte.valueOf(armorinventory[i].getData().getData()))+ "String_Node_Str"+ armorinventory[i].getDurability()+ "String_Node_Str");
    }
 else {
      armorinv.append("String_Node_Str");
    }
  }
  EBean eBeanClass=EBean.find(player);
  eBeanClass.setInventory(inv.toString());
  eBeanClass.setArmorinventory(armorinv.toString());
  pluginManager.plugin.database.save(eBeanClass);
}

Fixed version (ground truth):
public void storeInventory(Player player,ItemStack[] inventory,ItemStack[] armorinventory) throws IOException {
  StringBuffer inv=new StringBuffer();
  StringBuffer armorinv=new StringBuffer();
  for (short i=0; i < inventory.length; i=(short)(i + 1)) {
    if (inventory[i] != null) {
      inv.append(inventory[i].getTypeId() + "String_Node_Str" + inventory[i].getAmount()+ "String_Node_Str"+ (inventory[i].getData() == null ? "String_Node_Str" : Byte.valueOf(inventory[i].getData().getData()))+ "String_Node_Str"+ inventory[i].getDurability()+ "String_Node_Str");
    }
 else {
      inv.append("String_Node_Str");
    }
  }
  loggingManager.Debug("String_Node_Str" + player.getName() + "String_Node_Str"+ inv);
  for (short i=0; i < armorinventory.length; i=(short)(i + 1)) {
    if (armorinventory[i] != null) {
      armorinv.append(armorinventory[i].getTypeId() + "String_Node_Str" + armorinventory[i].getAmount()+ "String_Node_Str"+ (armorinventory[i].getData() == null ? "String_Node_Str" : Byte.valueOf(armorinventory[i].getData().getData()))+ "String_Node_Str"+ armorinventory[i].getDurability()+ "String_Node_Str");
    }
 else {
      armorinv.append("String_Node_Str");
    }
  }
  loggingManager.Debug("String_Node_Str" + player.getName() + "String_Node_Str"+ armorinv);
  EBean eBeanClass=EBean.find(player);
  eBeanClass.setInventory(inv.toString());
  eBeanClass.setArmorinventory(armorinv.toString());
  pluginManager.plugin.database.save(eBeanClass);
}
Program: 94020
Project: 94020
Buggy source:
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_JoinTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  Util.databaseManager.close();
}

Fixed version (ground truth):
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_GUI_ScreenIDs.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_JoinTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  Util.databaseManager.close();
}
Program: 94021
Project: 94021
Buggy source:
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_enabled && Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player,true);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv;
    if (Config.hasBackpack) {
      theinv=new ItemStack[252];
    }
 else {
      theinv=new ItemStack[36];
    }
    player.getInventory().setContents(theinv);
  }
  Processes.Logout(player);
}

Fixed version (ground truth):
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (this.plugin.AuthDB_GUI_PasswordFieldIDs.containsKey(player.getName())) {
    this.plugin.AuthDB_GUI_PasswordFieldIDs.remove(player.getName());
  }
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_enabled && Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player,true);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv;
    if (Config.hasBackpack) {
      theinv=new ItemStack[252];
    }
 else {
      theinv=new ItemStack[36];
    }
    player.getInventory().setContents(theinv);
  }
  Processes.Quit(player);
}
Program: 94023
Project: 94023
Buggy source:
public void onScreenClose(ScreenCloseEvent event){
  if (!AuthDB.isAuthorized(event.getPlayer())) {
    if (Util.toLoginMethod(Config.login_method).equalsIgnoreCase("String_Node_Str")) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
public void onScreenClose(ScreenCloseEvent event){
  Util.logging.Debug("String_Node_Str");
  if (!AuthDB.isAuthorized(event.getPlayer())) {
    Util.logging.Debug("String_Node_Str");
    if (Util.toLoginMethod(Config.login_method).equalsIgnoreCase("String_Node_Str") && this.plugin.AuthDB_GUI_ScreenIDs.containsKey(event.getPlayer().getName())) {
      if (event.getScreen().getId().equals(this.plugin.AuthDB_GUI_ScreenIDs.get(event.getPlayer().getName()))) {
        Util.logging.Debug("String_Node_Str");
        event.setCancelled(true);
      }
    }
  }
  Util.logging.Debug("String_Node_Str");
}
Program: 94024
Project: 94024
Buggy source:
public void popGUI(SpoutPlayer spoutPlayer){
  PopupScreen popup=new GenericPopup();
  InGameHUD screen=spoutPlayer.getMainScreen();
  screen.attachPopupScreen(popup);
  showGUI(screen,false);
  Label pleaseLogin=new GenericLabel();
  pleaseLogin.setText("String_Node_Str");
  int offset=20;
  pleaseLogin.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2 + offset + 3).setY((screen.getHeight() - height) / 2 - (offset * 2));
  popup.attachWidget(AuthDB.plugin,pleaseLogin);
  Button button=new GenericButton("String_Node_Str");
  button.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2).setY((screen.getHeight() - height) / 2 + (offset / 2));
  popup.attachWidget(AuthDB.plugin,button);
  TextField textField=new GenericTextField();
  textField.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2).setY((screen.getHeight() - height) / 2 - offset);
  AuthDB.AuthDB_GUI_PasswordFieldIDs.put(spoutPlayer.getName(),textField.getId());
  popup.attachWidget(AuthDB.plugin,textField);
}

Fixed version (ground truth):
public void popGUI(SpoutPlayer spoutPlayer){
  PopupScreen popup=new GenericPopup();
  InGameHUD screen=spoutPlayer.getMainScreen();
  screen.attachPopupScreen(popup);
  showGUI(screen,false);
  Label pleaseLogin=new GenericLabel();
  pleaseLogin.setText("String_Node_Str");
  int offset=20;
  pleaseLogin.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2 + offset + 3).setY((screen.getHeight() - height) / 2 - (offset * 2));
  popup.attachWidget(AuthDB.plugin,pleaseLogin);
  Button button=new GenericButton("String_Node_Str");
  button.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2).setY((screen.getHeight() - height) / 2 + (offset / 2));
  popup.attachWidget(AuthDB.plugin,button);
  TextField textField=new GenericTextField();
  textField.setHeight(height).setWidth(width).setX((screen.getWidth() - width) / 2).setY((screen.getHeight() - height) / 2 - offset);
  AuthDB.AuthDB_GUI_PasswordFieldIDs.put(spoutPlayer.getName(),textField.getId());
  AuthDB.AuthDB_GUI_ScreenIDs.put(spoutPlayer.getName(),screen.getId());
  popup.attachWidget(AuthDB.plugin,textField);
}
Program: 94025
Project: 94025
Buggy source:
public boolean checkGUI(Player player){
  if (Config.hasSpout) {
    SpoutPlayer spoutPlayer=(SpoutPlayer)player;
    if (!AuthDB.AuthDB_GUI_PasswordFieldIDs.containsKey(player.getName()) && spoutPlayer.isSpoutCraftEnabled() && spoutPlayer.getVersion() >= 18) {
      popGUI(spoutPlayer);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkGUI(Player player){
  if (Config.hasSpout) {
    SpoutPlayer spoutPlayer=(SpoutPlayer)player;
    if (spoutPlayer.isSpoutCraftEnabled()) {
      popGUI(spoutPlayer);
      return true;
    }
  }
  return false;
}
Program: 94031
Project: 94031
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
        if (jointime + 1 < Util.timeStamp()) {
          this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
        if (jointime + 3 < Util.timeStamp()) {
          this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}
Program: 94036
Project: 94036
Buggy source:
public static boolean Login(Player player){
  if (!AuthDB.isAuthorized(player)) {
    long timestamp=Util.timeStamp();
    if (!AuthDB.AuthDB_AuthTime.containsKey(player.getName())) {
      AuthDB.AuthDB_AuthTime.put(player.getName(),timestamp);
    }
    AuthDB.authorizedNames.add(player.getName());
    AuthDB.AuthDB_PasswordTries.put(player.getName(),"String_Node_Str");
    EBean eBeanClass=EBean.checkPlayer(player,true);
    eBeanClass.setAuthorized("String_Node_Str");
    eBeanClass.setRegistred("String_Node_Str");
    if (!AuthDB.AuthDB_Authed.containsKey(Encryption.md5(player.getName()))) {
      AuthDB.AuthDB_Authed.put(Encryption.md5(player.getName()),"String_Node_Str");
    }
    if (Config.session_enabled) {
      if (!AuthDB.AuthDB_Sessions.containsKey(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)))) {
        AuthDB.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),timestamp);
      }
      eBeanClass.setSessiontime(timestamp);
    }
    AuthDB.database.save(eBeanClass);
    ItemStack[] inv=AuthDB.getInventory(player);
    if (inv != null) {
      player.getInventory().setContents(inv);
    }
    inv=AuthDB.getArmorInventory(player);
    if (inv != null) {
      player.getInventory().setArmorContents(inv);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean Login(Player player){
  if (!AuthDB.isAuthorized(player)) {
    long timestamp=Util.timeStamp();
    if (!AuthDB.AuthDB_AuthTime.containsKey(player.getName())) {
      AuthDB.AuthDB_AuthTime.put(player.getName(),timestamp);
    }
    AuthDB.authorizedNames.add(player.getName());
    AuthDB.AuthDB_PasswordTries.put(player.getName(),"String_Node_Str");
    EBean eBeanClass=EBean.checkPlayer(player,true);
    eBeanClass.setAuthorized("String_Node_Str");
    eBeanClass.setRegistred("String_Node_Str");
    if (!AuthDB.AuthDB_Authed.containsKey(Encryption.md5(player.getName()))) {
      AuthDB.AuthDB_Authed.put(Encryption.md5(player.getName()),"String_Node_Str");
    }
    if (Config.session_enabled) {
      if (!AuthDB.AuthDB_Sessions.containsKey(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)))) {
        AuthDB.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),timestamp);
        Util.logging.Debug("String_Node_Str" + player.getName());
      }
      eBeanClass.setSessiontime(timestamp);
    }
    AuthDB.database.save(eBeanClass);
    ItemStack[] inv=AuthDB.getInventory(player);
    if (inv != null) {
      player.getInventory().setContents(inv);
    }
    inv=AuthDB.getArmorInventory(player);
    if (inv != null) {
      player.getInventory().setArmorContents(inv);
    }
    return true;
  }
  return false;
}
Program: 94038
Project: 94038
Buggy source:
void CheckPermissions(){
  Plugin Check1=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (Check1 != null) {
    ZPermissions.hasPlugin=true;
  }
  Plugin Check2=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (Check2 != null) {
    if (ZPermissions.hasPlugin) {
      Util.logging.Info("String_Node_Str" + Check1.getDescription().getName() + "String_Node_Str"+ Check1.getDescription().getVersion()+ "String_Node_Str"+ Check2.getDescription().getName()+ "String_Node_Str"+ Check2.getDescription().getVersion());
      Util.logging.Info("String_Node_Str" + Check2.getDescription().getName() + "String_Node_Str"+ Check2.getDescription().getVersion());
    }
 else {
      Util.logging.Info("String_Node_Str" + Check2.getDescription().getName() + "String_Node_Str"+ Check2.getDescription().getVersion());
    }
    ZPermissions.hasPermissionsBukkit=true;
  }
 else {
    if (ZPermissions.hasPlugin) {
      Util.logging.Info("String_Node_Str" + Check1.getDescription().getName() + "String_Node_Str"+ Check1.getDescription().getVersion());
    }
 else {
      Util.logging.Info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
void CheckPermissions(){
  Plugin Check1=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (Check1 != null) {
    ZPermissions.hasPlugin=true;
  }
  Plugin Check2=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (Check2 != null) {
    if (ZPermissions.hasPlugin) {
      Util.logging.Info("String_Node_Str" + Check1.getDescription().getName() + "String_Node_Str"+ Check1.getDescription().getVersion()+ "String_Node_Str"+ Check2.getDescription().getName()+ "String_Node_Str"+ Check2.getDescription().getVersion());
      Util.logging.Info("String_Node_Str" + Check2.getDescription().getName() + "String_Node_Str"+ Check2.getDescription().getVersion());
    }
 else {
      Util.logging.Info("String_Node_Str" + Check2.getDescription().getName() + "String_Node_Str"+ Check2.getDescription().getVersion());
    }
    ZPermissions.hasPermissionsBukkit=true;
  }
 else {
    if (ZPermissions.hasPlugin) {
      ZPermissions.permissionsHandler=((Permissions)Check1).getHandler();
      Util.logging.Info("String_Node_Str" + Check1.getDescription().getName() + "String_Node_Str"+ Check1.getDescription().getVersion());
    }
 else {
      Util.logging.Info("String_Node_Str");
    }
  }
}
Program: 94039
Project: 94039
Buggy source:
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_enabled && Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player,true);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv=new ItemStack[36];
    player.getInventory().setContents(theinv);
  }
  Processes.Logout(player);
}

Fixed version (ground truth):
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  Messages.sendMessage(Message.left_server,player,null);
  if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {
    player.setHealth(20);
    player.teleport(player.getWorld().getSpawnLocation());
  }
  long thetimestamp=System.currentTimeMillis() / 1000;
  if (Config.session_enabled && Config.session_start.equalsIgnoreCase("String_Node_Str")) {
    this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)),thetimestamp);
    EBean EBeanClass=EBean.checkPlayer(player,true);
    EBeanClass.setSessiontime(thetimestamp);
    this.plugin.AuthDB_AuthTime.put(player.getName(),thetimestamp);
  }
  if (checkGuest(player,Config.guests_inventory) == false && this.plugin.isRegistered("String_Node_Str",player.getName()) == false && this.plugin.isRegistered("String_Node_Str",Util.checkOtherName(player.getName())) == false) {
    ItemStack[] theinv;
    if (Config.hasBackpack) {
      theinv=new ItemStack[252];
    }
 else {
      theinv=new ItemStack[36];
    }
    player.getInventory().setContents(theinv);
  }
  Processes.Logout(player);
}
Program: 94043
Project: 94043
Buggy source:
public boolean checkPassword(String player,String password){
  try {
    if (!Config.database_keepalive) {
      MySQL.connect();
    }
    password=Matcher.quoteReplacement(password);
    if (!Util.checkOtherName(player).equals(player)) {
      player=Util.checkOtherName(player);
    }
    if (Util.checkScript("String_Node_Str",Config.script_name,player,password,null,null)) {
      return true;
    }
    if (!Config.database_keepalive) {
      MySQL.close();
    }
  }
 catch (  SQLException e) {
    Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    Stop("String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
public boolean checkPassword(String player,String password){
  long start=Util.timeMS();
  try {
    if (!Config.database_keepalive) {
      MySQL.connect();
    }
    password=Matcher.quoteReplacement(password);
    if (!Util.checkOtherName(player).equals(player)) {
      player=Util.checkOtherName(player);
    }
    if (Util.checkScript("String_Node_Str",Config.script_name,player,password,null,null)) {
      long stop=Util.timeMS();
      Util.logging.timeUsage(stop - start,"String_Node_Str");
      return true;
    }
    if (!Config.database_keepalive) {
      MySQL.close();
    }
  }
 catch (  SQLException e) {
    Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    Stop("String_Node_Str");
  }
  long stop=Util.timeMS();
  Util.logging.timeUsage(stop - start,"String_Node_Str");
  return false;
}