nus-yam/ex-repair huggingface dataset:
Program: 33942
Project: 33942
Buggy source:
/** 
 * Removes flymode with a delay if player leave his island.
 * @param e
 */
@SuppressWarnings("String_Node_Str") @EventHandler public void onPlayerLeaveIsland(IslandExitEvent e){
  Player p=Bukkit.getServer().getPlayer(e.getPlayer());
  if (p.hasPermission("String_Node_Str") && !plugin.getGrid().playerIsOnIsland(p) && p.isFlying()) {
    Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin,new Runnable(){
      @Override public void run(){
        if (!plugin.getGrid().playerIsOnIsland(p) && p.isFlying()) {
          p.setAllowFlight(false);
          p.setFlying(false);
        }
      }
    }
,20 * Settings.flyTimeOutside);
  }
}

Fixed version (ground truth):
/** 
 * Removes flymode with a delay if player leave his island.
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void onPlayerLeaveIsland(IslandExitEvent e){
  final Player player=plugin.getServer().getPlayer(e.getPlayer());
  if (VaultHelper.checkPerm(player,Settings.PERMPREFIX + "String_Node_Str") && !plugin.getGrid().playerIsOnIsland(player) && player.isFlying()) {
    plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
      @Override public void run(){
        if (!plugin.getGrid().playerIsOnIsland(player) && player.isFlying()) {
          player.setAllowFlight(false);
          player.setFlying(false);
        }
      }
    }
,20 * Settings.flyTimeOutside);
  }
}
Program: 33943
Project: 33943
Buggy source:
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=false) public void onVistorDeath(final PlayerDeathEvent e){
  if (DEBUG) {
    plugin.getLogger().info(e.getEventName());
  }
  if (!IslandGuard.inWorld(e.getEntity())) {
    return;
  }
  if (Settings.muteDeathMessages) {
    e.setDeathMessage(null);
  }
  if (plugin.getGrid().playerIsOnIsland(e.getEntity())) {
    return;
  }
  if (Settings.allowVisitorKeepInvOnDeath) {
    InventorySave.getInstance().savePlayerInventory(e.getEntity());
    e.getDrops().clear();
    e.setKeepLevel(true);
    e.setDroppedExp(0);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onVistorDeath(final PlayerDeathEvent e){
  if (DEBUG) {
    plugin.getLogger().info(e.getEventName());
  }
  if (!IslandGuard.inWorld(e.getEntity())) {
    return;
  }
  if (Settings.muteDeathMessages) {
    e.setDeathMessage(null);
  }
  if (plugin.getGrid().playerIsOnIsland(e.getEntity())) {
    return;
  }
  if (Settings.allowVisitorKeepInvOnDeath) {
    InventorySave.getInstance().savePlayerInventory(e.getEntity());
    e.getDrops().clear();
    e.setKeepLevel(true);
    e.setDroppedExp(0);
  }
}
Program: 33944
Project: 33944
Buggy source:
/** 
 * @return the spawnPoint
 */
public Location getSpawnPoint(){
  return spawn.getSpawnPoint();
}

Fixed version (ground truth):
/** 
 * @return the spawnPoint or null if spawn does not exist
 */
public Location getSpawnPoint(){
  if (spawn == null)   return null;
  return spawn.getSpawnPoint();
}
Program: 33945
Project: 33945
Buggy source:
/** 
 * @return the spawn
 */
public Island getSpawn(){
  return spawn;
}

Fixed version (ground truth):
/** 
 * @return the spawn or null if spawn does not exist
 */
public Island getSpawn(){
  return spawn;
}
Program: 33946
Project: 33946
Buggy source:
/** 
 * Prevents visitors from getting damage if invinciblevisitors option is set to TRUE
 * @param e
 */
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=false) public void onVisitorGetDamage(EntityDamageEvent e){
  if (!Settings.invincibleVisitors)   return;
  if (!(e.getEntity() instanceof Player))   return;
  Player p=(Player)e.getEntity();
  if (!IslandGuard.inWorld(p) || plugin.getGrid().locationIsOnIsland(p,p.getLocation()))   return;
  if (Settings.visitorDamagePrevention.contains(e.getCause()))   e.setCancelled(true);
 else   if (e.getCause().equals(DamageCause.VOID)) {
    if (plugin.getPlayers().hasIsland(p.getUniqueId())) {
      Location safePlace=plugin.getGrid().getSafeHomeLocation(p.getUniqueId(),1);
      if (safePlace != null) {
        p.teleport(safePlace);
        p.setFallDistance(0);
        e.setCancelled(true);
        return;
      }
    }
    if (plugin.getGrid().getSpawnPoint() != null) {
      p.teleport(plugin.getGrid().getSpawnPoint());
      p.setFallDistance(0);
      e.setCancelled(true);
      return;
    }
    if (!p.performCommand("String_Node_Str")) {
      return;
    }
    p.setFallDistance(0);
    e.setCancelled(true);
  }
}

