nus-yam/ex-repair huggingface dataset:
Program: 58112
Project: 58112
Buggy source:
public static void adjustWallFilling(final Player requester,final Plot plot,PlotBlock block){
  if (runners.containsKey(plot)) {
    PlayerFunctions.sendMessage(requester,C.WAIT_FOR_TIMER);
    return;
  }
  PlayerFunctions.sendMessage(requester,C.GENERATING_WALL_FILLING);
  World world=requester.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  manager.setWallFilling(world,plotworld,plot.id,block);
  PlayerFunctions.sendMessage(requester,C.SET_BLOCK_ACTION_FINISHED);
  if (canSetFast) {
    SetBlockFast.update(requester);
  }
}

Fixed version (ground truth):
public static void adjustWallFilling(final Player requester,final Plot plot,PlotBlock block){
  if (runners.containsKey(plot)) {
    PlayerFunctions.sendMessage(requester,C.WAIT_FOR_TIMER);
    return;
  }
  World world=requester.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  manager.setWallFilling(world,plotworld,plot.id,block);
  PlayerFunctions.sendMessage(requester,C.SET_BLOCK_ACTION_FINISHED);
  if (canSetFast) {
    SetBlockFast.update(requester);
  }
}
Program: 58113
Project: 58113
Buggy source:
public static void setFloor(final Player requester,final Plot plot,PlotBlock[] blocks){
  if (runners.containsKey(plot)) {
    PlayerFunctions.sendMessage(requester,C.WAIT_FOR_TIMER);
    return;
  }
  PlayerFunctions.sendMessage(requester,C.GENERATING_FLOOR);
  World world=requester.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  PlayerFunctions.sendMessage(requester,C.SET_BLOCK_ACTION_FINISHED);
  manager.setFloor(world,plotworld,plot.id,blocks);
  if (canSetFast) {
    SetBlockFast.update(requester);
  }
}

Fixed version (ground truth):
public static void setFloor(final Player requester,final Plot plot,PlotBlock[] blocks){
  if (runners.containsKey(plot)) {
    PlayerFunctions.sendMessage(requester,C.WAIT_FOR_TIMER);
    return;
  }
  World world=requester.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  PlayerFunctions.sendMessage(requester,C.SET_BLOCK_ACTION_FINISHED);
  manager.setFloor(world,plotworld,plot.id,blocks);
  if (canSetFast) {
    SetBlockFast.update(requester);
  }
}
Program: 58115
Project: 58115
Buggy source:
/** 
 * Check a player for a permission<br> - Op has all permissions <br> - checks for '*' nodes
 * @param player
 * @param perms
 * @return
 */
