nus-yam/ex-repair huggingface dataset:
Program: 58048
Project: 58048
Buggy source:
@Override public boolean execute(final PlotPlayer plr,String... args){
  final ArrayList<Plot> plots=PlotSquared.sortPlots(PlotSquared.getPlots(plr),plr.getLocation().getWorld());
  if (plots.size() == 1) {
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(0));
    return true;
  }
 else   if (plots.size() > 1) {
    if (args.length < 1) {
      args=new String[]{"String_Node_Str"};
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    final Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
            MainUtil.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        MainUtil.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.size())) || (id < 1)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(id - 1));
    return true;
  }
 else {
    MainUtil.sendMessage(plr,C.FOUND_NO_PLOTS);
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,String... args){
  final ArrayList<Plot> plots=PlotSquared.sortPlots(PlotSquared.getPlots(plr),plr.getLocation().getWorld());
  if (plots.size() == 1) {
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(0));
    return true;
  }
 else   if (plots.size() > 1) {
    if (args.length < 1) {
      args=new String[]{"String_Node_Str"};
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    final Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.isOwner(plr.getUUID())) {
            MainUtil.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        MainUtil.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.size())) || (id < 1)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(id - 1));
    return true;
  }
 else {
    MainUtil.sendMessage(plr,C.FOUND_NO_PLOTS);
    return true;
  }
}
Program: 58051
Project: 58051
Buggy source:
private String getPlayerList(final ArrayList<UUID> l){
  if ((l == null) || (l.size() < 1)) {
    return "String_Node_Str";
  }
  final String c=C.PLOT_USER_LIST.s();
  final StringBuilder list=new StringBuilder();
  for (int x=0; x < l.size(); x++) {
    if ((x + 1) == l.size()) {
      list.append(c.replace("String_Node_Str",getPlayerName(l.get(x))).replace("String_Node_Str","String_Node_Str"));
    }
 else {
      list.append(c.replace("String_Node_Str",getPlayerName(l.get(x))));
    }
  }
  return list.toString();
}

Fixed version (ground truth):
private String getPlayerList(final Collection<UUID> uuids){
  ArrayList<UUID> l=new ArrayList<>(uuids);
  if ((l == null) || (l.size() < 1)) {
    return "String_Node_Str";
  }
  final String c=C.PLOT_USER_LIST.s();
  final StringBuilder list=new StringBuilder();
  for (int x=0; x < l.size(); x++) {
    if ((x + 1) == l.size()) {
      list.append(c.replace("String_Node_Str",getPlayerName(l.get(x))).replace("String_Node_Str","String_Node_Str"));
    }
 else {
      list.append(c.replace("String_Node_Str",getPlayerName(l.get(x))));
    }
  }
  return list.toString();
}
Program: 58053
Project: 58053
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return false;
  }
  if (args.length != 1) {
    MainUtil.sendMessage(plr,"String_Node_Str");
    return false;
  }
  final PlotPlayer player=UUIDHandler.getPlayer(args[0]);
  if (player == null) {
    MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
    return false;
  }
  if (!player.getLocation().getWorld().equals(loc.getWorld()) || !plot.equals(MainUtil.getPlot(loc))) {
    MainUtil.sendMessage(plr,C.INVALID_PLAYER.s().replaceAll("String_Node_Str",args[0]));
    return false;
  }
  player.teleport(BlockManager.manager.getSpawn(loc.getWorld()));
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return false;
  }
  if (args.length != 1) {
    MainUtil.sendMessage(plr,"String_Node_Str");
    return false;
  }
  final PlotPlayer player=UUIDHandler.getPlayer(args[0]);
  if (player == null) {
    MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
    return false;
  }
  if (!player.getLocation().getWorld().equals(loc.getWorld()) || !plot.equals(MainUtil.getPlot(loc))) {
    MainUtil.sendMessage(plr,C.INVALID_PLAYER.s().replaceAll("String_Node_Str",args[0]));
    return false;
  }
  player.teleport(BlockManager.manager.getSpawn(loc.getWorld()));
  return true;
}
Program: 58054
Project: 58054
Buggy source:
@Override public void run(){
  PlotPlayer accepter=UUIDHandler.getPlayer(uuid);
  multiUUID.remove(uuid);
  if (multiUUID.size() == 0) {
    PlotPlayer pp=UUIDHandler.getPlayer(u1);
    if (pp == null) {
      sendMessage(plr,C.MERGE_NOT_VALID);
      return;
    }
    final PlotWorld plotWorld=PlotSquared.getPlotWorld(world);
    if ((PlotSquared.economy != null) && plotWorld.USE_ECONOMY) {
      double cost=plotWorld.MERGE_PRICE;
      cost=plots.size() * cost;
      if (cost > 0d) {
        if (EconHandler.getBalance(plr) < cost) {
          sendMessage(plr,C.CANNOT_AFFORD_MERGE,cost + "String_Node_Str");
          return;
        }
        EconHandler.withdrawPlayer(plr,cost);
        sendMessage(plr,C.REMOVED_BALANCE,cost + "String_Node_Str");
      }
    }
    final boolean result=EventUtil.manager.callMerge(world,plot,plots);
    if (!result) {
      MainUtil.sendMessage(plr,"String_Node_Str");
      return;
    }
    MainUtil.sendMessage(plr,C.SUCCESS_MERGE);
    MainUtil.mergePlots(world,plots,true);
    MainUtil.setSign(UUIDHandler.getName(plot.owner),plot);
    MainUtil.update(loc);
  }
  MainUtil.sendMessage(accepter,C.MERGE_ACCEPTED);
}

