nus-yam/ex-repair huggingface dataset:
Program: 34028
Project: 34028
Buggy source:
/** 
 * Resets a player's inventory, armor slots, equipment, enderchest and potion effects
 * @param player
 */
public void resetPlayer(Player player){
  if (Settings.clearInventory && (player.getWorld().getName().equalsIgnoreCase(Settings.worldName) || player.getWorld().getName().equalsIgnoreCase(Settings.worldName + "String_Node_Str"))) {
    player.getInventory().clear();
    player.getInventory().setArmorContents(null);
    player.getInventory().setHelmet(null);
    player.getInventory().setChestplate(null);
    player.getInventory().setLeggings(null);
    player.getInventory().setBoots(null);
    player.getEquipment().clear();
  }
  player.setGameMode(GameMode.SURVIVAL);
  if (Settings.resetChallenges) {
    players.resetAllChallenges(player.getUniqueId());
  }
  players.setIslandLevel(player.getUniqueId(),0);
  players.clearStartIslandRating(player.getUniqueId());
  players.save(player.getUniqueId());
  TopTen.topTenAddEntry(player.getUniqueId(),0);
  player.updateInventory();
  if (Settings.resetEnderChest) {
    final ItemStack[] items=new ItemStack[player.getEnderChest().getContents().length];
    player.getEnderChest().setContents(items);
  }
  for (  PotionEffect effect : player.getActivePotionEffects())   player.removePotionEffect(effect.getType());
}

Fixed version (ground truth):
/** 
 * Resets a player's inventory, armor slots, equipment, enderchest and potion effects
 * @param player
 */
public void resetPlayer(Player player){
  if (Settings.clearInventory && (player.getWorld().getName().equalsIgnoreCase(Settings.worldName) || player.getWorld().getName().equalsIgnoreCase(Settings.worldName + "String_Node_Str"))) {
    player.getInventory().clear();
    player.getInventory().setArmorContents(null);
    player.getInventory().setHelmet(null);
    player.getInventory().setChestplate(null);
    player.getInventory().setLeggings(null);
    player.getInventory().setBoots(null);
    player.getEquipment().clear();
  }
  if (!player.isOp()) {
    player.setGameMode(GameMode.SURVIVAL);
  }
  if (Settings.resetChallenges) {
    players.resetAllChallenges(player.getUniqueId());
  }
  players.setIslandLevel(player.getUniqueId(),0);
  players.clearStartIslandRating(player.getUniqueId());
  players.save(player.getUniqueId());
  TopTen.topTenAddEntry(player.getUniqueId(),0);
  player.updateInventory();
  if (Settings.resetEnderChest) {
    final ItemStack[] items=new ItemStack[player.getEnderChest().getContents().length];
    player.getEnderChest().setContents(items);
  }
  for (  PotionEffect effect : player.getActivePotionEffects())   player.removePotionEffect(effect.getType());
}
Program: 34029
Project: 34029
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onBucketEmpty(final PlayerBucketEmptyEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
  }
  if (inWorld(e.getPlayer())) {
    if (VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      return;
    }
    Player p=e.getPlayer();
    if (e.getBlockClicked() != null) {
      Island island=plugin.getGrid().getProtectedIslandAt(e.getBlockClicked().getLocation());
      if (island != null) {
        if (island.getIgsFlag(Flags.allowBreakBlocks) || island.getMembers().contains(p.getUniqueId())) {
          if (e.getBlockClicked() != null && e.getBlockClicked().getBiome().equals(Biome.HELL) && e.getPlayer().getItemInHand().getType().equals(Material.WATER_BUCKET)) {
            e.setCancelled(true);
            e.getPlayer().getItemInHand().setType(Material.BUCKET);
            e.getPlayer().playSound(e.getPlayer().getLocation(),Sound.FIZZ,1F,2F);
            e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).biomeSet.replace("String_Node_Str","String_Node_Str"));
          }
          return;
        }
      }
 else {
        if (Settings.allowBucketUse) {
          return;
        }
      }
      p.sendMessage(ChatColor.RED + plugin.myLocale(p.getUniqueId()).islandProtected);
      e.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Prevents emptying of buckets outside of island space
 * @param e
 */
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onBucketEmpty(final PlayerBucketEmptyEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
  }
  if (inWorld(e.getPlayer())) {
    if (VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      return;
    }
    Player p=e.getPlayer();
    if (e.getBlockClicked() != null) {
      Block dumpBlock=e.getBlockClicked().getRelative(e.getBlockFace());
      Island island=plugin.getGrid().getProtectedIslandAt(dumpBlock.getLocation());
      if (island != null) {
        if (island.getIgsFlag(Flags.allowBreakBlocks) || island.getMembers().contains(p.getUniqueId())) {
          if (e.getBlockClicked().getBiome().equals(Biome.HELL) && e.getPlayer().getItemInHand().getType().equals(Material.WATER_BUCKET)) {
            e.setCancelled(true);
            e.getPlayer().getItemInHand().setType(Material.BUCKET);
            e.getPlayer().playSound(e.getPlayer().getLocation(),Sound.FIZZ,1F,2F);
            e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).biomeSet.replace("String_Node_Str","String_Node_Str"));
          }
          return;
        }
      }
 else {
        if (Settings.allowBucketUse) {
          return;
        }
      }
      p.sendMessage(ChatColor.RED + plugin.myLocale(p.getUniqueId()).islandProtected);
      e.setCancelled(true);
    }
  }
}
Program: 34030
Project: 34030
Buggy source:
/** 
 * Provides a list of all the players who are allowed on this island including coop members
 * @return a list of UUIDs that have legitimate access to the island
 */
public List<UUID> getMembers(){
  List<UUID> result=new ArrayList<UUID>();
  result.addAll(CoopPlay.getInstance().getCoopPlayers(center));
  if (owner == null) {
    return result;
  }
  result.add(owner);
  result.addAll(plugin.getPlayers().getMembers(owner));
  return result;
}

