nus-yam/ex-repair huggingface dataset:
Program: 134045
Project: 134045
Buggy source:
/** 
 * Damages an Entity by amount of damage specified. Starts a  {@link EntityDamageByEntityEvent}.
 * @param player The player dealing the damage
 * @param entity The entity that is receiving the damage
 * @param damage The amount of damage to deal
 * @param ability The ability that is used to damage the entity
 */
public static void damageEntity(Player player,Entity entity,double damage,String ability){
  if (entity instanceof LivingEntity) {
    if (entity instanceof Player) {
      if (Commands.invincible.contains(((Player)entity).getName()))       return;
    }
    if (Bukkit.getPluginManager().isPluginEnabled("String_Node_Str")) {
      NCPExemptionManager.exemptPermanently(player,CheckType.FIGHT_REACH);
    }
    if (((LivingEntity)entity).getHealth() - damage <= 0 && entity instanceof Player && !entity.isDead()) {
      PlayerBendingDeathEvent event=new PlayerBendingDeathEvent((Player)entity,player,ability,damage);
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
    ((LivingEntity)entity).damage(damage,player);
    ((LivingEntity)entity).setLastDamageCause(new EntityDamageByEntityEvent(player,entity,DamageCause.CUSTOM,damage));
    if (Bukkit.getPluginManager().isPluginEnabled("String_Node_Str")) {
      NCPExemptionManager.unexempt(player);
    }
  }
}

Fixed version (ground truth):
/** 
 * Damages an Entity by amount of damage specified. Starts a  {@link EntityDamageByEntityEvent}.
 * @param player The player dealing the damage
 * @param entity The entity that is receiving the damage
 * @param damage The amount of damage to deal
 * @param ability The ability that is used to damage the entity
 */
public static void damageEntity(Player player,Entity entity,double damage,String ability){
  if (entity instanceof LivingEntity) {
    if (entity instanceof Player) {
      if (Commands.invincible.contains(entity.getName()))       return;
    }
    if (Bukkit.getPluginManager().isPluginEnabled("String_Node_Str")) {
      NCPExemptionManager.exemptPermanently(player,CheckType.FIGHT_REACH);
    }
    if (((LivingEntity)entity).getHealth() - damage <= 0 && entity instanceof Player && !entity.isDead()) {
      PlayerBendingDeathEvent event=new PlayerBendingDeathEvent((Player)entity,player,ability,damage);
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
    ((LivingEntity)entity).damage(damage,player);
    entity.setLastDamageCause(new EntityDamageByEntityEvent(player,entity,DamageCause.CUSTOM,damage));
    if (Bukkit.getPluginManager().isPluginEnabled("String_Node_Str")) {
      NCPExemptionManager.unexempt(player);
    }
  }
}
Program: 134046
Project: 134046
Buggy source:
/** 
 * Returns the top block based around loc. PositiveY is the maximum amount of distance it will check upward. Similarly, negativeY is for downward.
 */
public static Block getTopBlock(Location loc,int positiveY,int negativeY){
  Block block=loc.getBlock();
  Block blockHolder=block;
  int y=0;
  while (blockHolder.getType() != Material.AIR && Math.abs(y) < Math.abs(positiveY)) {
    y++;
    Block tempBlock=loc.clone().add(0,y,0).getBlock();
    if (tempBlock.getType() == Material.AIR)     return blockHolder;
    blockHolder=tempBlock;
  }
  while (blockHolder.getType() == Material.AIR && Math.abs(y) < Math.abs(negativeY)) {
    y--;
    blockHolder=loc.clone().add(0,y,0).getBlock();
    if (blockHolder.getType() != Material.AIR)     return blockHolder;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the top block based around loc. PositiveY is the maximum amount of distance it will check upward. Similarly, negativeY is for downward.
 */
public static Block getTopBlock(Location loc,int positiveY,int negativeY){
  Block blockHolder=loc.getBlock();
  int y=0;
  while (blockHolder.getType() != Material.AIR && Math.abs(y) < Math.abs(positiveY)) {
    y++;
    Block tempBlock=loc.clone().add(0,y,0).getBlock();
    if (tempBlock.getType() == Material.AIR)     return blockHolder;
    blockHolder=tempBlock;
  }
  while (blockHolder.getType() == Material.AIR && Math.abs(y) < Math.abs(negativeY)) {
    y--;
    blockHolder=loc.clone().add(0,y,0).getBlock();
    if (blockHolder.getType() != Material.AIR)     return blockHolder;
  }
  return null;
}
Program: 134047
Project: 134047
Buggy source:
public static boolean isAdjacentToThreeOrMoreSources(Block block){
  if (TempBlock.isTempBlock(block))   return false;
  int sources=0;
  byte full=0x0;
  BlockFace[] faces={BlockFace.EAST,BlockFace.WEST,BlockFace.NORTH,BlockFace.SOUTH};
  for (  BlockFace face : faces) {
    Block blocki=block.getRelative(face);
    if ((blocki.getType() == Material.LAVA || blocki.getType() == Material.STATIONARY_LAVA) && blocki.getData() == full && EarthPassive.canPhysicsChange(blocki))     sources++;
    if ((blocki.getType() == Material.WATER || blocki.getType() == Material.STATIONARY_WATER) && blocki.getData() == full && WaterManipulation.canPhysicsChange(blocki))     sources++;
    if (FreezeMelt.frozenblocks.containsKey(blocki)) {
    }
 else     if (blocki.getType() == Material.ICE) {
    }
  }
  if (sources >= 2)   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isAdjacentToThreeOrMoreSources(Block block){
  if (TempBlock.isTempBlock(block))   return false;
  int sources=0;
  byte full=0x0;
  BlockFace[] faces={BlockFace.EAST,BlockFace.WEST,BlockFace.NORTH,BlockFace.SOUTH};
  for (  BlockFace face : faces) {
    Block blocki=block.getRelative(face);
    if ((blocki.getType() == Material.LAVA || blocki.getType() == Material.STATIONARY_LAVA) && blocki.getData() == full && EarthPassive.canPhysicsChange(blocki))     sources++;
    if ((blocki.getType() == Material.WATER || blocki.getType() == Material.STATIONARY_WATER) && blocki.getData() == full && WaterManipulation.canPhysicsChange(blocki))     sources++;
    if (FreezeMelt.frozenblocks.containsKey(blocki)) {
    }
 else     if (blocki.getType() == Material.ICE) {
    }
  }
  return sources >= 2;
}
Program: 134049
Project: 134049
Buggy source:
public static boolean isSubAbility(String ability){
  if (AbilityModuleManager.subabilities.contains(ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isSubAbility(String ability){
  return AbilityModuleManager.subabilities.contains(ability);
}
Program: 134050
Project: 134050
Buggy source:
public static boolean isWeapon(Material mat){
  if (mat == null)   return false;
  if (mat == Material.WOOD_AXE || mat == Material.WOOD_PICKAXE || mat == Material.WOOD_SPADE || mat == Material.WOOD_SWORD || mat == Material.STONE_AXE || mat == Material.STONE_PICKAXE || mat == Material.STONE_SPADE || mat == Material.STONE_SWORD || mat == Material.IRON_AXE || mat == Material.IRON_PICKAXE || mat == Material.IRON_SWORD || mat == Material.IRON_SPADE || mat == Material.DIAMOND_AXE || mat == Material.DIAMOND_PICKAXE || mat == Material.DIAMOND_SWORD || mat == Material.DIAMOND_SPADE)   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isWeapon(Material mat){
  return mat != null && (mat == Material.WOOD_AXE || mat == Material.WOOD_PICKAXE || mat == Material.WOOD_SPADE || mat == Material.WOOD_SWORD || mat == Material.STONE_AXE || mat == Material.STONE_PICKAXE || mat == Material.STONE_SPADE || mat == Material.STONE_SWORD || mat == Material.IRON_AXE || mat == Material.IRON_PICKAXE || mat == Material.IRON_SWORD || mat == Material.IRON_SPADE || mat == Material.DIAMOND_AXE || mat == Material.DIAMOND_PICKAXE || mat == Material.DIAMOND_SWORD || mat == Material.DIAMOND_SPADE);
}
Program: 134051
Project: 134051
Buggy source:
public static boolean hasPermission(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability) && canBind(player.getName(),ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean hasPermission(Player player,String ability){
  return player.hasPermission("String_Node_Str" + ability) && canBind(player.getName(),ability);
}
Program: 134052
Project: 134052
Buggy source:
public static void reloadPlugin(){
  ProjectKorra.log.info("String_Node_Str");
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  if (DBConnection.isOpen != false) {
    DBConnection.sql.close();
  }
  GeneralMethods.stopBending();
  ConfigManager.defaultConfig.reload();
  ConfigManager.deathMsgConfig.reload();
  BendingManager.getInstance().reloadVariables();
  new AbilityModuleManager(plugin);
  new MultiAbilityModuleManager();
  new CraftingRecipes(plugin);
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  if (DBConnection.isOpen() == false) {
    ProjectKorra.log.severe("String_Node_Str");
    stopPlugin();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
    Preset.loadPresets(player);
  }
  plugin.updater.checkUpdate();
  ProjectKorra.log.info("String_Node_Str");
}

Fixed version (ground truth):
public static void reloadPlugin(){
  ProjectKorra.log.info("String_Node_Str");
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  if (DBConnection.isOpen) {
    DBConnection.sql.close();
  }
  GeneralMethods.stopBending();
  ConfigManager.defaultConfig.reload();
  ConfigManager.deathMsgConfig.reload();
  BendingManager.getInstance().reloadVariables();
  new AbilityModuleManager(plugin);
  new ComboManager();
  new MultiAbilityModuleManager();
  new CraftingRecipes(plugin);
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  if (!DBConnection.isOpen()) {
    ProjectKorra.log.severe("String_Node_Str");
    stopPlugin();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
    Preset.loadPresets(player);
  }
  plugin.updater.checkUpdate();
  ProjectKorra.log.info("String_Node_Str");
}
Program: 134053
Project: 134053
Buggy source:
public static boolean canView(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean canView(Player player,String ability){
  return player.hasPermission("String_Node_Str" + ability);
}
Program: 134054
Project: 134054
Buggy source:
public static boolean isSolid(Block block){
  if (Arrays.asList(nonOpaque).contains(block.getTypeId()))   return false;
  return true;
}

Fixed version (ground truth):
public static boolean isSolid(Block block){
  return Arrays.asList(nonOpaque).contains(block.getTypeId());
}
Program: 134055
Project: 134055
Buggy source:
/** 
 * Checks if an entity is Undead 
 */
public static boolean isUndead(Entity entity){
  if (entity == null)   return false;
  if (entity.getType() == EntityType.ZOMBIE || entity.getType() == EntityType.BLAZE || entity.getType() == EntityType.GIANT || entity.getType() == EntityType.IRON_GOLEM || entity.getType() == EntityType.MAGMA_CUBE || entity.getType() == EntityType.PIG_ZOMBIE || entity.getType() == EntityType.SKELETON || entity.getType() == EntityType.SLIME || entity.getType() == EntityType.SNOWMAN || entity.getType() == EntityType.ZOMBIE) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if an entity is Undead 
 */
public static boolean isUndead(Entity entity){
  return entity != null && (entity.getType() == EntityType.ZOMBIE || entity.getType() == EntityType.BLAZE || entity.getType() == EntityType.GIANT || entity.getType() == EntityType.IRON_GOLEM || entity.getType() == EntityType.MAGMA_CUBE || entity.getType() == EntityType.PIG_ZOMBIE || entity.getType() == EntityType.SKELETON || entity.getType() == EntityType.SLIME || entity.getType() == EntityType.SNOWMAN || entity.getType() == EntityType.ZOMBIE);
}
Program: 134056
Project: 134056
Buggy source:
public static boolean isBender(String player,Element element){
  BendingPlayer bPlayer=getBendingPlayer(player);
  if (bPlayer == null)   return false;
  if (bPlayer.hasElement(element))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isBender(String player,Element element){
  BendingPlayer bPlayer=getBendingPlayer(player);
  return bPlayer != null && bPlayer.hasElement(element);
}
Program: 134058
Project: 134058
Buggy source:
public static boolean hasItems(){
  if (Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str") != null)   return true;
  return false;
}

Fixed version (ground truth):
public static boolean hasItems(){
  return Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str") != null;
}
Program: 134059
Project: 134059
Buggy source:
public static boolean hasRPG(){
  if (Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str") != null)   return true;
  return false;
}

Fixed version (ground truth):
public static boolean hasRPG(){
  return Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str") != null;
}
Program: 134060
Project: 134060
Buggy source:
public static boolean isAbilityInstalled(String name,String author){
  String ability=getAbility(name);
  if (ability == null)   return false;
  if (AbilityModuleManager.authors.get(name).equalsIgnoreCase(author))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isAbilityInstalled(String name,String author){
  String ability=getAbility(name);
  return ability != null && AbilityModuleManager.authors.get(name).equalsIgnoreCase(author);
}
Program: 134061
Project: 134061
Buggy source:
public static void displayParticleVector(Location loc,ParticleEffect type,float xTrans,float yTrans,float zTrans){
  if (type == ParticleEffect.FIREWORKS_SPARK)   ParticleEffect.FIREWORKS_SPARK.display((float)xTrans,(float)yTrans,(float)zTrans,0.09F,0,loc,257D);
 else   if (type == ParticleEffect.SMOKE || type == ParticleEffect.SMOKE_NORMAL)   ParticleEffect.SMOKE.display((float)xTrans,(float)yTrans,(float)zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.LARGE_SMOKE || type == ParticleEffect.SMOKE_LARGE)   ParticleEffect.LARGE_SMOKE.display((float)xTrans,(float)yTrans,(float)zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.ENCHANTMENT_TABLE)   ParticleEffect.ENCHANTMENT_TABLE.display((float)xTrans,(float)yTrans,(float)zTrans,0.5F,0,loc,257D);
 else   if (type == ParticleEffect.PORTAL)   ParticleEffect.PORTAL.display((float)xTrans,(float)yTrans,(float)zTrans,0.5F,0,loc,257D);
 else   if (type == ParticleEffect.FLAME)   ParticleEffect.FLAME.display((float)xTrans,(float)yTrans,(float)zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.CLOUD)   ParticleEffect.CLOUD.display((float)xTrans,(float)yTrans,(float)zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.SNOW_SHOVEL)   ParticleEffect.SNOW_SHOVEL.display((float)xTrans,(float)yTrans,(float)zTrans,0.2F,0,loc,257D);
 else   ParticleEffect.RED_DUST.display((float)0,(float)0,(float)0,0.004F,0,loc,257D);
}

Fixed version (ground truth):
public static void displayParticleVector(Location loc,ParticleEffect type,float xTrans,float yTrans,float zTrans){
  if (type == ParticleEffect.FIREWORKS_SPARK)   ParticleEffect.FIREWORKS_SPARK.display(xTrans,yTrans,zTrans,0.09F,0,loc,257D);
 else   if (type == ParticleEffect.SMOKE || type == ParticleEffect.SMOKE_NORMAL)   ParticleEffect.SMOKE.display(xTrans,yTrans,zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.LARGE_SMOKE || type == ParticleEffect.SMOKE_LARGE)   ParticleEffect.LARGE_SMOKE.display(xTrans,yTrans,zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.ENCHANTMENT_TABLE)   ParticleEffect.ENCHANTMENT_TABLE.display(xTrans,yTrans,zTrans,0.5F,0,loc,257D);
 else   if (type == ParticleEffect.PORTAL)   ParticleEffect.PORTAL.display(xTrans,yTrans,zTrans,0.5F,0,loc,257D);
 else   if (type == ParticleEffect.FLAME)   ParticleEffect.FLAME.display(xTrans,yTrans,zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.CLOUD)   ParticleEffect.CLOUD.display(xTrans,yTrans,zTrans,0.04F,0,loc,257D);
 else   if (type == ParticleEffect.SNOW_SHOVEL)   ParticleEffect.SNOW_SHOVEL.display(xTrans,yTrans,zTrans,0.2F,0,loc,257D);
 else   ParticleEffect.RED_DUST.display((float)0,(float)0,(float)0,0.004F,0,loc,257D);
}
Program: 134062
Project: 134062
Buggy source:
/** 
 * An access method to get an the instances of a   {@link CoreAbility} by itsclass.
 * @param ability The instances map to get
 * @return a map of instances from the specified class
 * @see #getInstances(StockAbility)
 */
public final static ConcurrentHashMap<Integer,CoreAbility> getInstances(Class<? extends CoreAbility> ability){
  ConcurrentHashMap<Integer,CoreAbility> instanceMap=new ConcurrentHashMap<>();
  for (  Integer id : instances.keySet()) {
    if (ability.isInstance(instances.get(id))) {
      instanceMap.put(id,instances.get(id));
    }
  }
  return instanceMap;
}

Fixed version (ground truth):
/** 
 * An access method to get an the instances of a   {@link CoreAbility} by itsclass. <b>IMPORTANT: </b> If this is used in a for each loop use {@link #getAbility(int)} to get the ability. Incorrect usage maycause over looping and is capable of hanging the thead.
 * @param ability The instances map to get
 * @return a map of instances from the specified class
 * @see #getInstances(StockAbility)
 */
public final static ConcurrentHashMap<Integer,CoreAbility> getInstances(Class<? extends CoreAbility> ability){
  ConcurrentHashMap<Integer,CoreAbility> instanceMap=new ConcurrentHashMap<>();
  for (  Integer id : instances.keySet()) {
    if (ability.isInstance(instances.get(id))) {
      instanceMap.put(id,instances.get(id));
    }
  }
  return instanceMap;
}
Program: 134063
Project: 134063
Buggy source:
public static boolean canFlowTo(Block block){
  for (  Integer id : getInstances(StockAbility.AirBubble).keySet()) {
    if (((AirBubble)getInstances(StockAbility.AirBubble).get(id)).blockInBubble(block)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean canFlowTo(Block block){
  for (  Integer id : getInstances(StockAbility.AirBubble).keySet()) {
    if (((AirBubble)getAbility(id)).blockInBubble(block)) {
      return false;
    }
  }
  return true;
}
Program: 134064
Project: 134064
Buggy source:
@Override public void reloadVariables(){
  speed=config.get().getDouble("String_Node_Str");
}

Fixed version (ground truth):
@Override public void reloadVariables(){
  configSpeed=config.get().getDouble("String_Node_Str");
  this.speed=configSpeed;
}
Program: 134065
Project: 134065
Buggy source:
public static ArrayList<Player> getPlayers(){
  ArrayList<Player> players=new ArrayList<Player>();
  for (  Integer id : getInstances(StockAbility.AirScooter).keySet()) {
    players.add(getInstances(StockAbility.AirScooter).get(id).getPlayer());
  }
  return players;
}

Fixed version (ground truth):
public static ArrayList<Player> getPlayers(){
  ArrayList<Player> players=new ArrayList<Player>();
  for (  Integer id : getInstances(StockAbility.AirScooter).keySet()) {
    players.add(getAbility(id).getPlayer());
  }
  return players;
}
Program: 134066
Project: 134066
Buggy source:
public static boolean isWithinShield(Location loc){
  for (  Integer id : getInstances(StockAbility.AirShield).keySet()) {
    AirShield ashield=(AirShield)getInstances(StockAbility.AirShield).get(id);
    if (ashield.player.getLocation().getWorld() != loc.getWorld())     return false;
    if (ashield.player.getLocation().distance(loc) <= ashield.radius)     return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isWithinShield(Location loc){
  for (  Integer id : getInstances(StockAbility.AirShield).keySet()) {
    AirShield ashield=(AirShield)getAbility(id);
    if (ashield.player.getLocation().getWorld() != loc.getWorld())     return false;
    if (ashield.player.getLocation().distance(loc) <= ashield.radius)     return true;
  }
  return false;
}
Program: 134067
Project: 134067
Buggy source:
public static boolean removeSpouts(Location loc0,double radius,Player sourceplayer){
  boolean removed=false;
  for (  Integer id : getInstances(StockAbility.AirSpout).keySet()) {
    Player player=getInstances(StockAbility.AirSpout).get(id).getPlayer();
    if (!player.equals(sourceplayer)) {
      Location loc1=player.getLocation().getBlock().getLocation();
      loc0=loc0.getBlock().getLocation();
      double dx=loc1.getX() - loc0.getX();
      double dy=loc1.getY() - loc0.getY();
      double dz=loc1.getZ() - loc0.getZ();
      double distance=Math.sqrt(dx * dx + dz * dz);
      if (distance <= radius && dy > 0 && dy < HEIGHT) {
        getInstances(StockAbility.AirSpout).get(id).remove();
        removed=true;
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
public static boolean removeSpouts(Location loc0,double radius,Player sourceplayer){
  boolean removed=false;
  for (  Integer id : getInstances(StockAbility.AirSpout).keySet()) {
    Player player=getAbility(id).getPlayer();
    if (!player.equals(sourceplayer)) {
      Location loc1=player.getLocation().getBlock().getLocation();
      loc0=loc0.getBlock().getLocation();
      double dx=loc1.getX() - loc0.getX();
      double dy=loc1.getY() - loc0.getY();
      double dz=loc1.getZ() - loc0.getZ();
      double distance=Math.sqrt(dx * dx + dz * dz);
      if (distance <= radius && dy > 0 && dy < HEIGHT) {
        getAbility(id).remove();
        removed=true;
      }
    }
  }
  return removed;
}
Program: 134068
Project: 134068
Buggy source:
public static ArrayList<Player> getPlayers(){
  ArrayList<Player> players=new ArrayList<Player>();
  for (  Integer id : getInstances(StockAbility.AirSpout).keySet()) {
    players.add(getInstances(StockAbility.AirSpout).get(id).getPlayer());
  }
  return players;
}

Fixed version (ground truth):
public static ArrayList<Player> getPlayers(){
  ArrayList<Player> players=new ArrayList<Player>();
  for (  Integer id : getInstances(StockAbility.AirSpout).keySet()) {
    players.add(getAbility(id).getPlayer());
  }
  return players;
}
Program: 134069
Project: 134069
Buggy source:
public static boolean removeSwipesAroundPoint(Location loc,double radius){
  boolean removed=false;
  for (  Integer id : getInstances(StockAbility.AirSwipe).keySet()) {
    AirSwipe aswipe=(AirSwipe)getInstances(StockAbility.AirSwipe).get(id);
    for (    Vector vec : aswipe.elements.keySet()) {
      Location vectorLoc=aswipe.elements.get(vec);
      if (vectorLoc != null && vectorLoc.getWorld().equals(loc.getWorld())) {
        if (vectorLoc.distance(loc) <= radius) {
          aswipe.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
public static boolean removeSwipesAroundPoint(Location loc,double radius){
  boolean removed=false;
  for (  Integer id : getInstances(StockAbility.AirSwipe).keySet()) {
    AirSwipe aswipe=(AirSwipe)getAbility(id);
    for (    Vector vec : aswipe.elements.keySet()) {
      Location vectorLoc=aswipe.elements.get(vec);
      if (vectorLoc != null && vectorLoc.getWorld().equals(loc.getWorld())) {
        if (vectorLoc.distance(loc) <= radius) {
          aswipe.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}
Program: 134071
Project: 134071
Buggy source:
public static void reloadPlugin(){
  DBConnection.sql.close();
  ConfigManager.defaultConfig.reloadConfig();
  ConfigManager.deathMsgConfig.reloadConfig();
  GeneralMethods.stopBending();
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  new AbilityModuleManager(plugin);
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
  }
}

Fixed version (ground truth):
public static void reloadPlugin(){
  ProjectKorra.log.info("String_Node_Str");
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  if (DBConnection.isOpen != false) {
    DBConnection.sql.close();
  }
  GeneralMethods.stopBending();
  ConfigManager.defaultConfig.reloadConfig();
  ConfigManager.deathMsgConfig.reloadConfig();
  new AbilityModuleManager(plugin);
  new MultiAbilityModuleManager();
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  if (DBConnection.isOpen() == false) {
    ProjectKorra.log.severe("String_Node_Str");
    stopPlugin();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
    Preset.loadPresets(player);
  }
  plugin.updater.checkUpdate();
  ProjectKorra.log.info("String_Node_Str");
}
Program: 134076
Project: 134076
Buggy source:
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    AirCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (int j=0; j < combo.tasks.size(); j++) {
        FireComboStream fs=(FireComboStream)combo.tasks.get(j);
        if (fs.getLocation() != null && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    AirCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (int j=0; j < combo.tasks.size(); j++) {
        FireComboStream fs=(FireComboStream)combo.tasks.get(j);
        if (fs.getLocation() != null && fs.getLocation().getWorld().equals(loc.getWorld()) && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}
Program: 134077
Project: 134077
Buggy source:
public void remove(){
  instances.remove(this);
  GeneralMethods.getBendingPlayer(player.getName()).addCooldown("String_Node_Str",cooldown);
  revertBlocks();
  for (  BukkitRunnable task : tasks)   task.cancel();
}

Fixed version (ground truth):
public void remove(){
  instances.remove(this);
  BendingPlayer bPlayer=GeneralMethods.getBendingPlayer(player.getName());
  if (bPlayer != null) {
    bPlayer.addCooldown("String_Node_Str",cooldown);
  }
  revertBlocks();
  for (  BukkitRunnable task : tasks)   task.cancel();
}
Program: 134078
Project: 134078
Buggy source:
private boolean progress(){
  if (player.isDead() || !player.isOnline()) {
    instances.remove(player);
  }
  if (!GeneralMethods.canBend(player.getName(),StockAbilities.AvatarState.name())) {
    instances.remove(player);
    if (GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("String_Node_Str")) {
      GeneralMethods.getBendingPlayer(player.getName()).removeCooldown("String_Node_Str");
    }
    return false;
  }
  if (startTimes.containsKey(player.getName())) {
    if (startTimes.get(player.getName()) + duration < System.currentTimeMillis()) {
      startTimes.remove(player.getName());
      instances.remove(player);
    }
  }
  addPotionEffects();
  return true;
}

Fixed version (ground truth):
private boolean progress(){
  if (player.isDead() || !player.isOnline()) {
    instances.remove(player);
  }
  if (!GeneralMethods.canBend(player.getName(),StockAbilities.AvatarState.name())) {
    instances.remove(player);
    if (player != null) {
      if (GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("String_Node_Str")) {
        GeneralMethods.getBendingPlayer(player.getName()).removeCooldown("String_Node_Str");
      }
      return false;
    }
  }
  if (startTimes.containsKey(player.getName())) {
    if (startTimes.get(player.getName()) + duration < System.currentTimeMillis()) {
      startTimes.remove(player.getName());
      instances.remove(player);
    }
  }
  addPotionEffects();
  return true;
}
Program: 134080
Project: 134080
Buggy source:
public void remove(){
  instances.remove(player);
}

Fixed version (ground truth):
public void remove(){
  if (player == null) {
    for (    Player player : instances.keySet()) {
      if (instances.get(player).equals(this)) {
        instances.remove(player);
      }
    }
    return;
  }
  instances.remove(player);
}
Program: 134082
Project: 134082
Buggy source:
/** 
 * Attempts to access a Earth bendable block that was recently shifted or clicked on by the player.
 * @param player the player that is trying to bend.
 * @param range the maximum range to access the block.
 * @param clickType the action that was performed to access the source, eitherClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.
 * @param allowNearbySubstitute if a valid earth source could not be found then this method willattempt to find a nearby valid earth block.
 * @return a valid Earth bendable block, or null if none was found.
 */
public static Block getEarthSourceBlock(Player player,double range,ClickType clickType,boolean allowNearbySubstitute){
  Block sourceBlock=getSourceBlock(player,range,BlockSourceType.EARTH,clickType);
  if (sourceBlock == null && allowNearbySubstitute) {
    BlockSourceInformation blockInfo=getBlockSourceInformation(player,BlockSourceType.EARTH,clickType);
    if (blockInfo == null) {
      return null;
    }
    Block tempBlock=blockInfo.getBlock();
    if (tempBlock == null) {
      return null;
    }
    Location loc=tempBlock.getLocation();
    sourceBlock=EarthMethods.getNearbyEarthBlock(loc,3,3);
    if (sourceBlock == null || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > range || !EarthMethods.isEarthbendable(player,sourceBlock)) {
      return null;
    }
  }
  return sourceBlock;
}

Fixed version (ground truth):
/** 
 * Attempts to access a Earth bendable block that was recently shifted or clicked on by the player.
 * @param player the player that is trying to bend.
 * @param range the maximum range to access the block.
 * @param clickType the action that was performed to access the source, eitherClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.
 * @param allowNearbySubstitute if a valid earth source could not be found then this method willattempt to find a nearby valid earth block.
 * @return a valid Earth bendable block, or null if none was found.
 */
public static Block getEarthSourceBlock(Player player,double range,ClickType clickType,boolean allowNearbySubstitute){
  Block sourceBlock=getSourceBlock(player,range,BlockSourceType.EARTH,clickType);
  if (sourceBlock == null && allowNearbySubstitute) {
    BlockSourceInformation blockInfo=getBlockSourceInformation(player,BlockSourceType.EARTH,clickType);
    if (blockInfo == null) {
      return null;
    }
    Block tempBlock=blockInfo.getBlock();
    if (tempBlock == null) {
      return null;
    }
    Location loc=tempBlock.getLocation();
    sourceBlock=EarthMethods.getNearbyEarthBlock(loc,3,3);
    if (sourceBlock == null || !sourceBlock.getLocation().getWorld().equals(player.getWorld()) || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > range || !EarthMethods.isEarthbendable(player,sourceBlock)) {
      return null;
    }
  }
  return sourceBlock;
}
Program: 134083
Project: 134083
Buggy source:
@Override public boolean isLoggable(LogRecord record){
  if (record.getLevel() == Level.SEVERE && record.getMessage().contains("String_Node_Str") && record.getThrown() != null) {
    for (    String line : consoleError) {
      ProjectKorra.log.severe(line);
    }
    ProjectKorra.handler.publish(record);
    ProjectKorra.handler.flush();
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isLoggable(LogRecord record){
  if (record.getMessage() == null && record.getThrown() == null) {
    return false;
  }
  String recordString="String_Node_Str";
  if (record.getMessage() != null) {
    if (!record.getMessage().contains("String_Node_Str")) {
      if (record.getThrown() == null) {
        return false;
      }
      if (record.getThrown().getMessage() == null) {
        return false;
      }
      if (!record.getThrown().getMessage().contains("String_Node_Str")) {
        return false;
      }
    }
    recordString=buildString(record);
  }
 else {
    if (record.getThrown() != null) {
      if (record.getThrown().getMessage() == null) {
        return false;
      }
      if (!record.getThrown().getMessage().contains("String_Node_Str")) {
        return false;
      }
      recordString=buildString(record);
    }
  }
  if (loggedRecords.contains(recordString)) {
    return false;
  }
  final String toRecord=recordString;
  Bukkit.getScheduler().runTaskLater(ProjectKorra.plugin,new Runnable(){
    public void run(){
      loggedRecords.add(toRecord);
    }
  }
,10);
  return true;
}
Program: 134084
Project: 134084
Buggy source:
public PKLogHandler(String filename) throws IOException {
  super(filename,true);
  this.setLevel(Level.WARNING);
  this.setFilter(new ErrorLogFilter());
  this.setFormatter(new LogFormatter());
}

Fixed version (ground truth):
public PKLogHandler(String filename) throws IOException {
  super(filename,500 * 1024,20,true);
  this.setLevel(Level.WARNING);
  this.setFilter(new LogFilter());
  this.setFormatter(new LogFormatter());
}
Program: 134085
Project: 134085
Buggy source:
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    FireCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (      FireComboStream fs : combo.tasks) {
        if (fs.getLocation() != null && fs.getLocation().getWorld() == loc.getWorld() && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (      FireComboStream fs : combo.tasks) {
        if (fs.getLocation() != null && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    FireCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (      FireComboStream fs : combo.tasks) {
        if (fs.getLocation() != null && fs.getLocation().getWorld() == loc.getWorld() && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (      FireComboStream fs : combo.tasks) {
        if (fs.getLocation() != null && fs.getLocation().getWorld().equals(loc.getWorld())) {
          if (Math.abs(fs.getLocation().distance(loc)) <= radius) {
            fs.remove();
            removed=true;
          }
        }
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
  }
  return removed;
}
Program: 134086
Project: 134086
Buggy source:
private void cancel(){
  if (progressing) {
    if (source != null)     source.revertBlock();
    progressing=false;
  }
  BendingPlayer bPlayer=GeneralMethods.getBendingPlayer(player.getName());
  bPlayer.addCooldown("String_Node_Str",cooldown);
  instances.remove(id);
}

Fixed version (ground truth):
private void cancel(){
  if (progressing) {
    if (source != null)     source.revertBlock();
    progressing=false;
  }
  BendingPlayer bPlayer=GeneralMethods.getBendingPlayer(player.getName());
  if (bPlayer != null) {
    bPlayer.addCooldown("String_Node_Str",cooldown);
  }
  instances.remove(id);
}
Program: 134088
Project: 134088
Buggy source:
@SuppressWarnings("String_Node_Str") public static boolean isPlant(Block block){
  if (Arrays.asList(plantIds).contains(block.getTypeId()))   return true;
  return false;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static boolean isPlant(Block block){
  if (block == null) {
    return false;
  }
  if (Arrays.asList(plantIds).contains(block.getTypeId())) {
    return true;
  }
  return false;
}
Program: 134089
Project: 134089
Buggy source:
/** 
 * Attempts to access a Earth bendable block that was recently shifted or clicked on by the player.
 * @param player the player that is trying to bend.
 * @param range the maximum range to access the block.
 * @param clickType the action that was performed to access the source, eitherClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.
 * @param allowNearbySubstitute if a valid earth source could not be found then this method willattempt to find a nearby valid earth block.
 * @return a valid Earth bendable block, or null if none was found.
 */
public static Block getEarthSourceBlock(Player player,double range,ClickType clickType,boolean allowNearbySubstitute){
  Block sourceBlock=getSourceBlock(player,range,BlockSourceType.EARTH,clickType);
  if (sourceBlock == null && allowNearbySubstitute) {
    BlockSourceInformation blockInfo=getBlockSourceInformation(player,BlockSourceType.EARTH,clickType);
    if (blockInfo == null) {
      return null;
    }
    Block tempBlock=blockInfo.getBlock();
    if (tempBlock == null) {
      return null;
    }
    Location loc=tempBlock.getLocation();
    sourceBlock=EarthMethods.getNearbyEarthBlock(loc,3,3);
    if (sourceBlock == null || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > range || !EarthMethods.isEarthbendable(player,sourceBlock)) {
      return null;
    }
  }
  return sourceBlock;
}

Fixed version (ground truth):
/** 
 * Attempts to access a Earth bendable block that was recently shifted or clicked on by the player.
 * @param player the player that is trying to bend.
 * @param range the maximum range to access the block.
 * @param clickType the action that was performed to access the source, eitherClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.
 * @param allowNearbySubstitute if a valid earth source could not be found then this method willattempt to find a nearby valid earth block.
 * @return a valid Earth bendable block, or null if none was found.
 */
public static Block getEarthSourceBlock(Player player,double range,ClickType clickType,boolean allowNearbySubstitute){
  Block sourceBlock=getSourceBlock(player,range,BlockSourceType.EARTH,clickType);
  if (sourceBlock == null && allowNearbySubstitute) {
    BlockSourceInformation blockInfo=getBlockSourceInformation(player,BlockSourceType.EARTH,clickType);
    if (blockInfo == null) {
      return null;
    }
    Block tempBlock=blockInfo.getBlock();
    if (tempBlock == null) {
      return null;
    }
    Location loc=tempBlock.getLocation();
    sourceBlock=EarthMethods.getNearbyEarthBlock(loc,3,3);
    if (sourceBlock == null || !sourceBlock.getLocation().getWorld().equals(player.getWorld()) || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > range || !EarthMethods.isEarthbendable(player,sourceBlock)) {
      return null;
    }
  }
  return sourceBlock;
}
Program: 134092
Project: 134092
Buggy source:
@Override public boolean isLoggable(LogRecord record){
  if (consoleError.contains(record.getMessage().replace("String_Node_Str","String_Node_Str"))) {
    return false;
  }
 else   if (!record.getMessage().contains("String_Node_Str")) {
    if (record.getThrown() != null && record.getThrown().getMessage() != null) {
      if (record.getThrown().getMessage().contains("String_Node_Str")) {
        return true;
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isLoggable(LogRecord record){
  if (consoleError.contains(record.getMessage().replace("String_Node_Str","String_Node_Str"))) {
    return false;
  }
 else   if (!record.getMessage().contains("String_Node_Str")) {
    if (record.getThrown() != null) {
      if (record.getThrown().getMessage() != null) {
        if (record.getThrown().getMessage().contains("String_Node_Str")) {
          return true;
        }
      }
    }
    return false;
  }
  return true;
}
Program: 134093
Project: 134093
Buggy source:
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    AirCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (int j=0; j < combo.tasks.size(); j++) {
        FireComboStream fs=(FireComboStream)combo.tasks.get(j);
        if (fs.getLocation() != null && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
public static boolean removeAroundPoint(Player player,String ability,Location loc,double radius){
  boolean removed=false;
  for (int i=0; i < instances.size(); i++) {
    AirCombo combo=instances.get(i);
    if (combo.getPlayer().equals(player))     continue;
    if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      if (combo.currentLoc != null && Math.abs(combo.currentLoc.distance(loc)) <= radius) {
        instances.remove(combo);
        removed=true;
      }
    }
 else     if (ability.equalsIgnoreCase("String_Node_Str") && combo.ability.equalsIgnoreCase("String_Node_Str")) {
      for (int j=0; j < combo.tasks.size(); j++) {
        FireComboStream fs=(FireComboStream)combo.tasks.get(j);
        if (fs.getLocation() != null && fs.getLocation().getWorld().equals(loc.getWorld()) && Math.abs(fs.getLocation().distance(loc)) <= radius) {
          fs.remove();
          removed=true;
        }
      }
    }
  }
  return removed;
}
Program: 134094
Project: 134094
Buggy source:
public static void reloadPlugin(){
  DBConnection.sql.close();
  plugin.reloadConfig();
  ConfigManager.deathMsgConfig.reloadConfig();
  GeneralMethods.stopBending();
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  new AbilityModuleManager(plugin);
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
  }
}

Fixed version (ground truth):
public static void reloadPlugin(){
  DBConnection.sql.close();
  ConfigManager.defaultConfig.reloadConfig();
  ConfigManager.deathMsgConfig.reloadConfig();
  GeneralMethods.stopBending();
  BendingReloadEvent event=new BendingReloadEvent();
  Bukkit.getServer().getPluginManager().callEvent(event);
  new AbilityModuleManager(plugin);
  DBConnection.host=plugin.getConfig().getString("String_Node_Str");
  DBConnection.port=plugin.getConfig().getInt("String_Node_Str");
  DBConnection.pass=plugin.getConfig().getString("String_Node_Str");
  DBConnection.db=plugin.getConfig().getString("String_Node_Str");
  DBConnection.user=plugin.getConfig().getString("String_Node_Str");
  DBConnection.init();
  for (  Player player : Bukkit.getOnlinePlayers()) {
    GeneralMethods.createBendingPlayer(player.getUniqueId(),player.getName());
  }
}