public static boolean hasPermissions(Player player,String[] perms){
  if (player == null) {
    return true;
  }
  if (player.isOp()) {
    return true;
  }
  for (  String perm : perms) {
    boolean hasperm=false;
    if (player.hasPermission(perm)) {
      hasperm=true;
    }
 else {
      String[] nodes=perm.split("String_Node_Str");
      StringBuilder n=new StringBuilder();
      for (int i=0; i < (nodes.length - 1); i++) {
        n.append(nodes[i] + "String_Node_Str");
        if (player.hasPermission(n + "String_Node_Str")) {
          hasperm=true;
          break;
        }
      }
    }
    if (!hasperm) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check a player for a permission<br> - Op has all permissions <br> - checks for '*' nodes
 * @param player
 * @param perms
 * @return
 */
public static boolean hasPermissions(Player player,String[] perms){
  if (player == null || player.isOp()) {
    return true;
  }
  for (  String perm : perms) {
    boolean hasperm=false;
    if (player.hasPermission(perm)) {
      hasperm=true;
    }
 else {
      String[] nodes=perm.split("String_Node_Str");
      StringBuilder n=new StringBuilder();
      for (int i=0; i < (nodes.length - 1); i++) {
        n.append(nodes[i] + "String_Node_Str");
        if (player.hasPermission(n + "String_Node_Str")) {
          hasperm=true;
          break;
        }
      }
    }
    if (!hasperm) {
      return false;
    }
  }
  return true;
}
Program: 58116
Project: 58116
Buggy source:
/** 
 * Check a range of permissions e.g. 'plots.plot.<0-100>'<br> Returns highest integer in range.
 * @param player
 * @param stub
 * @param range
 * @return
 */
public static int hasPermissionRange(Player player,String stub,int range){
  if (player.isOp()) {
    return range;
  }
  if (player.hasPermission(stub + "String_Node_Str")) {
    return range;
  }
  for (int i=range; i > 0; i--) {
    if (player.hasPermission(stub + "String_Node_Str" + i)) {
      return i;
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Check a range of permissions e.g. 'plots.plot.<0-100>'<br> Returns highest integer in range.
 * @param player
 * @param stub
 * @param range
 * @return
 */
public static int hasPermissionRange(Player player,String stub,int range){
  if (player == null || player.isOp()) {
    return range;
  }
  if (player.hasPermission(stub + "String_Node_Str")) {
    return range;
  }
  for (int i=range; i > 0; i--) {
    if (player.hasPermission(stub + "String_Node_Str" + i)) {
      return i;
    }
  }
  return 0;
}
Program: 58117
Project: 58117
Buggy source:
/** 
 * Check a player for a permission<br> - Op has all permissions <br> - checks for '*' nodes
 * @param player
 * @param perm
 * @return
 */
public static boolean hasPermission(Player player,String perm){
  if (player.isOp()) {
    return true;
  }
  if (player.hasPermission(perm)) {
    return true;
  }
  String[] nodes=perm.split("String_Node_Str");
  StringBuilder n=new StringBuilder();
  for (int i=0; i < (nodes.length - 1); i++) {
    n.append(nodes[i] + "String_Node_Str");
    if (player.hasPermission(n + "String_Node_Str")) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check a player for a permission<br> - Op has all permissions <br> - checks for '*' nodes
 * @param player
 * @param perm
 * @return
 */
public static boolean hasPermission(Player player,String perm){
  if (player == null || player.isOp()) {
    return true;
  }
  if (player.hasPermission(perm)) {
    return true;
  }
  String[] nodes=perm.split("String_Node_Str");
  StringBuilder n=new StringBuilder();
  for (int i=0; i < (nodes.length - 1); i++) {
    n.append(nodes[i] + "String_Node_Str");
    if (player.hasPermission(n + "String_Node_Str")) {
      return true;
    }
  }
  return false;
}
Program: 58119
Project: 58119
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onTeleport(PlayerTeleportEvent event){
  Location f=event.getFrom();
  Location t=event.getTo();
  if (isPlotWorld(event.getTo())) {
    if (isInPlot(event.getTo())) {
      Plot plot=getCurrentPlot(event.getTo());
      if (plot.deny_entry(event.getPlayer())) {
        PlayerFunctions.sendMessage(event.getPlayer(),C.YOU_BE_DENIED);
        event.setCancelled(true);
      }
 else {
        if (enteredPlot(f,t)) {
          plotEntry(event.getPlayer(),plot);
        }
      }
    }
 else {
      if (leftPlot(f,t)) {
        Plot plot=getCurrentPlot(event.getFrom());
        plotExit(event.getPlayer(),plot);
      }
    }
    if ((event.getTo().getBlockX() >= 29999999) || (event.getTo().getBlockX() <= -29999999) || (event.getTo().getBlockZ() >= 29999999)|| (event.getTo().getBlockZ() <= -29999999)) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onTeleport(PlayerTeleportEvent event){
  Location f=event.getFrom();
  Location t=event.getTo();
  Location q=new Location(t.getWorld(),t.getBlockX(),64,t.getZ());
  if (isPlotWorld(q)) {
    if (isInPlot(q)) {
      Plot plot=getCurrentPlot(event.getTo());
      if (plot.deny_entry(event.getPlayer())) {
        PlayerFunctions.sendMessage(event.getPlayer(),C.YOU_BE_DENIED);
        event.setCancelled(true);
      }
 else {
        if (enteredPlot(f,t)) {
          plotEntry(event.getPlayer(),plot);
        }
      }
    }
 else {
      if (leftPlot(f,t)) {
        Plot plot=getCurrentPlot(event.getFrom());
        plotExit(event.getPlayer(),plot);
      }
    }
    if ((event.getTo().getBlockX() >= 29999999) || (event.getTo().getBlockX() <= -29999999) || (event.getTo().getBlockZ() >= 29999999)|| (event.getTo().getBlockZ() <= -29999999)) {
      event.setCancelled(true);
    }
  }
}
Program: 58120
Project: 58120
Buggy source:
@EventHandler public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  PlotWorld pW=getPlotWorld(world);
  CreatureSpawnEvent.SpawnReason reason=event.getSpawnReason();
  if (reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG && pW.SPAWN_EGGS) {
    return;
  }
 else   if (reason == CreatureSpawnEvent.SpawnReason.BREEDING && pW.SPAWN_BREEDING) {
    return;
  }
 else   if (reason == CreatureSpawnEvent.SpawnReason.CUSTOM && pW.SPAWN_CUSTOM) {
    return;
  }
  if (event.getEntity().getType() == EntityType.PLAYER) {
    return;
  }
  if (!isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  PlotWorld pW=getPlotWorld(world);
  CreatureSpawnEvent.SpawnReason reason=event.getSpawnReason();
  if (reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG && pW.SPAWN_EGGS) {
    return;
  }
 else   if (reason == CreatureSpawnEvent.SpawnReason.BREEDING && pW.SPAWN_BREEDING) {
    return;
  }
 else   if (reason == CreatureSpawnEvent.SpawnReason.CUSTOM && pW.SPAWN_CUSTOM) {
    return;
  }
  if (event.getEntity() instanceof Player) {
    return;
  }
  System.out.print(event.getEntityType().getName());
  if (!isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}
Program: 58121
Project: 58121
Buggy source:
@Override public boolean execute(Player plr,String... args){
  if (!PlayerFunctions.isInPlot(plr)) {
    PlayerFunctions.sendMessage(plr,"String_Node_Str");
    return false;
  }
  Plot plot=PlayerFunctions.getCurrentPlot(plr);
  if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !plr.hasPermission("String_Node_Str")) {
    PlayerFunctions.sendMessage(plr,C.NO_PLOT_PERMS);
    return false;
  }
  plot.clear(plr);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(Player plr,String... args){
  if (!PlayerFunctions.isInPlot(plr)) {
    PlayerFunctions.sendMessage(plr,"String_Node_Str");
    return false;
  }
  Plot plot=PlayerFunctions.getCurrentPlot(plr);
  if (!PlayerFunctions.getTopPlot(plr.getWorld(),plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(),plot))) {
    PlayerFunctions.sendMessage(plr,C.UNLINK_REQUIRED);
    return false;
  }
  if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !plr.hasPermission("String_Node_Str")) {
    PlayerFunctions.sendMessage(plr,C.NO_PLOT_PERMS);
    return false;
  }
  plot.clear(plr);
  return true;
}
Program: 58123
Project: 58123
Buggy source:
public String getType(){
  return this.type.getType();
}

Fixed version (ground truth):
public SettingValue getType(){
  return this.type;
}
Program: 58124
Project: 58124
Buggy source:
public static String fromString(String input){
  input=input.replaceAll("String_Node_Str",fromChatColor(ChatColor.BLACK)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_BLUE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_GREEN)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_AQUA)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_RED)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_PURPLE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GOLD)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GRAY)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_GRAY)).replaceAll("String_Node_Str",fromChatColor(ChatColor.BLUE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GREEN)).replaceAll("String_Node_Str",fromChatColor(ChatColor.AQUA)).replaceAll("String_Node_Str",fromChatColor(ChatColor.RED)).replaceAll("String_Node_Str",fromChatColor(ChatColor.LIGHT_PURPLE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.YELLOW)).replaceAll("String_Node_Str",fromChatColor(ChatColor.WHITE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.MAGIC)).replaceAll("String_Node_Str",fromChatColor(ChatColor.BOLD)).replaceAll("String_Node_Str",fromChatColor(ChatColor.STRIKETHROUGH)).replaceAll("String_Node_Str",fromChatColor(ChatColor.UNDERLINE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.ITALIC)).replaceAll("String_Node_Str",fromChatColor(ChatColor.RESET));
  return input + ConsoleColor.RESET.toString();
}

Fixed version (ground truth):
public static String fromString(String input){
  input=input.replaceAll("String_Node_Str",fromChatColor(ChatColor.BLACK)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_BLUE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_GREEN)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_AQUA)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_RED)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_PURPLE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GOLD)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GRAY)).replaceAll("String_Node_Str",fromChatColor(ChatColor.DARK_GRAY)).replaceAll("String_Node_Str",fromChatColor(ChatColor.BLUE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.GREEN)).replaceAll("String_Node_Str",fromChatColor(ChatColor.AQUA)).replaceAll("String_Node_Str",fromChatColor(ChatColor.RED)).replaceAll("String_Node_Str",fromChatColor(ChatColor.LIGHT_PURPLE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.YELLOW)).replaceAll("String_Node_Str",fromChatColor(ChatColor.WHITE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.MAGIC)).replaceAll("String_Node_Str",fromChatColor(ChatColor.BOLD)).replaceAll("String_Node_Str",fromChatColor(ChatColor.STRIKETHROUGH)).replaceAll("String_Node_Str",fromChatColor(ChatColor.UNDERLINE)).replaceAll("String_Node_Str",fromChatColor(ChatColor.ITALIC)).replaceAll("String_Node_Str",fromChatColor(ChatColor.RESET));
  return input + "String_Node_Str";
}
Program: 58125
Project: 58125
Buggy source:
/** 
 * Merges 2 plots Removes the road inbetween <br> - Assumes the first plot parameter is lower <br> - Assumes neither are a Mega-plot <br> - Assumes plots are directly next to each other <br> - Saves to DB
 * @param world
 * @param lesserPlot
 * @param greaterPlot
 */