Fixed version (ground truth):
/** 
 * Provides a list of all the players who are allowed on this island including coop members
 * @return a list of UUIDs that have legitimate access to the island
 */
public List<UUID> getMembers(){
  List<UUID> result=new ArrayList<UUID>();
  result.addAll(CoopPlay.getInstance().getCoopPlayers(center.toVector().toLocation(ASkyBlock.getIslandWorld())));
  result.addAll(CoopPlay.getInstance().getCoopPlayers(center.toVector().toLocation(ASkyBlock.getNetherWorld())));
  if (owner == null) {
    return result;
  }
  result.add(owner);
  result.addAll(plugin.getPlayers().getMembers(owner));
  return result;
}
Program: 34032
Project: 34032
Buggy source:
/** 
 * Load the player's inventory
 * @param player
 */
public void loadPlayerInventory(Player player){
  if (inventories.containsKey(player.getUniqueId())) {
    InventoryStore inv=inventories.get(player.getUniqueId());
    player.getInventory().setContents(inv.getInventory());
    player.getInventory().setArmorContents(inv.getArmor());
    inventories.remove(inv);
    return;
  }
}

Fixed version (ground truth):
/** 
 * Load the player's inventory
 * @param player
 */
public void loadPlayerInventory(Player player){
  if (inventories.containsKey(player.getUniqueId())) {
    InventoryStore inv=inventories.get(player.getUniqueId());
    player.getInventory().setContents(inv.getInventory());
    player.getInventory().setArmorContents(inv.getArmor());
    inventories.remove(player.getUniqueId());
    return;
  }
}
Program: 34035
Project: 34035
Buggy source:
/** 
 * Prevents the breakage of hanging items
 * @param e
 */