Fixed version (ground truth):
/** 
 * Prevents visitors from getting damage if invinciblevisitors option is set to TRUE
 * @param e
 */
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=false) public void onVisitorGetDamage(EntityDamageEvent e){
  if (!Settings.invincibleVisitors)   return;
  if (!(e.getEntity() instanceof Player))   return;
  Player p=(Player)e.getEntity();
  if (!IslandGuard.inWorld(p) || plugin.getGrid().locationIsOnIsland(p,p.getLocation()))   return;
  if (Settings.visitorDamagePrevention.contains(e.getCause()))   e.setCancelled(true);
 else   if (e.getCause().equals(DamageCause.VOID)) {
    if (plugin.getPlayers().hasIsland(p.getUniqueId())) {
      Location safePlace=plugin.getGrid().getSafeHomeLocation(p.getUniqueId(),1);
      if (safePlace != null) {
        p.teleport(safePlace);
        p.setFallDistance(0);
        e.setCancelled(true);
        return;
      }
    }
    if (plugin.getGrid().getSpawn() != null) {
      p.teleport(plugin.getGrid().getSpawnPoint());
      p.setFallDistance(0);
      e.setCancelled(true);
      return;
    }
    if (!p.performCommand("String_Node_Str")) {
      return;
    }
    p.setFallDistance(0);
    e.setCancelled(true);
  }
}
Program: 33947
Project: 33947
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onChat(final AsyncPlayerChatEvent event){
  if (DEBUG)   plugin.getLogger().info("String_Node_Str" + event.getEventName());
  String level="String_Node_Str";
  if (playerLevels.containsKey(event.getPlayer().getUniqueId())) {
    level=playerLevels.get(event.getPlayer().getUniqueId());
  }
  String format=event.getFormat().replace(Settings.chatLevelPrefix,level);
  level="String_Node_Str";
  if (playerChallengeLevels.containsKey(event.getPlayer().getUniqueId())) {
    level=playerChallengeLevels.get(event.getPlayer().getUniqueId());
  }
  format=format.replace(Settings.chatChallengeLevelPrefix,level);
  event.setFormat(format);
  if (Settings.teamChat && teamChatUsers.containsKey(event.getPlayer().getUniqueId())) {
    event.setCancelled(true);
    Bukkit.getScheduler().runTask(plugin,new Runnable(){
      @Override public void run(){
        teamChat(event,event.getMessage());
      }
    }
);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onChat(final AsyncPlayerChatEvent event){
  if (DEBUG)   plugin.getLogger().info("String_Node_Str" + event.getEventName());
  String level="String_Node_Str";
  if (playerLevels.containsKey(event.getPlayer().getUniqueId())) {
    level=playerLevels.get(event.getPlayer().getUniqueId());
  }
  String format=event.getFormat().replace(Settings.chatLevelPrefix,level);
  level="String_Node_Str";
  if (playerChallengeLevels.containsKey(event.getPlayer().getUniqueId())) {
    level=playerChallengeLevels.get(event.getPlayer().getUniqueId());
  }
  format=format.replace(Settings.chatChallengeLevelPrefix,level);
  event.setFormat(format);
  if (Settings.teamChat && teamChatUsers.containsKey(event.getPlayer().getUniqueId())) {
    event.setCancelled(true);
    Bukkit.getScheduler().runTask(plugin,new Runnable(){
      @Override public void run(){
        teamChat(event,event.getMessage());
      }
    }
);
  }
}
Program: 33949
Project: 33949
Buggy source:
/** 
 * Handles push protection
 * @param player
 */
public void setPush(Player player){
  scoreboard=player.getScoreboard();
  if (scoreboard == null) {
    scoreboard=Bukkit.getScoreboardManager().getNewScoreboard();
  }
  if (Settings.allowPushing) {
    if (scoreboard.getTeam("String_Node_Str") != null) {
      scoreboard.getTeam("String_Node_Str").unregister();
    }
    return;
  }
  pushTeam=scoreboard.getEntryTeam(player.getName());
  if (pushTeam == null) {
    pushTeam=scoreboard.getTeam("String_Node_Str");
    if (pushTeam == null) {
      pushTeam=scoreboard.registerNewTeam("String_Node_Str");
    }
    pushTeam.addEntry(player.getName());
  }
  if (pushTeam.getName().equals("String_Node_Str")) {
    pushTeam.setOption(Team.Option.COLLISION_RULE,Team.OptionStatus.NEVER);
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Handles push protection
 * @param player
 */
public void setPush(Player player){
  scoreboard=player.getScoreboard();
  if (scoreboard == null) {
    scoreboard=Bukkit.getScoreboardManager().getNewScoreboard();
  }
  if (Settings.allowPushing) {
    if (scoreboard.getTeam(NO_PUSH_TEAM_NAME) != null) {
      scoreboard.getTeam(NO_PUSH_TEAM_NAME).unregister();
    }
    return;
  }
  pushTeam=scoreboard.getEntryTeam(player.getName());
  if (pushTeam == null) {
    pushTeam=scoreboard.getTeam(NO_PUSH_TEAM_NAME);
    if (pushTeam == null) {
      pushTeam=scoreboard.registerNewTeam(NO_PUSH_TEAM_NAME);
    }
    pushTeam.addEntry(player.getName());
  }
  if (pushTeam.getName().equals(NO_PUSH_TEAM_NAME)) {
    pushTeam.setOption(Team.Option.COLLISION_RULE,Team.OptionStatus.NEVER);
  }
 else {
  }
}
Program: 33950
Project: 33950
Buggy source:
/** 
 * Handles cleaning push protection on Quit
 * @param player
 */
private void removePush(Player player){
  scoreboard=player.getScoreboard();
  if (scoreboard != null) {
    Team pTeam=scoreboard.getTeam("String_Node_Str");
    pTeam.getEntries().remove(player.getName());
  }
}

Fixed version (ground truth):
/** 
 * Handles cleaning push protection on player quit
 * @param player
 */
private void removePush(Player player){
  try {
    scoreboard=player.getScoreboard();
    if (scoreboard != null) {
      Team pTeam=scoreboard.getTeam(NO_PUSH_TEAM_NAME);
      if (pTeam != null) {
        pTeam.removeEntry(player.getName());
      }
    }
  }
 catch (  Exception e) {
    plugin.getLogger().severe("String_Node_Str");
    plugin.getLogger().severe(player.getName() + "String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}
Program: 33951
Project: 33951
Buggy source:
public IslandGuard1_9(final ASkyBlock plugin){
  this.plugin=plugin;
}

Fixed version (ground truth):
public IslandGuard1_9(final ASkyBlock plugin){
  this.plugin=plugin;
  if (!Settings.allowPushing) {
    try {
      scoreboard=plugin.getServer().getScoreboardManager().getMainScoreboard();
      if (scoreboard != null) {
        Team pTeam=scoreboard.getTeam(NO_PUSH_TEAM_NAME);
        if (pTeam != null) {
          pTeam.unregister();
        }
      }
    }
 catch (    Exception e) {
      plugin.getLogger().warning("String_Node_Str");
    }
  }
}
Program: 33952
Project: 33952
Buggy source:
/** 
 * Triggers a push protection change or not
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void onPlayerJoin(final PlayerJoinEvent e){
  if (Settings.allowPushing) {
    Team t=e.getPlayer().getScoreboard().getTeam("String_Node_Str");
    if (t != null) {
      t.unregister();
    }
    return;
  }
  setPush(e.getPlayer());
}

Fixed version (ground truth):
/** 
 * Triggers a push protection change or not
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void onPlayerJoin(final PlayerJoinEvent e){
  if (Settings.allowPushing) {
    Team t=e.getPlayer().getScoreboard().getTeam(NO_PUSH_TEAM_NAME);
    if (t != null) {
      t.unregister();
    }
    return;
  }
  setPush(e.getPlayer());
}
Program: 33954
Project: 33954
Buggy source:
/** 
 * Magic Cobble Generator
 * @param e
 */
@SuppressWarnings("String_Node_Str") @EventHandler public void onCobbleGen(BlockFromToEvent e){
  if (!Settings.useMagicCobbleGen)   return;
  if (!e.getBlock().getWorld().getName().equalsIgnoreCase(Settings.worldName))   return;
  int id=e.getBlock().getTypeId();
  if ((id >= 8) && (id <= 11)) {
    Block b=e.getToBlock();
    int toID=b.getTypeId();
    if ((toID == 0) && (generatesCobble(id,b))) {
      Material change=null;
      if (!Settings.magicCobbleGenChances.isEmpty()) {
        for (        Entry<Material,Double> entry : Settings.magicCobbleGenChances.entrySet()) {
          Random random=new Random();
          double d=random.nextDouble() * 100.0D;
          if (d - entry.getValue() < 0.0D)           change=entry.getKey();
        }
      }
      if (change == null)       return;
      b.setTypeIdAndData(change.getId(),(byte)0,true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Magic Cobble Generator
 * @param e
 */
@SuppressWarnings("String_Node_Str") @EventHandler public void onCobbleGen(BlockFromToEvent e){
  if (!Settings.useMagicCobbleGen)   return;
  int id=e.getBlock().getTypeId();
  if ((id >= 8) && (id <= 11)) {
    Block b=e.getToBlock();
    int toID=b.getTypeId();
    if ((toID == 0) && (generatesCobble(id,b))) {
      Material change=null;
      if (!Settings.magicCobbleGenChances.isEmpty()) {
        for (        Entry<Material,Double> entry : Settings.magicCobbleGenChances.entrySet()) {
          Random random=new Random();
          double d=random.nextDouble() * 100.0D;
          if (d - entry.getValue() < 0.0D)           change=entry.getKey();
        }
      }
      if (change == null)       return;
      b.setTypeIdAndData(change.getId(),(byte)0,true);
    }
  }
}
Program: 33955
Project: 33955
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_10_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().A(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_10_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33956
Project: 33956
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  Bukkit.getLogger().info("String_Node_Str" + itemStack.toString());
  net.minecraft.server.v1_7_R3.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().notify(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  Bukkit.getLogger().info("String_Node_Str" + itemStack.toString());
  net.minecraft.server.v1_7_R3.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33957
Project: 33957
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  net.minecraft.server.v1_7_R4.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().notify(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ());
  net.minecraft.server.v1_7_R4.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33958
Project: 33958
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().notify(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33959
Project: 33959
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R2.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().notify(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R2.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33960
Project: 33960
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R3.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().notify(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_8_R3.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33961
Project: 33961
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_9_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().A(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_9_R1.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33962
Project: 33962
Buggy source:
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_9_R2.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
  cw.getHandle().A(bp);
  Chunk ch=loc.getChunk();
  cw.refreshChunk(ch.getX(),ch.getZ());
}

Fixed version (ground truth):
@Override public void setFlowerPotBlock(Block block,ItemStack itemStack){
  Location loc=block.getLocation();
  CraftWorld cw=(CraftWorld)block.getWorld();
  BlockPosition bp=new BlockPosition(loc.getX(),loc.getY(),loc.getZ());
  TileEntityFlowerPot te=(TileEntityFlowerPot)cw.getHandle().getTileEntity(bp);
  net.minecraft.server.v1_9_R2.ItemStack cis=CraftItemStack.asNMSCopy(itemStack);
  te.a(cis.getItem(),cis.getData());
  te.update();
}
Program: 33964
Project: 33964
Buggy source:
/** 
 * Stores warps in the warp array
 * @param player
 * @param loc
 */
public boolean addWarp(final UUID player,Location loc){
  if (warpList.containsValue(loc)) {
    return false;
  }
  if (warpList.containsKey(player)) {
    warpList.remove(player);
  }
  warpList.put(player,loc);
  saveWarpList();
  plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
    @Override public void run(){
      plugin.getWarpPanel().addWarp(player);
      plugin.getWarpPanel().updatePanel();
      Bukkit.getPluginManager().callEvent(new WarpCreateEvent(plugin,loc,player));
    }
  }
);
  return true;
}

Fixed version (ground truth):
/** 
 * Stores warps in the warp array
 * @param player
 * @param loc
 */
public boolean addWarp(final UUID player,final Location loc){
  if (warpList.containsValue(loc)) {
    return false;
  }
  if (warpList.containsKey(player)) {
    warpList.remove(player);
  }
  warpList.put(player,loc);
  saveWarpList();
  plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
    @Override public void run(){
      plugin.getWarpPanel().addWarp(player);
      plugin.getWarpPanel().updatePanel();
      Bukkit.getPluginManager().callEvent(new WarpCreateEvent(plugin,loc,player));
    }
  }
);
  return true;
}
Program: 33970
Project: 33970
Buggy source:
/** 
 * Removes monsters around location l
 * @param l
 */
public void removeMobs(final Location l){
  if (this.isAtSpawn(l)) {
    return;
  }
  final int px=l.getBlockX();
  final int py=l.getBlockY();
  final int pz=l.getBlockZ();
  for (int x=-1; x <= 1; x++) {
    for (int z=-1; z <= 1; z++) {
      final Chunk c=l.getWorld().getChunkAt(new Location(l.getWorld(),px + x * 16,py,pz + z * 16));
      if (c.isLoaded()) {
        for (        final Entity e : c.getEntities()) {
          if (e instanceof Monster && !Settings.mobWhiteList.contains(e.getType())) {
            Monster monster=(Monster)e;
            if (monster.getCustomName() == null || monster.getRemoveWhenFarAway()) {
              e.remove();
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes monsters around location l
 * @param l
 */
public void removeMobs(final Location l){
  if (!inWorld(l)) {
    return;
  }
  if (this.isAtSpawn(l)) {
    return;
  }
  final int px=l.getBlockX();
  final int py=l.getBlockY();
  final int pz=l.getBlockZ();
  for (int x=-1; x <= 1; x++) {
    for (int z=-1; z <= 1; z++) {
      final Chunk c=l.getWorld().getChunkAt(new Location(l.getWorld(),px + x * 16,py,pz + z * 16));
      if (c.isLoaded()) {
        for (        final Entity e : c.getEntities()) {
          if (e instanceof Monster && !Settings.mobWhiteList.contains(e.getType())) {
            Monster monster=(Monster)e;
            if (monster.getCustomName() == null || monster.getRemoveWhenFarAway()) {
              e.remove();
            }
          }
        }
      }
    }
  }
}
Program: 33971
Project: 33971
Buggy source:
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onPlayerFall(final PlayerMoveEvent e){
  if (e.getPlayer().isDead()) {
    return;
  }
  if (!IslandGuard.inWorld(e.getPlayer())) {
    unsetFalling(e.getPlayer().getUniqueId());
    return;
  }
  if (Settings.allowTeleportWhenFalling) {
    return;
  }
  if (!e.getPlayer().getGameMode().equals(GameMode.SURVIVAL) || e.getPlayer().isOp() || e.getPlayer().isFlying()) {
    return;
  }
  if (e.getPlayer().getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR && e.getPlayer().getLocation().getBlock().getType() == Material.AIR) {
    setFalling(e.getPlayer().getUniqueId());
  }
 else {
    unsetFalling(e.getPlayer().getUniqueId());
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void onPlayerFall(final PlayerMoveEvent e){
  if (e.getPlayer().isDead()) {
    return;
  }
  if (!IslandGuard.inWorld(e.getPlayer()) || Settings.allowTeleportWhenFalling || !e.getPlayer().getGameMode().equals(GameMode.SURVIVAL)|| e.getPlayer().isOp()|| e.getPlayer().isFlying()) {
    fallingPlayers.remove(e.getPlayer().getUniqueId());
    return;
  }
  if (e.getPlayer().getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR && e.getPlayer().getLocation().getBlock().getType() == Material.AIR) {
    setFalling(e.getPlayer().getUniqueId());
  }
 else {
    unsetFalling(e.getPlayer().getUniqueId());
  }
}
Program: 33977
Project: 33977
Buggy source:
/** 
 * Gets a list of all the players that are currently coop on this island
 * @param island
 * @return List of UUID's of players that have coop rights to the island
 */
public List<UUID> getCoopPlayers(Location island){
  List<UUID> result=new ArrayList<UUID>();
  for (  UUID player : coopPlayers.keySet()) {
    if (coopPlayers.get(player).containsKey(island)) {
      result.add(player);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets a list of all the players that are currently coop on this island
 * @param islandLoc
 * @return List of UUID's of players that have coop rights to the island
 */
public List<UUID> getCoopPlayers(Location islandLoc){
  Island coopIsland=plugin.getGrid().getIslandAt(islandLoc);
  List<UUID> result=new ArrayList<UUID>();
  if (coopIsland != null) {
    for (    UUID player : coopPlayers.keySet()) {
      if (coopPlayers.get(player).containsKey(coopIsland.getCenter())) {
        result.add(player);
      }
    }
  }
  return result;
}
Program: 33978
Project: 33978
Buggy source:
/** 
 * Goes through all the known coops and removes any that were invited by clearer. Returns any inventory Can be used when clearer logs out or when they are kicked or leave a team
 * @param clearer
 * @param target
 */
public void clearMyInvitedCoops(Player clearer){
  Island coopIsland=plugin.getGrid().getIsland(clearer.getUniqueId());
  for (  UUID players : coopPlayers.keySet()) {
    Iterator<Entry<Location,UUID>> en=coopPlayers.get(players).entrySet().iterator();
    while (en.hasNext()) {
      Entry<Location,UUID> entry=en.next();
      if (entry.getValue().equals(clearer.getUniqueId())) {
        Player target=plugin.getServer().getPlayer(players);
        if (target != null) {
          target.sendMessage(ChatColor.RED + "String_Node_Str" + clearer.getDisplayName()+ "String_Node_Str");
        }
        final CoopLeaveEvent event=new CoopLeaveEvent(players,clearer.getUniqueId(),coopIsland);
        plugin.getServer().getPluginManager().callEvent(event);
        en.remove();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Goes through all the known coops and removes any that were invited by clearer. Returns any inventory Can be used when clearer logs out or when they are kicked or leave a team
 * @param clearer
 * @param target
 */
public void clearMyInvitedCoops(Player clearer){
  Island coopIsland=plugin.getGrid().getIsland(clearer.getUniqueId());
  for (  UUID playerUUID : coopPlayers.keySet()) {
    Iterator<Entry<Location,UUID>> en=coopPlayers.get(playerUUID).entrySet().iterator();
    while (en.hasNext()) {
      Entry<Location,UUID> entry=en.next();
      if (entry.getValue().equals(clearer.getUniqueId())) {
        Player target=plugin.getServer().getPlayer(playerUUID);
        if (target != null) {
          target.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).coopRemoved.replace("String_Node_Str",clearer.getDisplayName()));
        }
 else {
          plugin.getMessages().setMessage(playerUUID,ChatColor.RED + plugin.myLocale(playerUUID).coopRemoved.replace("String_Node_Str",clearer.getDisplayName()));
        }
        final CoopLeaveEvent event=new CoopLeaveEvent(playerUUID,clearer.getUniqueId(),coopIsland);
        plugin.getServer().getPluginManager().callEvent(event);
        en.remove();
      }
    }
  }
}
Program: 33979
Project: 33979
Buggy source:
public boolean removeCoopPlayer(Player requester,UUID targetPlayerUUID){
  boolean removed=false;
  if (coopPlayers.containsKey(targetPlayerUUID)) {
    if (plugin.getPlayers().getIslandLocation(requester.getUniqueId()) != null) {
      removed=coopPlayers.get(targetPlayerUUID).remove(plugin.getPlayers().getIslandLocation(requester.getUniqueId())) != null ? true : false;
      Island coopIsland=plugin.getGrid().getIsland(requester.getUniqueId());
      final CoopLeaveEvent event=new CoopLeaveEvent(targetPlayerUUID,requester.getUniqueId(),coopIsland);
      plugin.getServer().getPluginManager().callEvent(event);
    }
  }
  return removed;
}

Fixed version (ground truth):
public boolean removeCoopPlayer(Player requester,UUID targetPlayerUUID){
  boolean removed=false;
  if (coopPlayers.containsKey(targetPlayerUUID)) {
    Island coopIsland=plugin.getGrid().getIsland(requester.getUniqueId());
    if (coopIsland != null) {
      removed=coopPlayers.get(targetPlayerUUID).remove(coopIsland.getCenter()) != null ? true : false;
      final CoopLeaveEvent event=new CoopLeaveEvent(targetPlayerUUID,requester.getUniqueId(),coopIsland);
      plugin.getServer().getPluginManager().callEvent(event);
    }
  }
  return removed;
}
Program: 33980
Project: 33980
Buggy source:
/** 
 * Sets a player's coops from string. Used when loading a player.
 * @param playerUUID
 * @param coops
 */
private void setMyCoops(UUID playerUUID,List<String> coops){
  try {
    HashMap<Location,UUID> temp=new HashMap<Location,UUID>();
    for (    String coop : coops) {
      String[] split=coop.split("String_Node_Str");
      if (split.length == 2) {
        temp.put(Util.getLocationString(split[0]),UUID.fromString(split[1]));
      }
    }
    coopPlayers.put(playerUUID,temp);
  }
 catch (  Exception e) {
    plugin.getLogger().severe("String_Node_Str" + playerUUID);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Sets a player's coops from string. Used when loading a player.
 * @param playerUUID
 * @param coops
 */
private void setMyCoops(UUID playerUUID,List<String> coops){
  try {
    HashMap<Location,UUID> temp=new HashMap<Location,UUID>();
    for (    String coop : coops) {
      String[] split=coop.split("String_Node_Str");
      if (split.length == 2) {
        Island coopIsland=plugin.getGrid().getIslandAt(Util.getLocationString(split[0]));
        if (coopIsland != null) {
          temp.put(coopIsland.getCenter(),UUID.fromString(split[1]));
        }
      }
    }
    coopPlayers.put(playerUUID,temp);
  }
 catch (  Exception e) {
    plugin.getLogger().severe("String_Node_Str" + playerUUID);
    e.printStackTrace();
  }
}
Program: 33981
Project: 33981
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.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;
}

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())));
  if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {
    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: 33986
Project: 33986
Buggy source:
/** 
 * Calculates the island level. Only the fast calc is supported. The island calculation runs async and fires an IslandLevelEvent when completed or use getIslandLevel(playerUUID). See https://gist.github.com/tastybento/e81d2403c03f2fe26642 for example code.
 * @param playerUUID
 * @return true if player has an island, false if not
 */
public boolean calculateIslandLevel(UUID playerUUID){
  if (plugin.getPlayers().inTeam(playerUUID) && !plugin.getPlayers().hasIsland(playerUUID)) {
    new LevelCalcByChunk(plugin,playerUUID,null,true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Calculates the island level. Only the fast calc is supported. The island calculation runs async and fires an IslandLevelEvent when completed or use getIslandLevel(playerUUID). See https://gist.github.com/tastybento/e81d2403c03f2fe26642 for example code.
 * @param playerUUID
 * @return true if player has an island, false if not
 */
public boolean calculateIslandLevel(UUID playerUUID){
  if (plugin.getPlayers().inTeam(playerUUID) && !plugin.getPlayers().hasIsland(playerUUID)) {
    new LevelCalcByChunk(plugin,playerUUID,null,false);
    return true;
  }
  return false;
}
Program: 33995
Project: 33995
Buggy source:
@Override public void run(){
  Iterator<Pair> it1=chunksToClear.iterator();
  while (it1.hasNext()) {
    Pair entry=it1.next();
    ASkyBlock.getIslandWorld().regenerateChunk(entry.getLeft(),entry.getRight());
    if (Settings.createNether && Settings.newNether) {
      ASkyBlock.getNetherWorld().regenerateChunk(entry.getLeft(),entry.getRight());
    }
    it1.remove();
  }
}

Fixed version (ground truth):
@Override public void run(){
  Iterator<Pair> it1=chunksToClear.iterator();
  while (it1.hasNext()) {
    Pair entry=it1.next();
    ASkyBlock.getIslandWorld().regenerateChunk(entry.getLeft(),entry.getRight());
    if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {
      ASkyBlock.getNetherWorld().regenerateChunk(entry.getLeft(),entry.getRight());
    }
    it1.remove();
  }
}
Program: 33996
Project: 33996
Buggy source:
/** 
 * Checks if a location is within this island's protected area
 * @param target
 * @return true if it is, false if not
 */
public boolean onIsland(Location target){
  if (world != null) {
    if (target.getWorld().equals(world) || (Settings.createNether && Settings.newNether && target.getWorld().equals(ASkyBlock.getNetherWorld()))) {
      if (target.getBlockX() >= minProtectedX && target.getBlockX() < (minProtectedX + protectionRange) && target.getBlockZ() >= minProtectedZ && target.getBlockZ() < (minProtectedZ + protectionRange)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if a location is within this island's protected area
 * @param target
 * @return true if it is, false if not
 */
public boolean onIsland(Location target){
  if (world != null) {
    if (target.getWorld().equals(world) || (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null && target.getWorld().equals(ASkyBlock.getNetherWorld()))) {
      if (target.getBlockX() >= minProtectedX && target.getBlockX() < (minProtectedX + protectionRange) && target.getBlockZ() >= minProtectedZ && target.getBlockZ() < (minProtectedZ + protectionRange)) {
        return true;
      }
    }
  }
  return false;
}
Program: 34004
Project: 34004
Buggy source:
/** 
 * Determines if a location is in the island world or not or in the new nether if it is activated
 * @param loc
 * @return true if in the island world
 */
protected static boolean inWorld(Location loc){
  if (loc.getWorld().equals(ASkyBlock.getIslandWorld())) {
    return true;
  }
  if (Settings.createNether && Settings.newNether && loc.getWorld().equals(ASkyBlock.getNetherWorld())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if a location is in the island world or not or in the new nether if it is activated
 * @param loc
 * @return true if in the island world
 */
protected static boolean inWorld(Location loc){
  if (loc.getWorld().equals(ASkyBlock.getIslandWorld())) {
    return true;
  }
  if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null && loc.getWorld().equals(ASkyBlock.getNetherWorld())) {
    return true;
  }
  return false;
}
Program: 34010
Project: 34010
Buggy source:
/** 
 * Checks the highest level this player has achieved
 * @param player
 * @return level number
 */
private int getLevelDone(Player player){
  for (int result=0; result < Settings.challengeLevels.size(); result++) {
    if (checkLevelCompletion(player,Settings.challengeLevels.get(result)) > 0) {
      return result;
    }
  }
  return (Settings.challengeLevels.size() - 1);
}

Fixed version (ground truth):
/** 
 * Checks the highest level this player has achieved
 * @param player
 * @return level number
 */
private int getLevelDone(Player player){
  for (int result=0; result < Settings.challengeLevels.size(); result++) {
    if (checkLevelCompletion(player,Settings.challengeLevels.get(result)) > 0) {
      return result;
    }
  }
  return (Math.max(0,Settings.challengeLevels.size() - 1));
}
Program: 34011
Project: 34011
Buggy source:
/** 
 * Gets the name of the highest challenge level the player has completed
 * @param player
 * @return challenge level
 */
public String getChallengeLevel(Player player){
  if (Settings.challengeLevels.isEmpty()) {
    return "String_Node_Str";
  }
  return Settings.challengeLevels.get(getLevelDone(player) - 1);
}

Fixed version (ground truth):
/** 
 * Gets the name of the highest challenge level the player has completed
 * @param player
 * @return challenge level
 */
public String getChallengeLevel(Player player){
  if (Settings.challengeLevels.isEmpty()) {
    return "String_Node_Str";
  }
  return Settings.challengeLevels.get(getLevelDone(player));
}
Program: 34014
Project: 34014
Buggy source:
/** 
 * Checks the highest level this player has achieved
 * @param player
 * @return level number
 */
private int getLevelDone(Player player){
  for (int result=1; result <= Settings.challengeLevels.size(); result++) {
    if (checkLevelCompletion(player,Settings.challengeLevels.get(result - 1)) > 0) {
      return result;
    }
  }
  return Settings.challengeLevels.size();
}

Fixed version (ground truth):
/** 
 * Checks the highest level this player has achieved
 * @param player
 * @return level number
 */
private int getLevelDone(Player player){
  for (int result=0; result < Settings.challengeLevels.size(); result++) {
    if (checkLevelCompletion(player,Settings.challengeLevels.get(result)) > 0) {
      return result;
    }
  }
  return (Settings.challengeLevels.size() - 1);
}
Program: 34015
Project: 34015
Buggy source:
/** 
 * If the player filled up the bucket themselves
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=false) public void onBucketFill(PlayerBucketFillEvent e){
  if (e.getPlayer().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    if (Settings.acidDamage > 0D) {
      ItemStack item=e.getItemStack();
      if (item.getType().equals(Material.WATER_BUCKET)) {
        ItemMeta meta=item.getItemMeta();
        meta.setDisplayName(plugin.myLocale(e.getPlayer().getUniqueId()).acidBucket);
        meta.setLore(lore);
        item.setItemMeta(meta);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * If the player filled up the bucket themselves
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=false) public void onBucketFill(PlayerBucketFillEvent e){
  if (e.getPlayer().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    if (Settings.acidDamage > 0D) {
      ItemStack item=e.getItemStack();
      if (item.getType().equals(Material.WATER_BUCKET) || item.getType().equals(Material.POTION)) {
        ItemMeta meta=item.getItemMeta();
        meta.setDisplayName(plugin.myLocale(e.getPlayer().getUniqueId()).acidBucket);
        lore=Arrays.asList(plugin.myLocale(e.getPlayer().getUniqueId()).acidLore.split("String_Node_Str"));
        meta.setLore(lore);
        item.setItemMeta(meta);
      }
    }
  }
}
Program: 34019
Project: 34019
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;
    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);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Enables changing of obsidian back into lava
 * @param e
 */
@EventHandler(priority=EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent e){
  if (!e.getPlayer().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {
    return;
  }
  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: 34020
Project: 34020
Buggy source:
/** 
 * @return the grid
 */
public GridManager getGrid(){
  if (grid == null) {
    grid=new GridManager(this);
  }
  return grid;
}

Fixed version (ground truth):
/** 
 * @return the grid
 */
public GridManager getGrid(){
  return grid;
}
Program: 34022
Project: 34022
Buggy source:
/** 
 * @return the challenges
 */
public Challenges getChallenges(){
  if (challenges == null) {
    challenges=new Challenges(this);
  }
  return challenges;
}

Fixed version (ground truth):
/** 
 * @return the challenges
 */
public Challenges getChallenges(){
  return challenges;
}
Program: 34023
Project: 34023
Buggy source:
/** 
 * @return the players
 */
public PlayerCache getPlayers(){
  if (players == null) {
    players=new PlayerCache(this);
  }
  return players;
}

Fixed version (ground truth):
/** 
 * @return the players
 */
public PlayerCache getPlayers(){
  return players;
}