Fixed version (ground truth):
@Override public void run(){
  PlotPlayer accepter=UUIDHandler.getPlayer(uuid);
  multiUUID.remove(uuid);
  if (multiUUID.size() == 0) {
    PlotPlayer pp=UUIDHandler.getPlayer(u1);
    if (pp == null) {
      sendMessage(plr,C.MERGE_NOT_VALID);
      return;
    }
    final PlotWorld plotWorld=PlotSquared.getPlotWorld(world);
    if ((PlotSquared.economy != null) && plotWorld.USE_ECONOMY) {
      double cost=plotWorld.MERGE_PRICE;
      cost=plots.size() * cost;
      if (cost > 0d) {
        if (EconHandler.getBalance(plr) < cost) {
          sendMessage(plr,C.CANNOT_AFFORD_MERGE,cost + "String_Node_Str");
          return;
        }
        EconHandler.withdrawPlayer(plr,cost);
        sendMessage(plr,C.REMOVED_BALANCE,cost + "String_Node_Str");
      }
    }
    final boolean result=EventUtil.manager.callMerge(world,plot,plots);
    if (!result) {
      MainUtil.sendMessage(plr,"String_Node_Str");
      return;
    }
    MainUtil.sendMessage(plr,C.SUCCESS_MERGE);
    MainUtil.mergePlots(world,plots,true);
    MainUtil.setSign(UUIDHandler.getName(plot.owner_),plot);
    MainUtil.update(loc);
  }
  MainUtil.sendMessage(accepter,C.MERGE_ACCEPTED);
}
Program: 58057
Project: 58057
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  if (args.length < 1) {
    sendMessage(plr,C.RATING_NOT_VALID);
    return true;
  }
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    sendMessage(plr,C.RATING_NOT_OWNED);
    return true;
  }
  if (plot.getOwner().equals(UUIDHandler.getUUID(plr))) {
    sendMessage(plr,C.RATING_NOT_YOUR_OWN);
    return true;
  }
  final String arg=args[0];
  boolean o=false;
  for (  final char c : arg.toCharArray()) {
    if (!Character.isDigit(c)) {
      o=true;
      break;
    }
  }
  int rating=0;
  if (!o) {
    rating=Integer.parseInt(arg);
  }
  if (o || ((rating < 0) || (rating > 10))) {
    sendMessage(plr,C.RATING_NOT_VALID);
    return true;
  }
  boolean rated=true;
  try {
    DBFunc.getRatings(plot);
  }
 catch (  final Exception e) {
    rated=false;
  }
  if (rated) {
    sendMessage(plr,C.RATING_ALREADY_EXISTS,plot.getId().toString());
  }
  final boolean success=true;
  if (success) {
    sendMessage(plr,C.RATING_APPLIED,plot.getId().toString());
  }
 else {
    sendMessage(plr,C.COMMAND_WENT_WRONG);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  if (args.length < 1) {
    sendMessage(plr,C.RATING_NOT_VALID);
    return true;
  }
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    sendMessage(plr,C.RATING_NOT_OWNED);
    return true;
  }
  if (plot.isOwner(plr.getUUID())) {
    sendMessage(plr,C.RATING_NOT_YOUR_OWN);
    return true;
  }
  final String arg=args[0];
  boolean o=false;
  for (  final char c : arg.toCharArray()) {
    if (!Character.isDigit(c)) {
      o=true;
      break;
    }
  }
  int rating=0;
  if (!o) {
    rating=Integer.parseInt(arg);
  }
  if (o || ((rating < 0) || (rating > 10))) {
    sendMessage(plr,C.RATING_NOT_VALID);
    return true;
  }
  boolean rated=true;
  try {
    DBFunc.getRatings(plot);
  }
 catch (  final Exception e) {
    rated=false;
  }
  if (rated) {
    sendMessage(plr,C.RATING_ALREADY_EXISTS,plot.getId().toString());
  }
  final boolean success=true;
  if (success) {
    sendMessage(plr,C.RATING_APPLIED,plot.getId().toString());
  }
 else {
    sendMessage(plr,C.COMMAND_WENT_WRONG);
  }
  return true;
}
Program: 58059
Project: 58059
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if ((plot == null) || (plot.owner == null)) {
    MainUtil.sendMessage(plr,C.NOT_IN_PLOT);
    return false;
  }
  if (args.length < 1) {
    MainUtil.sendMessage(plr,C.NEED_USER);
    return false;
  }
  if (!plot.owner.equals(UUIDHandler.getUUID(plr)) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  final String world=loc.getWorld();
  final PlotId bot=MainUtil.getBottomPlot(plot).id;
  final PlotId top=MainUtil.getTopPlot(plot).id;
  final ArrayList<PlotId> plots=MainUtil.getPlotSelectionIds(bot,top);
  for (  final PlotId id : plots) {
    final Plot current=PlotSquared.getPlots(world).get(id);
    final UUID uuid=getUUID(args[0]);
    if (uuid == null) {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
      return false;
    }
    current.owner=uuid;
    PlotSquared.updatePlot(current);
    DBFunc.setOwner(current,current.owner);
  }
  MainUtil.setSign(args[0],plot);
  MainUtil.sendMessage(plr,C.SET_OWNER);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if ((plot == null) || (plot.owner_ == null)) {
    MainUtil.sendMessage(plr,C.NOT_IN_PLOT);
    return false;
  }
  if (args.length < 1) {
    MainUtil.sendMessage(plr,C.NEED_USER);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  final String world=loc.getWorld();
  final PlotId bot=MainUtil.getBottomPlot(plot).id;
  final PlotId top=MainUtil.getTopPlot(plot).id;
  final ArrayList<PlotId> plots=MainUtil.getPlotSelectionIds(bot,top);
  for (  final PlotId id : plots) {
    final Plot current=PlotSquared.getPlots(world).get(id);
    final UUID uuid=getUUID(args[0]);
    if (uuid == null) {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
      return false;
    }
    current.owner_=uuid;
    PlotSquared.updatePlot(current);
    DBFunc.setOwner(current,current.owner_);
  }
  MainUtil.setSign(args[0],plot);
  MainUtil.sendMessage(plr,C.SET_OWNER);
  return true;
}
Program: 58061
Project: 58061
Buggy source:
/** 
 * Register an AbstractFlag with PlotSquared
 * @param flag Flag to register
 * @return success?
 */
public static boolean addFlag(final AbstractFlag af){
  PlotSquared.log(C.PREFIX.s() + "String_Node_Str" + af);
  af.getKey();
  if (PlotSquared.getAllPlotsRaw() != null) {
    for (    final Plot plot : PlotSquared.getPlots()) {
      for (      final Flag flag : plot.settings.flags) {
        if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
          flag.setKey(af);
        }
      }
    }
  }
  return (getFlag(af.getKey()) == null) && flags.add(af);
}