@EventHandler(priority=EventPriority.LOW) public void onBreakHanging(final HangingBreakByEntityEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info(e.getRemover().toString());
  }
  if (inWorld(e.getEntity())) {
    if ((e.getRemover() instanceof Creeper) && !Settings.allowCreeperDamage) {
      e.setCancelled(true);
      return;
    }
    if (e.getRemover() instanceof Player) {
      Player p=(Player)e.getRemover();
      if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
        return;
      }
      Island island=plugin.getGrid().getProtectedIslandAt(e.getEntity().getLocation());
      if (island == null && Settings.allowBreakBlocks) {
        return;
      }
      if (island != null) {
        if (Settings.allowSpawnBreakBlocks && island.isSpawn()) {
          return;
        }
        if (island.getIgsFlag(Flags.allowBreakBlocks) || island.getMembers().contains(p.getUniqueId())) {
          return;
        }
      }
      p.sendMessage(ChatColor.RED + plugin.myLocale(p.getUniqueId()).islandProtected);
      e.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Prevents the breakage of hanging items
 * @param e
 */
@EventHandler(priority=EventPriority.LOW) public void onBreakHanging(final HangingBreakByEntityEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info(e.getRemover().toString());
  }
  if (inWorld(e.getEntity())) {
    if ((e.getRemover() instanceof Creeper) && !Settings.allowCreeperDamage) {
      e.setCancelled(true);
      return;
    }
    if ((e.getRemover() instanceof Creeper) && !Settings.allowCreeperGriefing) {
      Creeper creeper=(Creeper)e.getRemover();
      if (creeper.getTarget() instanceof Player) {
        Player target=(Player)creeper.getTarget();
        if (!plugin.getGrid().locationIsOnIsland(target,e.getEntity().getLocation())) {
          e.setCancelled(true);
          return;
        }
      }
    }
    if (e.getRemover() instanceof Player) {
      Player p=(Player)e.getRemover();
      if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
        return;
      }
      Island island=plugin.getGrid().getProtectedIslandAt(e.getEntity().getLocation());
      if (island == null && Settings.allowBreakBlocks) {
        return;
      }
      if (island != null) {
        if (Settings.allowSpawnBreakBlocks && island.isSpawn()) {
          return;
        }
        if (island.getIgsFlag(Flags.allowBreakBlocks) || island.getMembers().contains(p.getUniqueId())) {
          return;
        }
      }
      p.sendMessage(ChatColor.RED + plugin.myLocale(p.getUniqueId()).islandProtected);
      e.setCancelled(true);
    }
  }
}
Program: 34037
Project: 34037
Buggy source:
@Override public void run(){
  if (player.isDead()) {
    burningPlayers.remove(player);
    this.cancel();
  }
 else   if (player.getLocation().getBlock().isLiquid() && player.getLocation().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    if (!Settings.acidDamageType.isEmpty()) {
      for (      PotionEffectType t : Settings.acidDamageType) {
        if (t.equals(PotionEffectType.BLINDNESS) || t.equals(PotionEffectType.CONFUSION) || t.equals(PotionEffectType.HUNGER)|| t.equals(PotionEffectType.SLOW)|| t.equals(PotionEffectType.SLOW_DIGGING)|| t.equals(PotionEffectType.WEAKNESS)) {
          player.addPotionEffect(new PotionEffect(t,600,1));
        }
 else {
          player.addPotionEffect(new PotionEffect(t,200,1));
        }
      }
    }
    if (Settings.acidDamage > 0D) {
      double health=player.getHealth() - (Settings.acidDamage - Settings.acidDamage * getDamageReduced(player));
      if (health < 0D) {
        health=0D;
      }
 else       if (health > 20D) {
        health=20D;
      }
      player.setHealth(health);
      player.getWorld().playSound(playerLoc,Sound.FIZZ,2F,2F);
    }
  }
 else {
    burningPlayers.remove(player);
    this.cancel();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (player.isDead()) {
    burningPlayers.remove(player);
    this.cancel();
  }
 else   if ((player.getLocation().getBlock().isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid()) && player.getLocation().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    if (!Settings.acidDamageType.isEmpty()) {
      for (      PotionEffectType t : Settings.acidDamageType) {
        if (t.equals(PotionEffectType.BLINDNESS) || t.equals(PotionEffectType.CONFUSION) || t.equals(PotionEffectType.HUNGER)|| t.equals(PotionEffectType.SLOW)|| t.equals(PotionEffectType.SLOW_DIGGING)|| t.equals(PotionEffectType.WEAKNESS)) {
          player.addPotionEffect(new PotionEffect(t,600,1));
        }
 else {
          player.addPotionEffect(new PotionEffect(t,200,1));
        }
      }
    }
    if (Settings.acidDamage > 0D) {
      double health=player.getHealth() - (Settings.acidDamage - Settings.acidDamage * getDamageReduced(player));
      if (health < 0D) {
        health=0D;
      }
 else       if (health > 20D) {
        health=20D;
      }
      player.setHealth(health);
      player.getWorld().playSound(playerLoc,Sound.FIZZ,2F,2F);
    }
  }
 else {
    burningPlayers.remove(player);
    this.cancel();
  }
}
Program: 34049
Project: 34049
Buggy source:
/** 
 * Enables changing of obsidian back into lava
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent e){
  if (plugin.getGrid().playerIsOnIsland(e.getPlayer())) {
    boolean otherOb=false;
    if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getPlayer().getItemInHand().getType().equals(Material.BUCKET) && e.getClickedBlock().getType().equals(Material.OBSIDIAN)) {
      Block b=e.getClickedBlock();
      for (int x=-2; x <= 2; x++) {
        for (int y=-2; y <= 2; y++) {
          for (int z=-2; z <= 2; z++) {
            final Block testBlock=b.getWorld().getBlockAt(b.getX() + x,b.getY() + y,b.getZ() + z);
            if ((x != 0 || y != 0 || z != 0) && testBlock.getType().equals(Material.OBSIDIAN)) {
              otherOb=true;
            }
          }
        }
      }
      if (!otherOb) {
        e.getPlayer().sendMessage(ChatColor.YELLOW + plugin.myLocale(e.getPlayer().getUniqueId()).changingObsidiantoLava);
        e.getPlayer().getInventory().setItemInHand(null);
        e.getPlayer().getInventory().addItem(new ItemStack(Material.LAVA_BUCKET,1));
        e.getPlayer().updateInventory();
        e.getClickedBlock().setType(Material.AIR);
        e.setCancelled(true);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Enables changing of obsidian back into lava
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent e){
  if (plugin.getGrid().playerIsOnIsland(e.getPlayer())) {
    boolean otherOb=false;
    ItemStack inHand=e.getPlayer().getItemInHand();
    if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && inHand.getType().equals(Material.BUCKET) && e.getClickedBlock().getType().equals(Material.OBSIDIAN)) {
      Block b=e.getClickedBlock();
      for (int x=-2; x <= 2; x++) {
        for (int y=-2; y <= 2; y++) {
          for (int z=-2; z <= 2; z++) {
            final Block testBlock=b.getWorld().getBlockAt(b.getX() + x,b.getY() + y,b.getZ() + z);
            if ((x != 0 || y != 0 || z != 0) && testBlock.getType().equals(Material.OBSIDIAN)) {
              otherOb=true;
            }
          }
        }
      }
      if (!otherOb) {
        e.getPlayer().sendMessage(ChatColor.YELLOW + plugin.myLocale(e.getPlayer().getUniqueId()).changingObsidiantoLava);
        e.getPlayer().getInventory().setItemInHand(null);
        e.getPlayer().getInventory().addItem(new ItemStack(Material.LAVA_BUCKET,1));
        if (inHand.getAmount() > 1) {
          e.getPlayer().getInventory().addItem(new ItemStack(Material.BUCKET,inHand.getAmount() - 1));
        }
        e.getPlayer().updateInventory();
        e.getClickedBlock().setType(Material.AIR);
        e.setCancelled(true);
      }
    }
  }
}
Program: 34050
Project: 34050
Buggy source:
@EventHandler public void WitherExplosion(EntityExplodeEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
  }
  if (!IslandGuard.inWorld(e.getEntity()) || e.getEntity() == null) {
    return;
  }
  if (e.getEntityType() == EntityType.WITHER || e.getEntityType() == EntityType.WITHER_SKULL) {
    if (witherSpawnInfo.containsKey(e.getEntity().getUniqueId())) {
      if (!witherSpawnInfo.get(e.getEntity().getUniqueId()).inIslandSpace(e.getLocation())) {
        e.blockList().clear();
        e.setCancelled(true);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void WitherExplosion(EntityExplodeEvent e){
  if (debug) {
    plugin.getLogger().info(e.getEventName());
  }
  if (e.getEntity() == null || !IslandGuard.inWorld(e.getEntity())) {
    return;
  }
  if (e.getEntityType() == EntityType.WITHER || e.getEntityType() == EntityType.WITHER_SKULL) {
    if (witherSpawnInfo.containsKey(e.getEntity().getUniqueId())) {
      if (!witherSpawnInfo.get(e.getEntity().getUniqueId()).inIslandSpace(e.getLocation())) {
        e.blockList().clear();
        e.setCancelled(true);
      }
    }
  }
}
Program: 34057
Project: 34057
Buggy source:
private void resetPlayer(Player player,Location oldIsland){
  CoopPlay.getInstance().clearMyInvitedCoops(player);
  CoopPlay.getInstance().clearMyCoops(player);
  WarpSigns.removeWarp(player.getUniqueId());
  if (oldIsland != null) {
    CoopPlay.getInstance().clearAllIslandCoops(oldIsland);
    if (oldIsland.getWorld().equals(ASkyBlock.getIslandWorld())) {
      plugin.getGrid().removeMobsFromIsland(oldIsland);
      new DeleteIslandChunk(plugin,oldIsland);
      if (Settings.createNether && Settings.newNether) {
        Location otherIsland=oldIsland.toVector().toLocation(ASkyBlock.getNetherWorld());
        plugin.getGrid().removeMobsFromIsland(otherIsland);
        new DeleteIslandChunk(plugin,otherIsland);
      }
    }
 else     if (Settings.createNether && Settings.newNether && oldIsland.getWorld().equals(ASkyBlock.getNetherWorld())) {
      plugin.getGrid().removeMobsFromIsland(oldIsland);
      new DeleteIslandChunk(plugin,oldIsland);
      Location otherIsland=oldIsland.toVector().toLocation(ASkyBlock.getIslandWorld());
      plugin.getGrid().removeMobsFromIsland(otherIsland);
      new DeleteIslandChunk(plugin,otherIsland);
    }
 else {
      plugin.getLogger().severe("String_Node_Str" + oldIsland.toString() + "String_Node_Str");
    }
  }
  runCommands(Settings.resetCommands,player.getUniqueId());
}

Fixed version (ground truth):
private void resetPlayer(Player player,Location oldIsland){
  plugin.getPlayers().setResetsLeft(player.getUniqueId(),plugin.getPlayers().getResetsLeft(player.getUniqueId()) - 1);
  CoopPlay.getInstance().clearMyInvitedCoops(player);
  CoopPlay.getInstance().clearMyCoops(player);
  WarpSigns.removeWarp(player.getUniqueId());
  if (oldIsland != null) {
    CoopPlay.getInstance().clearAllIslandCoops(oldIsland);
    if (oldIsland.getWorld().equals(ASkyBlock.getIslandWorld())) {
      plugin.getGrid().removeMobsFromIsland(oldIsland);
      new DeleteIslandChunk(plugin,oldIsland);
      if (Settings.createNether && Settings.newNether) {
        Location otherIsland=oldIsland.toVector().toLocation(ASkyBlock.getNetherWorld());
        plugin.getGrid().removeMobsFromIsland(otherIsland);
        new DeleteIslandChunk(plugin,otherIsland);
      }
    }
 else     if (Settings.createNether && Settings.newNether && oldIsland.getWorld().equals(ASkyBlock.getNetherWorld())) {
      plugin.getGrid().removeMobsFromIsland(oldIsland);
      new DeleteIslandChunk(plugin,oldIsland);
      Location otherIsland=oldIsland.toVector().toLocation(ASkyBlock.getIslandWorld());
      plugin.getGrid().removeMobsFromIsland(otherIsland);
      new DeleteIslandChunk(plugin,otherIsland);
    }
 else {
      plugin.getLogger().severe("String_Node_Str" + oldIsland.toString() + "String_Node_Str");
    }
  }
  runCommands(Settings.resetCommands,player.getUniqueId());
}
Program: 34059
Project: 34059
Buggy source:
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=false) public void onSignBreak(BlockBreakEvent e){
  Block b=e.getBlock();
  Player player=e.getPlayer();
  if (b.getWorld().equals(ASkyBlock.getIslandWorld())) {
    if (b.getType().equals(Material.SIGN_POST)) {
      Sign s=(Sign)b.getState();
      if (s != null) {
        if (s.getLine(0).equalsIgnoreCase(ChatColor.GREEN + plugin.myLocale().warpswelcomeLine)) {
          if (checkWarp(s.getLocation())) {
            final Location playerSignLoc=getWarp(player.getUniqueId());
            if (playerSignLoc != null) {
              if (playerSignLoc.equals(s.getLocation())) {
                player.sendMessage(ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).warpssignRemoved);
                removeWarp(player.getUniqueId());
              }
 else {
                player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).warpserrorNoRemove);
                e.setCancelled(true);
              }
            }
 else {
              player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).warpserrorNoRemove);
              e.setCancelled(true);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks to see if a sign has been broken
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=false) public void onSignBreak(BlockBreakEvent e){
  Block b=e.getBlock();
  Player player=e.getPlayer();
  if (b.getWorld().equals(ASkyBlock.getIslandWorld())) {
    if (b.getType().equals(Material.SIGN_POST)) {
      Sign s=(Sign)b.getState();
      if (s != null) {
        if (s.getLine(0).equalsIgnoreCase(ChatColor.GREEN + plugin.myLocale().warpswelcomeLine)) {
          if (checkWarp(s.getLocation())) {
            final Location playerSignLoc=getWarp(player.getUniqueId());
            if (playerSignLoc != null) {
              if (playerSignLoc.equals(s.getLocation())) {
                player.sendMessage(ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).warpssignRemoved);
                removeWarp(player.getUniqueId());
              }
 else {
                player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).warpserrorNoRemove);
                e.setCancelled(true);
              }
            }
 else {
              player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).warpserrorNoRemove);
              e.setCancelled(true);
            }
          }
        }
      }
    }
  }
}
Program: 34060
Project: 34060
Buggy source:
/** 
 * Provides the location of the warp for player
 * @param player - the warp requested
 * @return Location of warp
 */
public static Location getWarp(UUID player){
  if (warpList.containsKey(player)) {
    return Util.getLocationString((String)warpList.get(player));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Provides the location of the warp for player or null if one is not found
 * @param player - the warp requested
 * @return Location of warp
 */
public static Location getWarp(UUID player){
  if (warpList.containsKey(player)) {
    return Util.getLocationString((String)warpList.get(player));
  }
 else {
    return null;
  }
}
Program: 34071
Project: 34071
Buggy source:
@Override public void run(){
  List<Entity> entList=islandWorld.getEntities();
  for (  Entity current : entList) {
    if ((current instanceof Monster) && Settings.mobAcidDamage > 0D) {
      if ((current.getLocation().getBlock().getType() == Material.WATER) || (current.getLocation().getBlock().getType() == Material.STATIONARY_WATER)) {
        ((Monster)current).damage(Settings.mobAcidDamage);
      }
    }
 else     if ((current instanceof Animals) && Settings.animalAcidDamage > 0D) {
      if ((current.getLocation().getBlock().getType() == Material.WATER) || (current.getLocation().getBlock().getType() == Material.STATIONARY_WATER)) {
        if (!current.getType().equals(EntityType.CHICKEN)) {
          ((Animals)current).damage(Settings.animalAcidDamage);
        }
 else         if (Settings.damageChickens) {
          ((Animals)current).damage(Settings.animalAcidDamage);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (Settings.GAMETYPE.equals(GameType.ASKYBLOCK)) {
    updateCheck=new Update(85189);
  }
 else {
    updateCheck=new Update(80095);
  }
  if (!updateCheck.isSuccess()) {
    updateCheck=null;
  }
}
Program: 34074
Project: 34074
Buggy source:
/** 
 * This prevents breeding of animals off-island Adds a limit to how many animals can be bred by a player
 * @param e
 */
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerHitEntity(PlayerInteractEntityEvent e){
  Player p=e.getPlayer();
  if (debug) {
    plugin.getLogger().info("String_Node_Str" + e.getEventName());
  }
  if (!p.getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    return;
  }
  if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
    return;
  }
  if (plugin.getGrid().playerIsOnIsland(e.getPlayer())) {
    plugin.getLogger().info("String_Node_Str");
  }
 else {
switch (e.getRightClicked().getType()) {
case ITEM_FRAME:
case MINECART_CHEST:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_TNT:
      if (!Settings.allowChestAccess) {
        e.getPlayer().sendMessage(ChatColor.RED + Locale.islandProtected);
        e.setCancelled(true);
      }
default :
    break;
}
}
}

Fixed version (ground truth):
/** 
 * This prevents breeding of animals off-island Adds a limit to how many animals can be bred by a player
 * @param e
 */
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerHitEntity(PlayerInteractEntityEvent e){
  Player p=e.getPlayer();
  if (debug) {
    plugin.getLogger().info("String_Node_Str" + e.getEventName());
  }
  if (!p.getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    return;
  }
  if (p.isOp() || VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str")) {
    return;
  }
  if (!plugin.getGrid().playerIsOnIsland(e.getPlayer())) {
switch (e.getRightClicked().getType()) {
case ITEM_FRAME:
case MINECART_CHEST:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_TNT:
      if (!Settings.allowChestAccess) {
        e.getPlayer().sendMessage(ChatColor.RED + Locale.islandProtected);
        e.setCancelled(true);
      }
default :
    break;
}
}
}
Program: 34077
Project: 34077
Buggy source:
/** 
 * Enables changing of obsidian back into lava
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent e){
  if (plugin.playerIsOnIsland(e.getPlayer())) {
    boolean otherOb=false;
    if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getPlayer().getItemInHand().getType().equals(Material.BUCKET) && e.getClickedBlock().getType().equals(Material.OBSIDIAN)) {
      Block b=e.getClickedBlock();
      for (int x=-2; x <= 2; x++) {
        for (int y=-2; y <= 2; y++) {
          for (int z=-2; z <= 2; z++) {
            final Block testBlock=b.getWorld().getBlockAt(b.getX() + x,b.getY() + y,b.getZ() + z);
            if ((x != 0 || y != 0 || z != 0) && testBlock.getType().equals(Material.OBSIDIAN)) {
              otherOb=true;
            }
          }
        }
      }
      if (!otherOb) {
        e.getPlayer().sendMessage(ChatColor.YELLOW + Locale.changingObsidiantoLava);
        e.getPlayer().getInventory().removeItem(new ItemStack(Material.BUCKET,1));
        e.getPlayer().getInventory().addItem(new ItemStack(Material.LAVA_BUCKET,1));
        e.getPlayer().updateInventory();
        e.getClickedBlock().setType(Material.AIR);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Enables changing of obsidian back into lava
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent e){
  if (plugin.playerIsOnIsland(e.getPlayer())) {
    boolean otherOb=false;
    if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getPlayer().getItemInHand().getType().equals(Material.BUCKET) && e.getClickedBlock().getType().equals(Material.OBSIDIAN)) {
      Block b=e.getClickedBlock();
      for (int x=-2; x <= 2; x++) {
        for (int y=-2; y <= 2; y++) {
          for (int z=-2; z <= 2; z++) {
            final Block testBlock=b.getWorld().getBlockAt(b.getX() + x,b.getY() + y,b.getZ() + z);
            if ((x != 0 || y != 0 || z != 0) && testBlock.getType().equals(Material.OBSIDIAN)) {
              otherOb=true;
            }
          }
        }
      }
      if (!otherOb) {
        e.getPlayer().sendMessage(ChatColor.YELLOW + Locale.changingObsidiantoLava);
        e.getPlayer().getInventory().setItemInHand(null);
        e.getPlayer().getInventory().addItem(new ItemStack(Material.LAVA_BUCKET,1));
        e.getPlayer().updateInventory();
        e.getClickedBlock().setType(Material.AIR);
        e.setCancelled(true);
      }
    }
  }
}
Program: 34079
Project: 34079
Buggy source:
protected List<String> getMessages(UUID playerUUID){
  List<String> playerMessages=messages.get(playerUUID);
  if (playerMessages != null) {
    messages.remove(playerUUID);
  }
 else {
    playerMessages=new ArrayList<String>();
  }
  return playerMessages;
}

Fixed version (ground truth):
/** 
 * Returns what messages are waiting for the player or null if none
 * @param playerUUID
 * @return
 */
protected List<String> getMessages(UUID playerUUID){
  List<String> playerMessages=messages.get(playerUUID);
  return playerMessages;
}
Program: 34080
Project: 34080
Buggy source:
/** 
 * Delete Island Called when an island is restarted or reset
 * @param player - player name String
 * @param removeBlocks
 */
protected void deletePlayerIsland(final UUID player,boolean removeBlocks){
  CoopPlay.getInstance().clearAllIslandCoops(player);
  removeWarp(player);
  removeMobsFromIsland(players.getIslandLocation(player));
  if (removeBlocks) {
    new DeleteIslandChunk(this,players.getIslandLocation(player));
  }
 else {
    Island island=grid.getIsland(player);
    if (island != null) {
      island.setLocked(false);
      grid.setIslandOwner(island,null);
    }
  }
  players.zeroPlayerData(player);
}

Fixed version (ground truth):
/** 
 * Delete Island Called when an island is restarted or reset
 * @param player - player name String
 * @param removeBlocks
 */
protected void deletePlayerIsland(final UUID player,boolean removeBlocks){
  CoopPlay.getInstance().clearAllIslandCoops(player);
  removeWarp(player);
  if (removeBlocks) {
    removeMobsFromIsland(players.getIslandLocation(player));
    new DeleteIslandChunk(this,players.getIslandLocation(player));
  }
 else {
    Island island=grid.getIsland(player);
    if (island != null) {
      island.setLocked(false);
      grid.setIslandOwner(island,null);
    }
  }
  players.zeroPlayerData(player);
}
Program: 34081
Project: 34081
Buggy source:
/** 
 * Sets a message for the player to receive next time they login
 * @param player
 * @param message
 * @return true if player is offline, false if online
 */
protected boolean setMessage(UUID playerUUID,String message){
  Player player=getServer().getPlayer(playerUUID);
  if (player != null) {
    if (player.isOnline()) {
      return false;
    }
  }
  List<String> playerMessages=messages.get(playerUUID);
  if (playerMessages != null) {
    playerMessages.add(message);
  }
 else {
    playerMessages=new ArrayList<String>(Arrays.asList(message));
  }
  messages.put(playerUUID,playerMessages);
  return true;
}

Fixed version (ground truth):
/** 
 * Sets a message for the player to receive next time they login
 * @param player
 * @param message
 * @return true if player is offline, false if online
 */
protected boolean setMessage(UUID playerUUID,String message){
  getLogger().info("String_Node_Str" + message);
  Player player=getServer().getPlayer(playerUUID);
  if (player != null) {
    if (player.isOnline()) {
      return false;
    }
  }
  plugin.getLogger().info("String_Node_Str");
  List<String> playerMessages=messages.get(playerUUID);
  if (playerMessages != null) {
    playerMessages.add(message);
  }
 else {
    playerMessages=new ArrayList<String>(Arrays.asList(message));
  }
  messages.put(playerUUID,playerMessages);
  return true;
}
Program: 34083
Project: 34083
Buggy source:
/** 
 * @param slot
 * @param cost
 * @param description
 * @param name
 */
protected BiomeItem(Material material,int slot,double cost,String description,String name,boolean confirm,Biome biome){
  this.slot=slot;
  this.price=cost;
  this.name=name;
  this.confirm=confirm;
  this.biome=biome;
  item=new ItemStack(material);
  ItemMeta meta=item.getItemMeta();
  meta.setDisplayName(name);
  List<String> Lore=new ArrayList<String>();
  Lore=Challenges.chop(ChatColor.YELLOW,description,20);
  if (Settings.useEconomy && cost > 0D) {
    Lore.add(VaultHelper.econ.format(cost));
  }
  meta.setLore(Lore);
  item.setItemMeta(meta);
}

Fixed version (ground truth):
/** 
 * @param slot
 * @param cost
 * @param description
 * @param name
 */
protected BiomeItem(Material material,int slot,double cost,String description,String name,boolean confirm,Biome biome){
  this.slot=slot;
  this.price=cost;
  this.name=name;
  this.confirm=confirm;
  this.biome=biome;
  item=new ItemStack(material);
  ItemMeta meta=item.getItemMeta();
  meta.setDisplayName(name);
  List<String> Lore=new ArrayList<String>();
  Lore=Util.chop(ChatColor.YELLOW,description,20);
  if (Settings.useEconomy && cost > 0D) {
    Lore.add(VaultHelper.econ.format(cost));
  }
  meta.setLore(Lore);
  item.setItemMeta(meta);
}
Program: 34087
Project: 34087
Buggy source:
/** 
 * Sets an island to be owned by another player. If the new owner had an island, that island is released to null ownership
 * @param island
 * @param newOwner
 */
protected void setIslandOwner(Island island,UUID newOwner){
  if (ownershipMap.containsKey(newOwner)) {
    Island oldIsland=ownershipMap.get(newOwner);
    oldIsland.setOwner(null);
    ownershipMap.remove(newOwner);
  }
  if (newOwner != null && island != null) {
    UUID owner=island.getOwner();
    island.setOwner(newOwner);
    if (ownershipMap.containsKey(owner)) {
      ownershipMap.remove(owner);
    }
    if (ownershipMap.containsKey(newOwner)) {
      ownershipMap.get(newOwner).setOwner(null);
    }
    ownershipMap.put(newOwner,island);
  }
}

Fixed version (ground truth):
/** 
 * Sets an island to be owned by another player. If the new owner had an island, that island is released to null ownership
 * @param island
 * @param newOwner
 */
protected void setIslandOwner(Island island,UUID newOwner){
  UUID oldOwner=island.getOwner();
  if (newOwner == null && oldOwner != null) {
    ownershipMap.remove(oldOwner);
    island.setOwner(null);
    return;
  }
  if (ownershipMap.containsKey(newOwner)) {
    Island oldIsland=ownershipMap.get(newOwner);
    oldIsland.setOwner(null);
    ownershipMap.remove(newOwner);
  }
  if (newOwner != null && island != null) {
    island.setOwner(newOwner);
    if (oldOwner != null && ownershipMap.containsKey(oldOwner)) {
      ownershipMap.remove(oldOwner);
    }
    ownershipMap.put(newOwner,island);
  }
}
Program: 34089
Project: 34089
Buggy source:
/** 
 * Adds a player to a team. The player and the teamleader MAY be the same
 * @param playerUUID
 * @param teamLeader
 * @return
 */
protected boolean addPlayertoTeam(final UUID playerUUID,final UUID teamLeader){
  plugin.getPlayers().setJoinTeam(playerUUID,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
  if (!playerUUID.equals(teamLeader)) {
    if (plugin.getPlayers().getHomeLocation(teamLeader) != null) {
      plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getHomeLocation(teamLeader));
      plugin.getLogger().info("String_Node_Str");
    }
 else {
      plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
      plugin.getLogger().info("String_Node_Str");
    }
    if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
      plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
    }
    if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
      plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Adds a player to a team. The player and the teamleader MAY be the same
 * @param playerUUID
 * @param teamLeader
 * @return
 */
protected boolean addPlayertoTeam(final UUID playerUUID,final UUID teamLeader){
  plugin.getPlayers().setJoinTeam(playerUUID,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
  if (!playerUUID.equals(teamLeader)) {
    if (plugin.getPlayers().getHomeLocation(teamLeader) != null) {
      plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getHomeLocation(teamLeader));
    }
 else {
      plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
    }
    if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
      plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
    }
    if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
      plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
    }
  }
  return true;
}
Program: 34090
Project: 34090
Buggy source:
/** 
 * Removes a player from a team run by teamleader
 * @param player
 * @param teamleader
 */
protected void removePlayerFromTeam(final UUID player,final UUID teamleader){
  plugin.getPlayers().removeMember(teamleader,player);
  if (!player.equals(teamleader)) {
    plugin.getPlayers().setLeaveTeam(player);
    plugin.getPlayers().setHomeLocation(player,null);
    plugin.getPlayers().setIslandLocation(player,null);
    runCommands(Settings.leaveCommands,player);
  }
 else {
    plugin.getPlayers().setLeaveTeam(player);
  }
}

Fixed version (ground truth):
/** 
 * Removes a player from a team run by teamleader
 * @param player
 * @param teamleader
 */
protected void removePlayerFromTeam(final UUID player,final UUID teamleader){
  plugin.getPlayers().removeMember(teamleader,player);
  if (!player.equals(teamleader)) {
    plugin.getPlayers().setLeaveTeam(player);
    plugin.getPlayers().setHomeLocation(player,null);
    plugin.getPlayers().setIslandLocation(player,null);
    plugin.getPlayers().setTeamIslandLocation(player,null);
    runCommands(Settings.leaveCommands,player);
  }
 else {
    plugin.getPlayers().setLeaveTeam(player);
  }
}
Program: 34092
Project: 34092
Buggy source:
/** 
 * Transfers ownership of an island from one player to another
 * @param oldOwner
 * @param newOwner
 * @return
 */
protected boolean transferIsland(final UUID oldOwner,final UUID newOwner){
  if (players.hasIsland(oldOwner)) {
    Location islandLoc=players.getIslandLocation(oldOwner);
    players.setHasIsland(newOwner,true);
    players.setIslandLocation(newOwner,islandLoc);
    players.setTeamIslandLocation(newOwner,null);
    players.setHasIsland(oldOwner,false);
    players.setIslandLocation(oldOwner,null);
    players.setTeamIslandLocation(oldOwner,islandLoc);
    Island island=grid.getIslandAt(islandLoc);
    if (island != null) {
      grid.setIslandOwner(island,newOwner);
    }
    while (topTenList.values().remove(oldOwner))     ;
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Transfers ownership of an island from one player to another
 * @param oldOwner
 * @param newOwner
 * @return
 */
protected boolean transferIsland(final UUID oldOwner,final UUID newOwner){
  if (players.hasIsland(oldOwner)) {
    Location islandLoc=players.getIslandLocation(oldOwner);
    players.setHasIsland(newOwner,true);
    players.setIslandLocation(newOwner,islandLoc);
    players.setTeamIslandLocation(newOwner,null);
    players.setHasIsland(oldOwner,false);
    players.setIslandLocation(oldOwner,null);
    players.setTeamIslandLocation(oldOwner,islandLoc);
    Island island=grid.getIslandAt(islandLoc);
    if (island != null) {
      grid.setIslandOwner(island,newOwner);
    }
    topTenList.remove(oldOwner);
    return true;
  }
  return false;
}
Program: 34094
Project: 34094
Buggy source:
@Override public void run(){
  if (!plugin.isCalculatingLevel()) {
    this.cancel();
  }
  calculateSlice(counter,(counter - slice));
  counter=counter - slice - 1;
  if (counter <= 0) {
    plugin.getPlayers().setIslandLevel(targetPlayer,blockcount / 100);
    plugin.getPlayers().save(targetPlayer);
    if (plugin.getPlayers().inTeam(targetPlayer)) {
      for (      UUID member : plugin.getPlayers().getMembers(targetPlayer)) {
        plugin.getPlayers().setIslandLevel(member,blockcount / 100);
        plugin.getPlayers().save(member);
      }
    }
    if (!this.silent) {
      if (plugin.getPlayers().getIslandLevel(targetPlayer) > oldLevel) {
        plugin.tellOfflineTeam(targetPlayer,ChatColor.GREEN + Locale.islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
      }
      if (asker.isOnline()) {
        asker.sendMessage(ChatColor.GREEN + Locale.islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
      }
    }
    this.silent=false;
    plugin.topTenAddEntry(targetPlayer,blockcount / 100);
    plugin.setCalculatingLevel(false);
    this.cancel();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!plugin.isCalculatingLevel()) {
    this.cancel();
  }
  calculateSlice(counter,(counter - slice));
  counter=counter - slice - 1;
  if (counter <= 0) {
    plugin.getPlayers().setIslandLevel(targetPlayer,blockcount / 100);
    plugin.getPlayers().save(targetPlayer);
    if (plugin.getPlayers().inTeam(targetPlayer)) {
      for (      UUID member : plugin.getPlayers().getMembers(targetPlayer)) {
        plugin.getPlayers().setIslandLevel(member,blockcount / 100);
        plugin.getPlayers().save(member);
      }
    }
    if (!this.silent) {
      if (plugin.getPlayers().getIslandLevel(targetPlayer) > oldLevel) {
        plugin.tellOfflineTeam(targetPlayer,ChatColor.GREEN + Locale.islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
      }
      if (asker.isOnline()) {
        asker.sendMessage(ChatColor.GREEN + Locale.islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
      }
    }
    this.silent=false;
    if (plugin.getPlayers().inTeam(targetPlayer)) {
      UUID leader=plugin.getPlayers().getTeamLeader(targetPlayer);
      if (leader != null) {
        plugin.topTenAddEntry(leader,blockcount / 100);
      }
    }
 else {
      plugin.topTenAddEntry(targetPlayer,blockcount / 100);
    }
    plugin.setCalculatingLevel(false);
    this.cancel();
  }
}
Program: 34095
Project: 34095
Buggy source:
protected static List<String> chop(ChatColor color,String longLine,int length){
  List<String> result=new ArrayList<String>();
  int i=0;
  for (i=0; i < longLine.length(); i+=length) {
    int endIndex=Math.min(i + length,longLine.length());
    String line=longLine.substring(i,endIndex);
    if (endIndex < longLine.length()) {
      if (!line.substring(line.length() - 1).equals("String_Node_Str")) {
        if (!longLine.substring(endIndex,endIndex + 1).equals("String_Node_Str")) {
          int lastSpace=line.lastIndexOf("String_Node_Str");
          if (lastSpace < line.length()) {
            line=line.substring(0,lastSpace);
            i-=(length - lastSpace - 1);
          }
        }
      }
    }
    result.add(color + line);
  }
  return result;
}

Fixed version (ground truth):
protected static List<String> chop(ChatColor color,String longLine,int length){
  List<String> result=new ArrayList<String>();
  int i=0;
  for (i=0; i < longLine.length(); i+=length) {
    int endIndex=Math.min(i + length,longLine.length());
    String line=longLine.substring(i,endIndex);
    if (endIndex < longLine.length()) {
      if (!line.substring(line.length() - 1).equals("String_Node_Str")) {
        if (!longLine.substring(endIndex,endIndex + 1).equals("String_Node_Str")) {
          int lastSpace=line.lastIndexOf("String_Node_Str");
          if (lastSpace != -1 && lastSpace < line.length()) {
            line=line.substring(0,lastSpace);
            i-=(length - lastSpace - 1);
          }
        }
      }
    }
    result.add(color + line);
  }
  return result;
}
Program: 34096
Project: 34096
Buggy source:
/** 
 * Returns the number of challenges that must still be completed to finish a level Based on how many challenges there are in a level, how many have been done and how many are okay to leave undone.
 * @param player
 * @param level
 * @return
 */
protected int checkLevelCompletion(final Player player,final String level){
  int challengesCompleted=0;
  List<String> levelChallengeList=challengeList.get(level);
  for (  String challenge : levelChallengeList) {
    if (players.checkChallenge(player.getUniqueId(),challenge)) {
      challengesCompleted++;
    }
  }
  return levelChallengeList.size() - Settings.waiverAmount - challengesCompleted;
}

Fixed version (ground truth):
/** 
 * Returns the number of challenges that must still be completed to finish a level Based on how many challenges there are in a level, how many have been done and how many are okay to leave undone.
 * @param player
 * @param level
 * @return
 */
protected int checkLevelCompletion(final Player player,final String level){
  int challengesCompleted=0;
  List<String> levelChallengeList=challengeList.get(level);
  if (levelChallengeList != null) {
    for (    String challenge : levelChallengeList) {
      if (players.checkChallenge(player.getUniqueId(),challenge)) {
        challengesCompleted++;
      }
    }
    return levelChallengeList.size() - Settings.waiverAmount - challengesCompleted;
  }
  return 0;
}
Program: 34097
Project: 34097
Buggy source:
/** 
 * Determines if an island is at a location in this area location. Also checks if the spawn island is in this area.
 * @param loc
 * @return
 */
protected boolean islandAtLocation(final Location loc){
  if (loc == null) {
    return true;
  }
  if (loc.getBlock().getType().equals(Material.BEDROCK)) {
    return true;
  }
  Vector v=loc.toVector();
  v.multiply(new Vector(1,0,1));
  if ((getSpawn().getSpawnLoc() != null && v.distanceSquared(getSpawn().getSpawnLoc().toVector().multiply(new Vector(1,0,1))) < (double)((double)Settings.islandDistance) * Settings.islandDistance)) {
    return true;
  }
  String checkName=loc.getBlockX() + "String_Node_Str" + loc.getBlockZ()+ "String_Node_Str";
  final File islandFile=new File(plugin.getDataFolder() + File.separator + "String_Node_Str"+ File.separator+ checkName);
  if (islandFile.exists()) {
    return true;
  }
  final int px=loc.getBlockX();
  final int pz=loc.getBlockZ();
  for (int x=-5; x <= 5; x++) {
    for (int y=10; y <= 255; y++) {
      for (int z=-5; z <= 5; z++) {
        if (loc.getWorld().getBlockAt(x + px,y,z + pz).getType().equals(Material.BEDROCK)) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if an island is at a location in this area location. Also checks if the spawn island is in this area.
 * @param loc
 * @return
 */
protected boolean islandAtLocation(final Location loc){
  if (loc == null) {
    return true;
  }
  if (loc.getBlock().getType().equals(Material.BEDROCK)) {
    return true;
  }
  Vector v=loc.toVector();
  v.multiply(new Vector(1,0,1));
  if ((getSpawn().getSpawnLoc() != null && v.distanceSquared(getSpawn().getSpawnLoc().toVector().multiply(new Vector(1,0,1))) < (double)((double)spawn.getRange()) * spawn.getRange())) {
    return true;
  }
  String checkName=loc.getBlockX() + "String_Node_Str" + loc.getBlockZ()+ "String_Node_Str";
  final File islandFile=new File(plugin.getDataFolder() + File.separator + "String_Node_Str"+ File.separator+ checkName);
  if (islandFile.exists()) {
    return true;
  }
  final int px=loc.getBlockX();
  final int pz=loc.getBlockZ();
  for (int x=-5; x <= 5; x++) {
    for (int y=10; y <= 255; y++) {
      for (int z=-5; z <= 5; z++) {
        if (loc.getWorld().getBlockAt(x + px,y,z + pz).getType().equals(Material.BEDROCK)) {
          return true;
        }
      }
    }
  }
  return false;
}