public static void mergePlot(World world,Plot lesserPlot,Plot greaterPlot){
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  if (lesserPlot.id.x == greaterPlot.id.x) {
    if (!lesserPlot.settings.getMerged(2)) {
      lesserPlot.settings.setMerged(2,true);
      greaterPlot.settings.setMerged(0,true);
      manager.createRoadSouth(plotworld,lesserPlot);
    }
  }
 else {
    if (!lesserPlot.settings.getMerged(1)) {
      lesserPlot.settings.setMerged(1,true);
      greaterPlot.settings.setMerged(3,true);
      manager.createRoadSouth(plotworld,lesserPlot);
    }
  }
}

Fixed version (ground truth):
/** 
 * Merges 2 plots Removes the road inbetween <br> - Assumes the first plot parameter is lower <br> - Assumes neither are a Mega-plot <br> - Assumes plots are directly next to each other <br> - Saves to DB
 * @param world
 * @param lesserPlot
 * @param greaterPlot
 */
public static void mergePlot(World world,Plot lesserPlot,Plot greaterPlot){
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  if (lesserPlot.id.x == greaterPlot.id.x) {
    if (!lesserPlot.settings.getMerged(2)) {
      lesserPlot.settings.setMerged(2,true);
      greaterPlot.settings.setMerged(0,true);
      manager.removeRoadSouth(plotworld,lesserPlot);
    }
  }
 else {
    if (!lesserPlot.settings.getMerged(1)) {
      lesserPlot.settings.setMerged(1,true);
      greaterPlot.settings.setMerged(3,true);
      manager.removeRoadEast(plotworld,lesserPlot);
    }
  }
}
Program: 58127
Project: 58127
Buggy source:
/** 
 * Adds an external world as a recognized PlotSquared world - The PlotWorld class created is based off the configuration in the settings.yml - Do not use this method unless the required world is preconfigured in the settings.yml
 * @param world
 */