Fixed version (ground truth):
/** 
 * Register an AbstractFlag with PlotSquared
 * @param flag Flag to register
 * @return success?
 */
public static boolean addFlag(final AbstractFlag af){
  PlotSquared.log(C.PREFIX.s() + "String_Node_Str" + af);
  for (  PlotWorld plotworld : PlotSquared.getPlotWorldObjects()) {
    for (    final Flag flag : plotworld.DEFAULT_FLAGS) {
      if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
        flag.setKey(af);
      }
    }
  }
  if (PlotSquared.getAllPlotsRaw() != null) {
    for (    final Plot plot : PlotSquared.getPlots()) {
      for (      final Flag flag : plot.settings.flags) {
        if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
          flag.setKey(af);
        }
      }
    }
  }
  return (getFlag(af.getKey()) == null) && flags.add(af);
}
Program: 58062
Project: 58062
Buggy source:
public static ArrayList<Plot> sortPlots(Collection<Plot> plots,final String priorityWorld){
  ArrayList<Plot> newPlots=new ArrayList<>();
  HashMap<PlotId,Plot> worldPlots=PlotSquared.plots.get(priorityWorld);
  if (worldPlots != null) {
    newPlots.addAll(sortPlots(worldPlots.values()));
  }
  for (  Entry<String,HashMap<PlotId,Plot>> entry : PlotSquared.plots.entrySet()) {
    if (!entry.getKey().equals(priorityWorld)) {
      entry.getValue().values();
    }
  }
  return newPlots;
}

Fixed version (ground truth):
public static ArrayList<Plot> sortPlots(Collection<Plot> plots,final String priorityWorld){
  ArrayList<Plot> newPlots=new ArrayList<>();
  HashMap<PlotId,Plot> worldPlots=PlotSquared.plots.get(priorityWorld);
  if (worldPlots != null) {
    for (    Plot plot : sortPlots(worldPlots.values())) {
      if (plots.contains(plot)) {
        newPlots.add(plot);
      }
    }
  }
  for (  Entry<String,HashMap<PlotId,Plot>> entry : PlotSquared.plots.entrySet()) {
    if (!entry.getKey().equals(priorityWorld)) {
      for (      Plot plot : entry.getValue().values()) {
        if (plots.contains(plot)) {
          newPlots.add(plot);
        }
      }
    }
  }
  return newPlots;
}
Program: 58064
Project: 58064
Buggy source:
@Override public boolean execute(final PlotPlayer player,final String... args){
  final Location loc=player.getLocation();
  final String world=loc.getWorld();
  if (!(PlotSquared.getPlotWorld(world) instanceof HybridPlotWorld)) {
    return sendMessage(player,C.NOT_IN_PLOT_WORLD);
  }
  final ChunkLoc chunk=new ChunkLoc(loc.getX() >> 4,loc.getZ() >> 4);
  final boolean result=HybridUtils.manager.regenerateRoad(world,chunk);
  if (result) {
    MainUtil.update(loc);
  }
  MainUtil.sendMessage(player,"String_Node_Str" + chunk.x + "String_Node_Str"+ chunk.z+ "String_Node_Str"+ (result == true ? "String_Node_Str" : "String_Node_Str"));
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer player,final String... args){
  final Location loc=player.getLocation();
  final String world=loc.getWorld();
  if (!(PlotSquared.getPlotWorld(world) instanceof HybridPlotWorld)) {
    return sendMessage(player,C.NOT_IN_PLOT_WORLD);
  }
  final ChunkLoc chunk=new ChunkLoc(loc.getX() >> 4,loc.getZ() >> 4);
  final boolean result=HybridUtils.manager.regenerateRoad(world,chunk);
  if (result) {
    MainUtil.update(loc);
  }
  MainUtil.sendMessage(player,"String_Node_Str" + chunk.x + "String_Node_Str"+ chunk.z+ "String_Node_Str"+ (result == true ? "String_Node_Str" : "String_Node_Str"));
  MainUtil.update(loc);
  return true;
}
Program: 58065
Project: 58065
Buggy source:
@Override public boolean execute(final PlotPlayer plr,String... args){
  final ArrayList<Plot> plots=PlotSquared.sortPlots(PlotSquared.getPlots(plr),plr.getLocation().getWorld());
  if (plots.size() == 1) {
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(0));
    return true;
  }
 else   if (plots.size() > 1) {
    if (args.length < 1) {
      args=new String[]{"String_Node_Str"};
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    final Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
            MainUtil.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        MainUtil.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.size())) || (id < 1)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(id - 1));
    return true;
  }
 else {
    MainUtil.sendMessage(plr,C.NO_PLOTS);
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,String... args){
  final ArrayList<Plot> plots=PlotSquared.sortPlots(PlotSquared.getPlots(plr),plr.getLocation().getWorld());
  if (plots.size() == 1) {
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(0));
    return true;
  }
 else   if (plots.size() > 1) {
    if (args.length < 1) {
      args=new String[]{"String_Node_Str"};
    }
    int id=0;
    try {
      id=Integer.parseInt(args[0]);
    }
 catch (    final Exception e) {
      Plot temp;
      if ((temp=isAlias(args[0])) != null) {
        if (temp.hasOwner()) {
          if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
            MainUtil.teleportPlayer(plr,plr.getLocation(),temp);
            return true;
          }
        }
        MainUtil.sendMessage(plr,C.NOT_YOUR_PLOT);
        return false;
      }
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return true;
    }
    if ((id > (plots.size())) || (id < 1)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_NUMBER);
      return false;
    }
    MainUtil.teleportPlayer(plr,plr.getLocation(),plots.get(id - 1));
    return true;
  }
 else {
    MainUtil.sendMessage(plr,C.FOUND_NO_PLOTS);
    return true;
  }
}
Program: 58067
Project: 58067
Buggy source:
@Override final public ChunkGenerator getDefaultWorldGenerator(final String world,final String id){
  PlotSquared.GEN_WORLD=world;
  if (!PlotSquared.setupPlotWorld(world,id)) {
    return null;
  }
  return new HybridGen();
}

Fixed version (ground truth):
@Override final public ChunkGenerator getDefaultWorldGenerator(final String world,final String id){
  if (!PlotSquared.setupPlotWorld(world,id)) {
    return null;
  }
  return new HybridGen();
}
Program: 58068
Project: 58068
Buggy source:
@Override public List<BlockPopulator> getDefaultPopulators(World world){
  PlotSquared.loadWorld(PlotSquared.GEN_WORLD,this);
  PlotWorld plotworld=PlotSquared.getPlotWorld(PlotSquared.GEN_WORLD);
  if (!plotworld.MOB_SPAWNING) {
    if (!plotworld.SPAWN_EGGS) {
      world.setSpawnFlags(false,false);
    }
    world.setAmbientSpawnLimit(0);
    world.setAnimalSpawnLimit(0);
    world.setMonsterSpawnLimit(0);
    world.setWaterAnimalSpawnLimit(0);
  }
 else {
    world.setSpawnFlags(true,true);
    world.setAmbientSpawnLimit(-1);
    world.setAnimalSpawnLimit(-1);
    world.setMonsterSpawnLimit(-1);
    world.setWaterAnimalSpawnLimit(-1);
  }
  return getPopulators(PlotSquared.GEN_WORLD);
}

Fixed version (ground truth):
@Override public List<BlockPopulator> getDefaultPopulators(World world){
  PlotSquared.loadWorld(world.getName(),this);
  PlotWorld plotworld=PlotSquared.getPlotWorld(world.getName());
  if (!plotworld.MOB_SPAWNING) {
    if (!plotworld.SPAWN_EGGS) {
      world.setSpawnFlags(false,false);
    }
    world.setAmbientSpawnLimit(0);
    world.setAnimalSpawnLimit(0);
    world.setMonsterSpawnLimit(0);
    world.setWaterAnimalSpawnLimit(0);
  }
 else {
    world.setSpawnFlags(true,true);
    world.setAmbientSpawnLimit(-1);
    world.setAnimalSpawnLimit(-1);
    world.setMonsterSpawnLimit(-1);
    world.setWaterAnimalSpawnLimit(-1);
  }
  return getPopulators(world.getName());
}
Program: 58071
Project: 58071
Buggy source:
public static void update(final Location loc){
  final String world=loc.getWorld();
  final ArrayList<ChunkLoc> chunks=new ArrayList<>();
  final int distance=BukkitUtil.getViewDistance();
  for (int cx=-distance; cx < distance; cx++) {
    for (int cz=-distance; cz < distance; cz++) {
      final ChunkLoc chunk=new ChunkLoc(cx,cz);
      chunks.add(chunk);
    }
  }
  BlockUpdateUtil.setBlockManager.update(world,chunks);
}

Fixed version (ground truth):
public static void update(final Location loc){
  final String world=loc.getWorld();
  int ox=loc.getX() >> 4;
  int oz=loc.getX() >> 4;
  final ArrayList<ChunkLoc> chunks=new ArrayList<>();
  final int distance=BukkitUtil.getViewDistance();
  for (int cx=-distance; cx <= distance; cx++) {
    for (int cz=-distance; cz <= distance; cz++) {
      final ChunkLoc chunk=new ChunkLoc(ox + cx,oz + cz);
      chunks.add(chunk);
    }
  }
  BlockUpdateUtil.setBlockManager.update(world,chunks);
}
Program: 58079
Project: 58079
Buggy source:
@EventHandler public static void worldLoad(WorldLoadEvent event){
  if (!UUIDHandler.CACHED) {
    UUIDHandler.cacheAll();
  }
}