public static void loadWorld(World world){
  if (world == null) {
    return;
  }
  Set<String> worlds;
  if (config.contains("String_Node_Str")) {
    worlds=config.getConfigurationSection("String_Node_Str").getKeys(false);
  }
 else {
    worlds=new HashSet<String>();
  }
  ChunkGenerator generator=world.getGenerator();
  if (generator instanceof PlotGenerator) {
    sendConsoleSenderMessage(C.PREFIX.s() + "String_Node_Str" + world.getName()+ "String_Node_Str");
    PlotGenerator plotgen=(PlotGenerator)generator;
    PlotWorld plotworld=plotgen.getPlotWorld();
    PlotManager manager=plotgen.getPlotManager();
    config.createSection("String_Node_Str" + world.getName());
    plotworld.saveConfiguration(config.getConfigurationSection("String_Node_Str" + world.getName()));
    plotworld.loadConfiguration(config.getConfigurationSection("String_Node_Str" + world.getName()));
    addPlotWorld(world.getName(),plotworld,manager);
  }
 else {
    if (worlds.contains(world.getName())) {
      sendConsoleSenderMessage("String_Node_Str" + world.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds an external world as a recognized PlotSquared world - The PlotWorld class created is based off the configuration in the settings.yml - Do not use this method unless the required world is preconfigured in the settings.yml
 * @param world
 */
public static void loadWorld(World world){
  if (world == null) {
    return;
  }
  ChunkGenerator generator=world.getGenerator();
  loadWorld(world.getName(),generator);
}
Program: 58128
Project: 58128
Buggy source:
public void saveConfiguration(ConfigurationSection config){
  config.set("String_Node_Str",this.MOB_SPAWNING);
  config.set("String_Node_Str",this.AUTO_MERGE);
  config.set("String_Node_Str",this.PLOT_BIOME.name());
  config.set("String_Node_Str",this.SCHEMATIC_ON_CLAIM);
  config.set("String_Node_Str",this.SCHEMATIC_FILE);
  config.set("String_Node_Str",this.SCHEMATIC_CLAIM_SPECIFY);
  config.set("String_Node_Str",this.SCHEMATICS);
  config.set("String_Node_Str",this.USE_ECONOMY);
  config.set("String_Node_Str",this.PLOT_PRICE);
  config.set("String_Node_Str",this.MERGE_PRICE);
  config.set("String_Node_Str",this.SELL_PRICE);
  config.set("String_Node_Str",this.PLOT_CHAT);
  config.set("String_Node_Str",this.DEFAULT_FLAGS);
  ConfigurationNode[] settings=getSettingNodes();
  for (  ConfigurationNode setting : settings) {
    config.set(setting.getConstant(),setting.getValue());
  }
}

Fixed version (ground truth):
public void saveConfiguration(ConfigurationSection config){
  HashMap<String,Object> options=new HashMap<String,Object>();
  options.put("String_Node_Str",PlotWorld.MOB_SPAWNING_DEFAULT);
  options.put("String_Node_Str",PlotWorld.AUTO_MERGE_DEFAULT);
  options.put("String_Node_Str",PlotWorld.PLOT_BIOME_DEFAULT.toString());
  options.put("String_Node_Str",PlotWorld.SCHEMATIC_ON_CLAIM_DEFAULT);
  options.put("String_Node_Str",PlotWorld.SCHEMATIC_FILE_DEFAULT);
  options.put("String_Node_Str",PlotWorld.SCHEMATIC_CLAIM_SPECIFY_DEFAULT);
  options.put("String_Node_Str",PlotWorld.SCHEMATICS_DEFAULT);
  options.put("String_Node_Str",PlotWorld.USE_ECONOMY_DEFAULT);
  options.put("String_Node_Str",PlotWorld.PLOT_PRICE_DEFAULT);
  options.put("String_Node_Str",PlotWorld.MERGE_PRICE_DEFAULT);
  options.put("String_Node_Str",PlotWorld.SELL_PRICE_DEFAULT);
  options.put("String_Node_Str",PlotWorld.PLOT_CHAT_DEFAULT);
  options.put("String_Node_Str",PlotWorld.DEFAULT_FLAGS_DEFAULT);
  ConfigurationNode[] settings=getSettingNodes();
  for (  ConfigurationNode setting : settings) {
    options.put(setting.getConstant(),setting.getType().parseObject(setting.getValue()));
  }
  for (  String option : options.keySet()) {
    if (!config.contains(option)) {
      config.set(option,options.get(option));
    }
  }
}
Program: 58129
Project: 58129
Buggy source:
/** 
 * When a world is created, the following method will be called for each node set in the configuration - You may ignore this if you generator does not support configuration, or if you want to implement your own methods
 * @param key
 * @param value
 */
public void loadConfiguration(ConfigurationSection config){
  this.MOB_SPAWNING=config.getBoolean("String_Node_Str");
  this.AUTO_MERGE=config.getBoolean("String_Node_Str");
  this.PLOT_BIOME=(Biome)Configuration.BIOME.parseString(config.getString("String_Node_Str"));
  this.SCHEMATIC_ON_CLAIM=config.getBoolean("String_Node_Str");
  this.SCHEMATIC_FILE=config.getString("String_Node_Str");
  this.SCHEMATIC_CLAIM_SPECIFY=config.getBoolean("String_Node_Str");
  this.SCHEMATICS=config.getStringList("String_Node_Str");
  this.USE_ECONOMY=config.getBoolean("String_Node_Str");
  this.PLOT_PRICE=config.getDouble("String_Node_Str");
  this.MERGE_PRICE=config.getDouble("String_Node_Str");
  this.SELL_PRICE=config.getDouble("String_Node_Str");
  this.PLOT_CHAT=config.getBoolean("String_Node_Str");
  this.DEFAULT_FLAGS=config.getStringList("String_Node_Str");
}

Fixed version (ground truth):
public abstract void loadConfiguration(ConfigurationSection config);
Program: 58130
Project: 58130
Buggy source:
/** 
 * @param uuid
 * @return
 */
public static String getName(UUID uuid){
  if (uuidExists(uuid)) {
    return loopSearch(uuid);
  }
  String name;
  if ((name=getNameOnlinePlayer(uuid)) != null) {
    return name;
  }
  if ((name=getNameOfflinePlayer(uuid)) != null) {
    return name;
  }
  if (Bukkit.getOnlineMode()) {
    try {
      NameFetcher fetcher=new NameFetcher(Arrays.asList(uuid));
      name=fetcher.call().get(uuid);
      add(name,uuid);
      return name;
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @param uuid
 * @return
 */
public static String getName(UUID uuid){
  if (uuidExists(uuid)) {
    return loopSearch(uuid);
  }
  String name;
  if ((name=getNameOnlinePlayer(uuid)) != null) {
    return name;
  }
  if ((name=getNameOfflinePlayer(uuid)) != null) {
    return name;
  }
  if (online) {
    try {
      NameFetcher fetcher=new NameFetcher(Arrays.asList(uuid));
      name=fetcher.call().get(uuid);
      add(name,uuid);
      return name;
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 58131
Project: 58131
Buggy source:
@Override public void run(){
  OfflinePlayer[] offlinePlayers=Bukkit.getOfflinePlayers();
  int lenght=offlinePlayers.length;
  long start=System.currentTimeMillis();
  String name;
  UUID uuid;
  for (  OfflinePlayer player : offlinePlayers) {
    name=player.getName();
    uuid=player.getUniqueId();
    if (!uuidExists(uuid)) {
      add(name,uuid);
    }
  }
  long time=System.currentTimeMillis() - start;
  PlotMain.sendConsoleSenderMessage("String_Node_Str" + time + "String_Node_Str"+ lenght+ "String_Node_Str"+ "String_Node_Str"+ uuidMap.size()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  OfflinePlayer[] offlinePlayers=Bukkit.getOfflinePlayers();
  int length=offlinePlayers.length;
  long start=System.currentTimeMillis();
  String name;
  UUID uuid;
  for (  OfflinePlayer player : offlinePlayers) {
    uuid=player.getUniqueId();
    if (!uuidExists(uuid)) {
      name=player.getName();
      add(name,uuid);
    }
  }
  long time=System.currentTimeMillis() - start;
  PlotMain.sendConsoleSenderMessage("String_Node_Str" + time + "String_Node_Str"+ length+ "String_Node_Str"+ "String_Node_Str"+ uuidMap.size()+ "String_Node_Str");
}
Program: 58132
Project: 58132
Buggy source:
/** 
 * @param plugin
 */
public static void startFetch(JavaPlugin plugin){
  plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
    @Override public void run(){
      OfflinePlayer[] offlinePlayers=Bukkit.getOfflinePlayers();
      int lenght=offlinePlayers.length;
      long start=System.currentTimeMillis();
      String name;
      UUID uuid;
      for (      OfflinePlayer player : offlinePlayers) {
        name=player.getName();
        uuid=player.getUniqueId();
        if (!uuidExists(uuid)) {
          add(name,uuid);
        }
      }
      long time=System.currentTimeMillis() - start;
      PlotMain.sendConsoleSenderMessage("String_Node_Str" + time + "String_Node_Str"+ lenght+ "String_Node_Str"+ "String_Node_Str"+ uuidMap.size()+ "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param plugin
 */
public static void startFetch(JavaPlugin plugin){
  plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
    @Override public void run(){
      OfflinePlayer[] offlinePlayers=Bukkit.getOfflinePlayers();
      int length=offlinePlayers.length;
      long start=System.currentTimeMillis();
      String name;
      UUID uuid;
      for (      OfflinePlayer player : offlinePlayers) {
        uuid=player.getUniqueId();
        if (!uuidExists(uuid)) {
          name=player.getName();
          add(name,uuid);
        }
      }
      long time=System.currentTimeMillis() - start;
      PlotMain.sendConsoleSenderMessage("String_Node_Str" + time + "String_Node_Str"+ length+ "String_Node_Str"+ "String_Node_Str"+ uuidMap.size()+ "String_Node_Str");
    }
  }
);
}
Program: 58133
Project: 58133
Buggy source:
/** 
 * @param uuid
 * @return
 */
private static String loopSearch(UUID uuid){
  for (  Map.Entry<String,UUID> entry : uuidMap.entrySet()) {
    if (entry.getValue().equals(uuid)) {
      return entry.getKey();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @param uuid
 * @return
 */
private static String loopSearch(UUID uuid){
  return uuidMap.inverse().get(uuid);
}
Program: 58134
Project: 58134
Buggy source:
/** 
 * @param name
 * @return
 */
private static UUID getUuidOfflinePlayer(String name){
  OfflinePlayer player=Bukkit.getOfflinePlayer(name);
  if (player == null || !player.hasPlayedBefore()) {
    return null;
  }
  UUID uuid=player.getUniqueId();
  add(name,uuid);
  return uuid;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return
 */
private static UUID getUuidOfflinePlayer(String name){
  UUID uuid=UUID.nameUUIDFromBytes(("String_Node_Str" + name).getBytes(Charsets.UTF_8));
  add(name,uuid);
  return uuid;
}
Program: 58135
Project: 58135
Buggy source:
/** 
 * @param name
 * @return
 */
public static UUID getUUID(String name){
  if (nameExists(name)) {
    return uuidMap.get(name);
  }
  UUID uuid;
  if ((uuid=getUuidOnlinePlayer(name)) != null) {
    return uuid;
  }
  if ((uuid=getUuidOfflinePlayer(name)) != null) {
    return uuid;
  }
  if (Bukkit.getOnlineMode()) {
    try {
      UUIDFetcher fetcher=new UUIDFetcher(Arrays.asList(name));
      uuid=fetcher.call().get(name);
      add(name,uuid);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    return getUuidOfflineMode(name);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return
 */
public static UUID getUUID(String name){
  if (nameExists(name)) {
    return uuidMap.get(name);
  }
  UUID uuid;
  if ((uuid=getUuidOnlinePlayer(name)) != null) {
    return uuid;
  }
  if ((uuid=getUuidOfflinePlayer(name)) != null) {
    return uuid;
  }
  if (online) {
    try {
      UUIDFetcher fetcher=new UUIDFetcher(Arrays.asList(name));
      uuid=fetcher.call().get(name);
      add(name,uuid);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    return getUuidOfflineMode(name);
  }
  return null;
}
Program: 58137
Project: 58137
Buggy source:
public static void removeMask(Player p){
  try {
    LocalSession s;
    if (PlotMain.worldEdit == null) {
      s=WorldEdit.getInstance().getSession(p.getName());
    }
 else {
      s=PlotMain.worldEdit.getSession(p);
    }
    removeMask(p,s);
  }
 catch (  Exception e) {
    throw new PlotSquaredException(PlotSquaredException.PlotError.MISSING_DEPENDENCY,"String_Node_Str");
  }
}

Fixed version (ground truth):
public static void removeMask(Player p){
  try {
    LocalSession s;
    if (PlotMain.worldEdit == null) {
      s=WorldEdit.getInstance().getSession(p.getName());
    }
 else {
      s=PlotMain.worldEdit.getSession(p);
    }
    removeMask(p,s);
  }
 catch (  Exception e) {
  }
}
Program: 58139
Project: 58139
Buggy source:
/** 
 * @param loc
 * @return
 */
public static PlotId getPlotAbs(Location loc){
  int x=loc.getBlockX();
  int z=loc.getBlockZ();
  String world=loc.getWorld().getName();
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  int size=plotworld.PLOT_WIDTH + plotworld.ROAD_WIDTH;
  int pathWidthLower;
  if ((plotworld.ROAD_WIDTH % 2) == 0) {
    pathWidthLower=(int)(Math.floor(plotworld.ROAD_WIDTH / 2) - 1);
  }
 else {
    pathWidthLower=(int)Math.floor(plotworld.ROAD_WIDTH / 2);
  }
  int dx=x / size;
  int dz=z / size;
  if (x < 0) {
    dx--;
    x+=((-dx) * size);
  }
  if (z < 0) {
    dz--;
    z+=((-dz) * size);
  }
  int rx=(x) % size;
  int rz=(z) % size;
  int end=pathWidthLower + plotworld.PLOT_WIDTH;
  boolean northSouth=(rz <= pathWidthLower) || (rz > (pathWidthLower + plotworld.PLOT_WIDTH));
  boolean eastWest=(rx <= pathWidthLower) || (rx > end);
  if (northSouth || eastWest) {
    return null;
  }
  return new PlotId(dx + 1,dz + 1);
}

Fixed version (ground truth):
/** 
 * @param loc
 * @return
 */
public static PlotId getPlotAbs(Location loc){
  int x=loc.getBlockX();
  int z=loc.getBlockZ();
  String world=loc.getWorld().getName();
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  int size=plotworld.PLOT_WIDTH + plotworld.ROAD_WIDTH;
  int pathWidthLower;
  if ((plotworld.ROAD_WIDTH % 2) == 0) {
    pathWidthLower=(int)(Math.floor(plotworld.ROAD_WIDTH / 2) - 1);
  }
 else {
    pathWidthLower=(int)Math.floor(plotworld.ROAD_WIDTH / 2);
  }
  int dx=x / size;
  int dz=z / size;
  if (x < 0) {
    dx--;
    x+=((-dx) * size);
  }
  if (z < 0) {
    dz--;
    z+=((-dz) * size);
  }
  int rx=(x) % size;
  int rz=(z) % size;
  int end=pathWidthLower + plotworld.PLOT_WIDTH;
  boolean northSouth=(rz <= pathWidthLower) || (rz > end);
  boolean eastWest=(rx <= pathWidthLower) || (rx > end);
  if (northSouth || eastWest) {
    return null;
  }
  return new PlotId(dx + 1,dz + 1);
}
Program: 58140
Project: 58140
Buggy source:
public static boolean createPlot(Player player,Plot plot){
  @SuppressWarnings("String_Node_Str") World w=plot.getWorld();
  Plot p=new Plot(plot.id,player.getUniqueId(),plot.settings.getBiome(),new ArrayList<UUID>(),new ArrayList<UUID>(),w.getName());
  PlotMain.updatePlot(p);
  DBFunc.createPlot(p);
  DBFunc.createPlotSettings(DBFunc.getId(w.getName(),p.id),p);
  PlotWorld plotworld=PlotMain.getWorldSettings(w);
  if (plotworld.AUTO_MERGE) {
    autoMerge(w,p,player);
  }
  return true;
}

Fixed version (ground truth):
public static boolean createPlot(Player player,Plot plot){
  World w=plot.getWorld();
  Plot p=new Plot(plot.id,player.getUniqueId(),plot.settings.getBiome(),new ArrayList<UUID>(),new ArrayList<UUID>(),w.getName());
  PlotMain.updatePlot(p);
  DBFunc.createPlot(p);
  DBFunc.createPlotSettings(DBFunc.getId(w.getName(),p.id),p);
  PlotWorld plotworld=PlotMain.getWorldSettings(w);
  if (plotworld.AUTO_MERGE) {
    autoMerge(w,p,player);
  }
  return true;
}
Program: 58142
Project: 58142
Buggy source:
@Override public boolean execute(Player plr,String... args){
  Plot[] plots=PlotMain.getPlots(plr).toArray(new Plot[0]);
  if (plots.length == 1) {
    PlotMain.teleportPlayer(plr,plr.getLocation(),plots[0]);
    return true;
  }
 else   if (plots.length > 1) {
    if (args.length < 1) {
      PlayerFunctions.sendMessage(plr,C.NEED_PLOT_NUMBER);
      return true;
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.getOwner().equals(plr.getUniqueId())) {
            PlotMain.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        PlayerFunctions.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.length)) || (id < 1)) {
      PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    PlotMain.teleportPlayer(plr,plr.getLocation(),plots[id - 1]);
    return true;
  }
 else {
    PlayerFunctions.sendMessage(plr,C.NO_PLOTS);
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean execute(Player plr,String... args){
  Plot[] plots=PlotMain.getPlots(plr).toArray(new Plot[0]);
  if (plots.length == 1) {
    PlotMain.teleportPlayer(plr,plr.getLocation(),plots[0]);
    return true;
  }
 else   if (plots.length > 1) {
    if (args.length < 1) {
      args=new String[]{"String_Node_Str"};
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.getOwner().equals(plr.getUniqueId())) {
            PlotMain.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        PlayerFunctions.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.length)) || (id < 1)) {
      PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    PlotMain.teleportPlayer(plr,plr.getLocation(),plots[id - 1]);
    return true;
  }
 else {
    PlayerFunctions.sendMessage(plr,C.NO_PLOTS);
    return true;
  }
}
Program: 58146
Project: 58146
Buggy source:
public boolean enteredPlot(Location l1,Location l2){
  return !isInPlot(l1) && isInPlot(l2);
}

Fixed version (ground truth):
public boolean enteredPlot(Location l1,Location l2){
  PlotId p1=PlayerFunctions.getPlot(new Location(l1.getWorld(),l1.getBlockX(),64,l1.getBlockZ()));
  PlotId p2=PlayerFunctions.getPlot(new Location(l2.getWorld(),l2.getBlockX(),64,l2.getBlockZ()));
  if (p2 == null)   return false;
  if (p1 == null)   return true;
  if (p1.equals(p2))   return false;
  return true;
}
Program: 58147
Project: 58147
Buggy source:
public boolean leftPlot(Location l1,Location l2){
  return isInPlot(l1) && !isInPlot(l2);
}

Fixed version (ground truth):
public boolean leftPlot(Location l1,Location l2){
  PlotId p1=PlayerFunctions.getPlot(new Location(l1.getWorld(),l1.getBlockX(),64,l1.getBlockZ()));
  PlotId p2=PlayerFunctions.getPlot(new Location(l2.getWorld(),l2.getBlockX(),64,l2.getBlockZ()));
  if (p1 == null)   return false;
  if (p2 == null)   return true;
  if (p1.equals(p2))   return false;
  return true;
}
Program: 58148
Project: 58148
Buggy source:
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onHangingPlace(final HangingPlaceEvent e){
  Block b=e.getBlock();
  if (isPlotWorld(b.getLocation())) {
    Player p=e.getPlayer();
    if (isInPlot(b.getLocation())) {
      if (!p.hasPermission("String_Node_Str")) {
        PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
        e.setCancelled(true);
      }
    }
 else {
      Plot plot=getCurrentPlot(b.getLocation());
      if (plot == null) {
        if (!p.hasPermission("String_Node_Str")) {
          PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
          e.setCancelled(true);
        }
      }
 else       if (!plot.hasRights(p)) {
        if (!p.hasPermission("String_Node_Str")) {
          PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
          e.setCancelled(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onHangingPlace(final HangingPlaceEvent e){
  Block b=e.getBlock();
  if (isPlotWorld(b.getLocation())) {
    Player p=e.getPlayer();
    if (!isInPlot(b.getLocation())) {
      if (!p.hasPermission("String_Node_Str")) {
        PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
        e.setCancelled(true);
      }
    }
 else {
      Plot plot=getCurrentPlot(b.getLocation());
      if (plot == null) {
        if (!p.hasPermission("String_Node_Str")) {
          PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
          e.setCancelled(true);
        }
      }
 else       if (!plot.hasRights(p)) {
        if (!p.hasPermission("String_Node_Str")) {
          PlayerFunctions.sendMessage(p,C.NO_PERMISSION);
          e.setCancelled(true);
        }
      }
    }
  }
}
Program: 58149
Project: 58149
Buggy source:
@EventHandler public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  if ((event.getSpawnReason() != SpawnReason.SPAWNER_EGG) || !isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  if (!isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}
Program: 58150
Project: 58150
Buggy source:
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onPlayerMove(final PlayerMoveEvent e){
  Location t=e.getTo();
  if (!isPlotWorld(t)) {
    return;
  }
  Location f=e.getFrom();
  Player p=e.getPlayer();
  if ((f.getBlockX() != t.getBlockX()) || (f.getBlockZ() != t.getBlockZ())) {
    PlotId idF=PlayerFunctions.getPlot(f);
    PlotId idT=PlayerFunctions.getPlot(t);
    if (PlotMain.hasPermission(e.getPlayer(),"String_Node_Str")) {
      return;
    }
    if ((idT != null) && !(idF == idT)) {
      PWE.setMask(p,t);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerMove(final PlayerMoveEvent e){
  Location t=e.getTo();
  if (!isPlotWorld(t)) {
    return;
  }
  Location f=e.getFrom();
  Player p=e.getPlayer();
  if ((f.getBlockX() != t.getBlockX()) || (f.getBlockZ() != t.getBlockZ())) {
    PlotId idF=PlayerFunctions.getPlot(f);
    PlotId idT=PlayerFunctions.getPlot(t);
    if (PlotMain.hasPermission(e.getPlayer(),"String_Node_Str")) {
      return;
    }
    if ((idT != null) && !(idF == idT)) {
      PWE.setMask(p,t);
    }
  }
}
Program: 58154
Project: 58154
Buggy source:
@Override public List<BlockPopulator> getDefaultPopulators(World world){
  world.setSpawnFlags(false,false);
  return Arrays.asList((BlockPopulator)new XPopulator(PlotMain.getWorldSettings(world)));
}

Fixed version (ground truth):
@Override public List<BlockPopulator> getDefaultPopulators(World world){
  if (!this.plotworld.MOB_SPAWNING) {
    world.setSpawnFlags(false,false);
    world.setAmbientSpawnLimit(0);
    world.setAnimalSpawnLimit(0);
    world.setMonsterSpawnLimit(0);
    world.setWaterAnimalSpawnLimit(0);
  }
  return Arrays.asList((BlockPopulator)new XPopulator(PlotMain.getWorldSettings(world)));
}
Program: 58155
Project: 58155
Buggy source:
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayerExact(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getOfflinePlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}

Fixed version (ground truth):
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayer(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getPlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}
Program: 58157
Project: 58157
Buggy source:
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayerExact(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getOfflinePlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}

Fixed version (ground truth):
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayer(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getOfflinePlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}
Program: 58160
Project: 58160
Buggy source:
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayerExact(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getOfflinePlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}

Fixed version (ground truth):
private boolean hasBeenOnServer(String name){
  Player plr=Bukkit.getPlayer(name);
  if (plr == null) {
    OfflinePlayer oplr=Bukkit.getOfflinePlayer(name);
    if (oplr == null) {
      return false;
    }
 else {
      return oplr.hasPlayedBefore();
    }
  }
 else {
    if (plr.isOnline()) {
      return true;
    }
 else {
      return plr.hasPlayedBefore();
    }
  }
}
Program: 58165
Project: 58165
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onTeleport(PlayerTeleportEvent event){
  if (isPlotWorld(event.getTo())) {
    if (isInPlot(event.getTo())) {
      Plot plot=getCurrentPlot(event.getTo());
      if (plot.deny_entry(event.getPlayer())) {
        PlayerFunctions.sendMessage(event.getPlayer(),C.YOU_BE_DENIED);
        event.setCancelled(true);
      }
    }
    if ((event.getTo().getBlockX() >= 29999999) || (event.getTo().getBlockX() <= -29999999) || (event.getTo().getBlockZ() >= 29999999)|| (event.getTo().getBlockZ() <= -29999999)) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onTeleport(PlayerTeleportEvent event){
  Location f=event.getFrom();
  Location t=event.getTo();
  if (isPlotWorld(event.getTo())) {
    if (isInPlot(event.getTo())) {
      Plot plot=getCurrentPlot(event.getTo());
      if (plot.deny_entry(event.getPlayer())) {
        PlayerFunctions.sendMessage(event.getPlayer(),C.YOU_BE_DENIED);
        event.setCancelled(true);
      }
 else {
        if (enteredPlot(f,t)) {
          plotEntry(event.getPlayer(),plot);
        }
      }
    }
 else {
      if (leftPlot(f,t)) {
        Plot plot=getCurrentPlot(event.getTo());
        plotExit(event.getPlayer(),plot);
      }
    }
    if ((event.getTo().getBlockX() >= 29999999) || (event.getTo().getBlockX() <= -29999999) || (event.getTo().getBlockZ() >= 29999999)|| (event.getTo().getBlockZ() <= -29999999)) {
      event.setCancelled(true);
    }
  }
}
Program: 58166
Project: 58166
Buggy source:
@EventHandler public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  if (!isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler public void MobSpawn(CreatureSpawnEvent event){
  World world=event.getLocation().getWorld();
  if (!isPlotWorld(world)) {
    return;
  }
  if (event.getEntity() instanceof Player) {
    return;
  }
  if (!isInPlot(event.getLocation())) {
    event.setCancelled(true);
  }
}
Program: 58171
Project: 58171
Buggy source:
@Override public void run(){
  for (  String w : getPlotWorlds()) {
    World world=Bukkit.getWorld(w);
    try {
      if (world.getLoadedChunks().length < 1) {
        continue;
      }
      for (      Chunk chunk : world.getLoadedChunks()) {
        for (        Entity entity : chunk.getEntities()) {
          if (entity.getType() == EntityType.PLAYER)           continue;
          location=entity.getLocation();
          if (!PlayerEvents.isInPlot(location))           entity.remove();
        }
      }
    }
 catch (    Exception e) {
      ++error;
    }
 finally {
      ++ticked;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  String w : getPlotWorlds()) {
    World world=Bukkit.getServer().getWorld(w);
    try {
      if (world.getLoadedChunks().length < 1) {
        continue;
      }
      for (      Chunk chunk : world.getLoadedChunks()) {
        Entity[] entities=chunk.getEntities();
        for (int i=entities.length - 1; i >= 0; i--) {
          Entity entity=entities[i];
          if (entity.getType() == EntityType.PLAYER)           continue;
          location=entity.getLocation();
          if (!PlayerEvents.isInPlot(location))           entity.remove();
        }
      }
    }
 catch (    Exception e) {
      ++error;
    }
 finally {
      ++ticked;
    }
  }
}
Program: 58172
Project: 58172
Buggy source:
/** 
 * SETUP: settings.properties
 */
private static void setupConfig(){
  config.set("String_Node_Str",config_ver);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put("String_Node_Str",false);
  options.put("String_Node_Str",Settings.KILL_ROAD_MOBS_DEFAULT);
  options.put("String_Node_Str",Web.ENABLED);
  options.put("String_Node_Str",Web.PORT);
  for (  Entry<String,Object> node : options.entrySet()) {
    if (!config.contains(node.getKey())) {
      config.set(node.getKey(),node.getValue());
    }
  }
  for (  String node : config.getConfigurationSection("String_Node_Str").getKeys(false)) {
    World world=Bukkit.getWorld(node);
    if (world == null) {
      Logger.add(LogLevel.WARNING,"String_Node_Str" + node + "String_Node_Str");
    }
 else {
      ChunkGenerator gen=world.getGenerator();
      if (gen == null || !gen.toString().equals("String_Node_Str")) {
        Logger.add(LogLevel.WARNING,"String_Node_Str" + node + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * SETUP: settings.properties
 */
private static void setupConfig(){
  config.set("String_Node_Str",config_ver);
  Map<String,Object> options=new HashMap<String,Object>();
  options.put("String_Node_Str",false);
  options.put("String_Node_Str",Settings.KILL_ROAD_MOBS_DEFAULT);
  options.put("String_Node_Str",Web.ENABLED);
  options.put("String_Node_Str",Web.PORT);
  for (  Entry<String,Object> node : options.entrySet()) {
    if (!config.contains(node.getKey())) {
      config.set(node.getKey(),node.getValue());
    }
  }
  Web.ENABLED=config.getBoolean("String_Node_Str");
  Web.PORT=config.getInt("String_Node_Str");
  Settings.KILL_ROAD_MOBS=config.getBoolean("String_Node_Str");
  for (  String node : config.getConfigurationSection("String_Node_Str").getKeys(false)) {
    World world=Bukkit.getWorld(node);
    if (world == null) {
      Logger.add(LogLevel.WARNING,"String_Node_Str" + node + "String_Node_Str");
    }
 else {
      ChunkGenerator gen=world.getGenerator();
      if (gen == null || !gen.toString().equals("String_Node_Str")) {
        Logger.add(LogLevel.WARNING,"String_Node_Str" + node + "String_Node_Str");
      }
    }
  }
}