Fixed version (ground truth):
@EventHandler public static void worldLoad(WorldLoadEvent event){
  if (!UUIDHandler.CACHED) {
    UUIDHandler.cacheAll();
    if (Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str") != null) {
      try {
        new PlotMeConverter(PlotMain.getMain()).runAsync();
      }
 catch (      final Exception e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 58083
Project: 58083
Buggy source:
@Override public Connection openConnection() throws SQLException, ClassNotFoundException {
  if (checkConnection()) {
    return this.connection;
  }
  if (!this.plugin.getDataFolder().exists()) {
    this.plugin.getDataFolder().mkdirs();
  }
  final File file=new File(this.plugin.getDataFolder(),this.dbLocation);
  if (!(file.exists())) {
    try {
      file.createNewFile();
    }
 catch (    final IOException e) {
      this.plugin.getLogger().log(Level.SEVERE,"String_Node_Str");
    }
  }
  Class.forName("String_Node_Str");
  this.connection=DriverManager.getConnection("String_Node_Str" + this.plugin.getDataFolder().toPath().toString() + "String_Node_Str"+ this.dbLocation);
  return this.connection;
}

Fixed version (ground truth):
@Override public Connection openConnection() throws SQLException, ClassNotFoundException {
  if (checkConnection()) {
    return this.connection;
  }
  if (!this.plugin.getDataFolder().exists()) {
    this.plugin.getDataFolder().mkdirs();
  }
  final File file=new File(this.dbLocation);
  if (!(file.exists())) {
    try {
      file.createNewFile();
    }
 catch (    final IOException e) {
      this.plugin.getLogger().log(Level.SEVERE,"String_Node_Str");
    }
  }
  Class.forName("String_Node_Str");
  this.connection=DriverManager.getConnection("String_Node_Str" + this.dbLocation);
  return this.connection;
}
Program: 58086
Project: 58086
Buggy source:
public static UUID getUUID(final String name){
  if (name == null) {
    return null;
  }
  Player player=Bukkit.getPlayer(name);
  if (player != null) {
    UUID uuid=UUIDHandler.uuidWrapper.getUUID(player);
    add(new StringWrapper(name),uuid);
    return uuid;
  }
  UUID uuid=UUIDHandler.uuidMap.get(name);
  if (uuid != null) {
    return uuid;
  }
  if (Settings.UUID_FROM_DISK) {
    OfflinePlayer op=Bukkit.getOfflinePlayer(name);
    return UUIDHandler.uuidWrapper.getUUID(op);
  }
  return null;
}

Fixed version (ground truth):
public static UUID getUUID(final String name){
  if (name == null) {
    return null;
  }
  Player player=Bukkit.getPlayer(name);
  if (player != null) {
    UUID uuid=UUIDHandler.uuidWrapper.getUUID(player);
    add(new StringWrapper(name),uuid);
    return uuid;
  }
  StringWrapper wrap=new StringWrapper(name);
  UUID uuid=UUIDHandler.uuidMap.get(wrap);
  if (uuid != null) {
    return uuid;
  }
  if (Settings.UUID_FROM_DISK) {
    OfflinePlayer op=Bukkit.getOfflinePlayer(name);
    uuid=UUIDHandler.uuidWrapper.getUUID(op);
    add(new StringWrapper(name),uuid);
    return uuid;
  }
  return null;
}
Program: 58088
Project: 58088
Buggy source:
@Override public void run(){
  for (  final String world : getPlotWorldsString()) {
    if (plots.containsKey(world)) {
      final ArrayList<Plot> toDeletePlot=new ArrayList<>();
      for (      final Plot plot : plots.get(world).values()) {
        if (plot.owner == null) {
          continue;
        }
        final long lastPlayed=getLastPlayed(plot.owner);
        if (lastPlayed == 0) {
          continue;
        }
        final long compared=System.currentTimeMillis() - lastPlayed;
        if (TimeUnit.MILLISECONDS.toDays(compared) >= Settings.AUTO_CLEAR_DAYS) {
          final PlotDeleteEvent event=new PlotDeleteEvent(world,plot.id);
          Bukkit.getServer().getPluginManager().callEvent(event);
          if (event.isCancelled()) {
            event.setCancelled(true);
          }
 else {
            toDeletePlot.add(plot);
          }
        }
      }
      for (      final Plot plot : toDeletePlot) {
        final World worldobj=Bukkit.getWorld(world);
        PlotHelper.clear(worldobj,plot,true);
        PlotHelper.removeSign(worldobj,plot);
        DBFunc.delete(world,plot);
        removePlot(world,plot.id,true);
        if ((Math.abs(plot.id.x) < Math.abs(Auto.lastPlot.x)) && (Math.abs(plot.id.y) < Math.abs(Auto.lastPlot.y))) {
          Auto.lastPlot=plot.id;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final World worldobj=Bukkit.getWorld(world);
  PlotHelper.clear(worldobj,plot,true);
  PlotHelper.removeSign(worldobj,plot);
  DBFunc.delete(world,plot);
  removePlot(world,plot.id,true);
  if ((Math.abs(plot.id.x) < Math.abs(Auto.lastPlot.x)) && (Math.abs(plot.id.y) < Math.abs(Auto.lastPlot.y))) {
    Auto.lastPlot=plot.id;
  }
}
Program: 58090
Project: 58090
Buggy source:
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onTeleport(final PlayerTeleportEvent e){
  if (PlotMain.hasPermission(e.getPlayer(),"String_Node_Str")) {
    return;
  }
  final Player p=e.getPlayer();
  final Location t=e.getTo();
  final Location q=new Location(t.getWorld(),t.getBlockX(),64,t.getZ());
  final Location f=e.getFrom();
  if (!isPlotWorld(q)) {
    if (isPlotWorld(f)) {
      PWE.removeMask(p);
    }
 else {
      return;
    }
  }
  PWE.setMask(p,q);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onTeleport(final PlayerTeleportEvent e){
  if (PlotMain.hasPermission(e.getPlayer(),"String_Node_Str")) {
    return;
  }
  final Player p=e.getPlayer();
  final Location t=e.getTo();
  final Location q=new Location(t.getWorld(),t.getBlockX(),64,t.getZ());
  final Location f=e.getFrom();
  if (!isPlotWorld(q)) {
    if (isPlotWorld(f)) {
      PWE.removeMask(p);
      return;
    }
 else {
      return;
    }
  }
  PWE.setMask(p,q);
}
Program: 58092
Project: 58092
Buggy source:
public static List<String> helpMenu(final Player player,final SubCommand.CommandCategory category,int page){
  final List<SubCommand> commands=getCommands(category,player);
  final int perPage=5;
  final int totalPages=(int)Math.ceil(commands.size() / perPage);
  if (page > totalPages) {
    page=totalPages;
  }
  int max=(page * perPage) + perPage;
  if (max > commands.size()) {
    max=commands.size();
  }
  final List<String> help=new ArrayList<>();
  help.add(C.HELP_HEADER.s());
  help.add(C.HELP_CATEGORY.s().replace("String_Node_Str",category.toString()).replace("String_Node_Str","String_Node_Str" + (page + 1)).replace("String_Node_Str","String_Node_Str" + (totalPages + 1)).replace("String_Node_Str","String_Node_Str" + (commands.size() % perPage)).replace("String_Node_Str","String_Node_Str" + commands.size()));
  SubCommand cmd;
  final int start=page * perPage;
  for (int x=start; x < max; x++) {
    cmd=commands.get(x);
    String s=t(C.HELP_ITEM.s());
    s=s.replace("String_Node_Str",cmd.alias).replace("String_Node_Str",cmd.usage.contains("String_Node_Str") ? cmd.usage : "String_Node_Str" + cmd.usage).replace("String_Node_Str",cmd.cmd).replace("String_Node_Str",cmd.description);
    help.add(s);
  }
  if (help.size() < 2) {
    help.add(t(C.NO_COMMANDS.s()));
  }
  return help;
}

Fixed version (ground truth):
public static List<String> helpMenu(final Player player,final SubCommand.CommandCategory category,int page){
  final List<SubCommand> commands=getCommands(category,player);
  final int perPage=5;
  final int totalPages=(int)Math.ceil(commands.size() / perPage);
  if (page > totalPages) {
    page=totalPages;
  }
  int max=(page * perPage) + perPage;
  if (max > commands.size()) {
    max=commands.size();
  }
  final List<String> help=new ArrayList<>();
  help.add(C.HELP_HEADER.s());
  help.add(C.HELP_CATEGORY.s().replace("String_Node_Str",category.toString()).replace("String_Node_Str","String_Node_Str" + (page + 1)).replace("String_Node_Str","String_Node_Str" + (totalPages + 1)).replace("String_Node_Str","String_Node_Str" + (commands.size() % perPage)).replace("String_Node_Str","String_Node_Str" + commands.size()));
  SubCommand cmd;
  final int start=page * perPage;
  for (int x=start; x < max; x++) {
    cmd=commands.get(x);
    String s=t(C.HELP_ITEM.s());
    s=s.replace("String_Node_Str",cmd.alias.get(0)).replace("String_Node_Str",cmd.usage.contains("String_Node_Str") ? cmd.usage : "String_Node_Str" + cmd.usage).replace("String_Node_Str",cmd.cmd).replace("String_Node_Str",cmd.description);
    help.add(s);
  }
  if (help.size() < 2) {
    help.add(t(C.NO_COMMANDS.s()));
  }
  return help;
}
Program: 58093
Project: 58093
Buggy source:
@Override public List<String> onTabComplete(final CommandSender commandSender,final Command command,final String s,final String[] strings){
  if (!(commandSender instanceof Player)) {
    return null;
  }
  final Player player=(Player)commandSender;
  if (strings.length < 1) {
    if ((strings.length == 0) || "String_Node_Str".startsWith(s)) {
      return Arrays.asList("String_Node_Str");
    }
  }
  if (strings.length > 1) {
    return null;
  }
  if (!command.getLabel().equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final List<String> tabOptions=new ArrayList<>();
  final String arg=strings[0].toLowerCase();
  for (  final SubCommand cmd : subCommands) {
    if (cmd.permission.hasPermission(player)) {
      if (cmd.cmd.startsWith(arg)) {
        tabOptions.add(cmd.cmd);
      }
 else       if (cmd.alias.startsWith(arg)) {
        tabOptions.add(cmd.alias);
      }
    }
  }
  if (tabOptions.size() > 0) {
    return tabOptions;
  }
  return null;
}

Fixed version (ground truth):
@Override public List<String> onTabComplete(final CommandSender commandSender,final Command command,final String s,final String[] strings){
  if (!(commandSender instanceof Player)) {
    return null;
  }
  final Player player=(Player)commandSender;
  if (strings.length < 1) {
    if ((strings.length == 0) || "String_Node_Str".startsWith(s)) {
      return Arrays.asList("String_Node_Str");
    }
  }
  if (strings.length > 1) {
    return null;
  }
  if (!command.getLabel().equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final List<String> tabOptions=new ArrayList<>();
  final String arg=strings[0].toLowerCase();
  for (  final SubCommand cmd : subCommands) {
    if (cmd.permission.hasPermission(player)) {
      if (cmd.cmd.startsWith(arg)) {
        tabOptions.add(cmd.cmd);
      }
 else       if (cmd.alias.get(0).startsWith(arg)) {
        tabOptions.add(cmd.alias.get(0));
      }
    }
  }
  if (tabOptions.size() > 0) {
    return tabOptions;
  }
  return null;
}
Program: 58097
Project: 58097
Buggy source:
@Override public List<String> onTabComplete(CommandSender commandSender,Command command,String s,String[] strings){
  if (!(commandSender instanceof Player))   return null;
  Player player=(Player)commandSender;
  ArrayList<SubCommand> subo=subCommands;
  while (true) {
    String sub=new StringComparsion(strings[0],subo.toArray()).getBestMatch();
    if (subo.isEmpty())     break;
    for (    SubCommand subCommand : subo) {
      if (subCommand.cmd.equals(sub)) {
        if (subCommand.permission.hasPermission(player))         return Arrays.asList(sub);
 else {
          subo.remove(subCommand);
          break;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public List<String> onTabComplete(CommandSender commandSender,Command command,String s,String[] strings){
  if (!(commandSender instanceof Player))   return null;
  Player player=(Player)commandSender;
  ArrayList<SubCommand> subo=subCommands;
  if (strings.length < 1 || strings[0].length() < 2)   return null;
  while (true) {
    String sub=new StringComparsion(strings[0],subo.toArray()).getBestMatch();
    if (subo.isEmpty())     break;
    for (    SubCommand subCommand : subo) {
      if (subCommand.cmd.equals(sub)) {
        if (subCommand.permission.hasPermission(player))         return Arrays.asList(sub);
 else {
          subo.remove(subCommand);
          break;
        }
      }
    }
  }
  return null;
}
Program: 58099
Project: 58099
Buggy source:
public static Plot getBottomPlot(World world,Plot plot){
  if (plot.settings.getMerged(0)) {
    return getBottomPlot(world,PlotMain.getPlots(world).get(new PlotId(plot.id.x,plot.id.y - 1)));
  }
  if (plot.settings.getMerged(3)) {
    return getBottomPlot(world,PlotMain.getPlots(world).get(new PlotId(plot.id.x - 1,plot.id.y)));
  }
  return plot;
}

Fixed version (ground truth):
public static Plot getBottomPlot(World world,Plot plot){
  if (plot.settings.getMerged(0)) {
    Plot p=PlotMain.getPlots(world).get(new PlotId(plot.id.x,plot.id.y - 1));
    if (p == null) {
      return plot;
    }
    return getBottomPlot(world,p);
  }
  if (plot.settings.getMerged(3)) {
    Plot p=PlotMain.getPlots(world).get(new PlotId(plot.id.x - 1,plot.id.y));
    if (p == null) {
      return plot;
    }
    return getBottomPlot(world,p);
  }
  return plot;
}
Program: 58100
Project: 58100
Buggy source:
public static void add(StringWrapper name,UUID uuid){
  uuidMap.put(name,uuid);
}

Fixed version (ground truth):
public static void add(StringWrapper name,UUID uuid){
  if (!uuidMap.containsKey(name) && !uuidMap.inverse().containsKey(uuid)) {
    uuidMap.put(name,uuid);
  }
}
Program: 58101
Project: 58101
Buggy source:
/** 
 * This method is called when a world loads. Make sure you set all your constants here. You are provided with the configuration section for that specific world.
 */
@Override public void loadConfiguration(ConfigurationSection config){
  this.PLOT_HEIGHT=config.getInt("String_Node_Str");
  this.PLOT_WIDTH=config.getInt("String_Node_Str");
  this.MAIN_BLOCK=(PlotBlock[])Configuration.BLOCKLIST.parseString(StringUtils.join(config.getStringList("String_Node_Str"),','));
  this.TOP_BLOCK=(PlotBlock[])Configuration.BLOCKLIST.parseString(StringUtils.join(config.getStringList("String_Node_Str"),','));
  this.WALL_BLOCK=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.ROAD_WIDTH=config.getInt("String_Node_Str");
  this.ROAD_HEIGHT=config.getInt("String_Node_Str");
  this.ROAD_STRIPES_ENABLED=config.getBoolean("String_Node_Str");
  this.ROAD_BLOCK=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.ROAD_STRIPES=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.WALL_FILLING=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.WALL_HEIGHT=config.getInt("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method is called when a world loads. Make sure you set all your constants here. You are provided with the configuration section for that specific world.
 */
@Override public void loadConfiguration(ConfigurationSection config){
  this.PLOT_HEIGHT=config.getInt("String_Node_Str");
  if (!config.contains("String_Node_Str")) {
    PlotMain.sendConsoleSenderMessage("String_Node_Str" + config.getCurrentPath() + "String_Node_Str");
  }
  this.PLOT_WIDTH=config.getInt("String_Node_Str");
  this.MAIN_BLOCK=(PlotBlock[])Configuration.BLOCKLIST.parseString(StringUtils.join(config.getStringList("String_Node_Str"),','));
  this.TOP_BLOCK=(PlotBlock[])Configuration.BLOCKLIST.parseString(StringUtils.join(config.getStringList("String_Node_Str"),','));
  this.WALL_BLOCK=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.ROAD_WIDTH=config.getInt("String_Node_Str");
  this.ROAD_HEIGHT=config.getInt("String_Node_Str");
  this.ROAD_STRIPES_ENABLED=config.getBoolean("String_Node_Str");
  this.ROAD_BLOCK=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.ROAD_STRIPES=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.WALL_FILLING=(PlotBlock)Configuration.BLOCK.parseString(config.getString("String_Node_Str"));
  this.WALL_HEIGHT=config.getInt("String_Node_Str");
}
Program: 58102
Project: 58102
Buggy source:
/** 
 * Initialize variables, and create plotworld object used in calculations
 */
public WorldGenerator(String world){
  super(world);
  this.plotsize=this.plotworld.PLOT_WIDTH;
  this.pathsize=this.plotworld.ROAD_WIDTH;
  this.floor1=this.plotworld.ROAD_BLOCK;
  this.floor2=this.plotworld.ROAD_STRIPES;
  this.wallfilling=this.plotworld.WALL_FILLING;
  this.size=this.pathsize + this.plotsize;
  this.wall=this.plotworld.WALL_BLOCK;
  this.plotfloors=this.plotworld.TOP_BLOCK;
  this.filling=this.plotworld.MAIN_BLOCK;
  this.wallheight=this.plotworld.WALL_HEIGHT;
  this.roadheight=this.plotworld.ROAD_HEIGHT;
  this.plotheight=this.plotworld.PLOT_HEIGHT;
  this.biome=this.plotworld.PLOT_BIOME;
}

Fixed version (ground truth):
/** 
 * Initialize variables, and create plotworld object used in calculations
 */
public WorldGenerator(String world){
  super(world);
  if (this.plotworld == null) {
    this.plotworld=new DefaultPlotWorld(world);
    if (!PlotMain.config.contains("String_Node_Str" + world)) {
      PlotMain.config=YamlConfiguration.loadConfiguration(PlotMain.configFile);
      PlotMain.config.createSection("String_Node_Str" + world);
    }
    ConfigurationSection section=PlotMain.config.getConfigurationSection("String_Node_Str" + world);
    this.plotworld.saveConfiguration(section);
    this.plotworld.loadDefaultConfiguration(section);
    this.plotworld.loadConfiguration(section);
    PlotMain.sendConsoleSenderMessage("String_Node_Str");
  }
  this.plotsize=this.plotworld.PLOT_WIDTH;
  this.pathsize=this.plotworld.ROAD_WIDTH;
  this.floor1=this.plotworld.ROAD_BLOCK;
  this.floor2=this.plotworld.ROAD_STRIPES;
  this.wallfilling=this.plotworld.WALL_FILLING;
  this.size=this.pathsize + this.plotsize;
  this.wall=this.plotworld.WALL_BLOCK;
  this.plotfloors=this.plotworld.TOP_BLOCK;
  this.filling=this.plotworld.MAIN_BLOCK;
  this.wallheight=this.plotworld.WALL_HEIGHT;
  this.roadheight=this.plotworld.ROAD_HEIGHT;
  this.plotheight=this.plotworld.PLOT_HEIGHT;
  this.biome=this.plotworld.PLOT_BIOME;
}
Program: 58103
Project: 58103
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.setWall(requester,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;
  }
  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);
  }
}
Program: 58104
Project: 58104
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(requester,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;
  }
  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);
  }
}
Program: 58105
Project: 58105
Buggy source:
/** 
 * Adjusts a plot wall
 * @param player
 * @param plot
 * @param block
 */
public static void adjustWall(Player player,Plot plot,PlotBlock block){
  World world=player.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  manager.setWall(player,plotworld,plot.id,block);
}

Fixed version (ground truth):
/** 
 * Adjusts a plot wall
 * @param player
 * @param plot
 * @param block
 */
public static void adjustWall(Player player,Plot plot,PlotBlock block){
  World world=player.getWorld();
  PlotManager manager=PlotMain.getPlotManager(world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  manager.setWall(world,plotworld,plot.id,block);
}
Program: 58106
Project: 58106
Buggy source:
public abstract boolean setFloor(Player player,PlotWorld plotworld,PlotId plotid,PlotBlock[] block);

Fixed version (ground truth):
public abstract boolean setFloor(World world,PlotWorld plotworld,PlotId plotid,PlotBlock[] block);
Program: 58107
Project: 58107
Buggy source:
public abstract boolean setBiome(Player player,Plot plot,Biome biome);

Fixed version (ground truth):
public abstract boolean setBiome(World world,Plot plot,Biome biome);
Program: 58108
Project: 58108
Buggy source:
public abstract boolean setWall(Player player,PlotWorld plotworld,PlotId plotid,PlotBlock block);

Fixed version (ground truth):
public abstract boolean setWall(World world,PlotWorld plotworld,PlotId plotid,PlotBlock block);
Program: 58110
Project: 58110
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public boolean execute(Player plr,String... args){
  if (args.length < 1) {
    PlayerFunctions.sendMessage(plr,C.NEED_USER);
    return true;
  }
  String username=args[0];
  List<Plot> plots=getPlots(Bukkit.getOfflinePlayer(username).getUniqueId());
  if (plots.isEmpty()) {
    PlayerFunctions.sendMessage(plr,C.FOUND_NO_PLOTS);
    return true;
  }
  if (args.length < 2) {
    Plot plot=plots.get(0);
    PlotMain.teleportPlayer(plr,plr.getLocation(),plot);
    return true;
  }
  int i;
  try {
    i=Integer.parseInt(args[1]);
  }
 catch (  Exception e) {
    PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
    return true;
  }
  if ((i < 0) || (i > plots.size())) {
    PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
    return true;
  }
  Plot plot=plots.get(i);
  PlotMain.teleportPlayer(plr,plr.getLocation(),plot);
  return true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean execute(Player plr,String... args){
  if (args.length < 1) {
    PlayerFunctions.sendMessage(plr,C.NEED_USER);
    return true;
  }
  String username=args[0];
  UUID uuid=UUIDHandler.getUUID(username);
  List<Plot> plots=null;
  if (uuid != null) {
    plots=getPlots(uuid);
  }
  if (uuid == null || plots.isEmpty()) {
    PlayerFunctions.sendMessage(plr,C.FOUND_NO_PLOTS);
    return true;
  }
  if (args.length < 2) {
    Plot plot=plots.get(0);
    PlotMain.teleportPlayer(plr,plr.getLocation(),plot);
    return true;
  }
  int i;
  try {
    i=Integer.parseInt(args[1]);
  }
 catch (  Exception e) {
    PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
    return true;
  }
  if ((i < 0) || (i > plots.size())) {
    PlayerFunctions.sendMessage(plr,C.NOT_VALID_NUMBER);
    return true;
  }
  Plot plot=plots.get(i);
  PlotMain.teleportPlayer(plr,plr.getLocation(),plot);
  return true;
}
Program: 58111
Project: 58111
Buggy source:
/** 
 * Get translated if exists
 * @return translated if exists else default
 */
public String s(){
  if (PlotMain.translations != null) {
    String t=PlotMain.translations.getString(this.toString());
    if (t != null) {
      this.s=t;
    }
  }
  if (this.s.length() < 1) {
    return this.d.replace("String_Node_Str","String_Node_Str");
  }
  return this.s.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get translated if exists
 * @return translated if exists else default
 */
public String s(){
  if (PlotMain.translations != null) {
    String t=PlotMain.translations.getString(this.toString());
    if (t != null) {
      this.s=t;
    }
  }
  if (this.s.length() < 1) {
    return "String_Node_Str";
  }
  return this.s.replace("String_Node_Str","String_Node_Str");
}