nus-yam/ex-repair huggingface dataset:
Program: 57957
Project: 57957
Buggy source:
/** 
 * Get the main class for this plugin <br> - Contains a lot of fields and methods - not very well organized <br> Only use this if you really need it
 * @return PlotSquared PlotSquared Main Class
 * @see com.intellectualcrafters.plot.PS
 */
public PS getMain(){
  return PS.get();
}

Fixed version (ground truth):
/** 
 * Get the main class for this plugin <br> - Contains a lot of fields and methods - not very well organized <br> Only use this if you really need it
 * @return PlotSquared PlotSquared Main Class
 * @see PS
 */
public PS getMain(){
  return PS.get();
}
Program: 57958
Project: 57958
Buggy source:
/** 
 * @return main configuration
 * @see com.intellectualcrafters.plot.PS#config
 */
public YamlConfiguration getConfig(){
  return PS.get().config;
}

Fixed version (ground truth):
/** 
 * @return main configuration
 * @see PS#config
 */
public YamlConfiguration getConfig(){
  return PS.get().config;
}
Program: 57959
Project: 57959
Buggy source:
/** 
 * Get a collection containing the players plots
 * @param world  Specify the world we want to select the plots from
 * @param player Player, for whom we're getting the plots
 * @return a set containing the players plots
 * @see com.intellectualcrafters.plot.PS#getPlots(String,PlotPlayer) org.bukkit.entity.Player)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Set<Plot> getPlayerPlots(final World world,final Player player){
  return PS.get().getPlots(world.getName(),BukkitUtil.getPlayer(player));
}

Fixed version (ground truth):
/** 
 * Get a collection containing the players plots
 * @param world  Specify the world we want to select the plots from
 * @param player Player, for whom we're getting the plots
 * @return a set containing the players plots
 * @see PS#getPlots(String,PlotPlayer)
 * @see Plot
 */
public Set<Plot> getPlayerPlots(final World world,final Player player){
  return PS.get().getPlots(world.getName(),BukkitUtil.getPlayer(player));
}
Program: 57960
Project: 57960
Buggy source:
/** 
 * Get all plots
 * @return all plots
 * @see com.intellectualcrafters.plot.PS#getPlots()
 */
public Set<Plot> getAllPlots(){
  return PS.get().getPlots();
}

Fixed version (ground truth):
/** 
 * Get all plots
 * @return all plots
 * @see PS#getPlots()
 */
public Set<Plot> getAllPlots(){
  return PS.get().getPlots();
}
Program: 57961
Project: 57961
Buggy source:
/** 
 * @return storage configuration
 * @see com.intellectualcrafters.plot.PS#storage
 */
public YamlConfiguration getStorage(){
  return PS.get().storage;
}

Fixed version (ground truth):
/** 
 * @return storage configuration
 * @see PS#storage
 */
public YamlConfiguration getStorage(){
  return PS.get().storage;
}
Program: 57962
Project: 57962
Buggy source:
/** 
 * Get plot locations
 * @param p Plot that you want to get the locations for
 * @return [0] = bottomLc, [1] = topLoc, [2] = home
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotBottomLoc(String,com.intellectualcrafters.plot.object.PlotId)
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotTopLoc(String,com.intellectualcrafters.plot.object.PlotId)
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotHome(String,com.intellectualcrafters.plot.object.Plot)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Location[] getLocations(final Plot p){
  return new Location[]{BukkitUtil.getLocation(MainUtil.getPlotBottomLocAbs(p.world,p.id).subtract(1,0,1)),BukkitUtil.getLocation(MainUtil.getPlotTopLocAbs(p.world,p.id)),BukkitUtil.getLocation(MainUtil.getPlotHome(p.world,p.id))};
}

Fixed version (ground truth):
/** 
 * Get plot locations
 * @param p Plot that you want to get the locations for
 * @return [0] = bottomLc, [1] = topLoc, [2] = home
 * @see MainUtil#getPlotBottomLocAbs(String,PlotId)
 * @see MainUtil#getPlotTopLocAbs(String,PlotId)
 * @see MainUtil#getPlotHome(String,PlotId)
 * @see Plot
 */
public Location[] getLocations(final Plot p){
  return new Location[]{BukkitUtil.getLocation(MainUtil.getPlotBottomLocAbs(p.world,p.id).subtract(1,0,1)),BukkitUtil.getLocation(MainUtil.getPlotTopLocAbs(p.world,p.id)),BukkitUtil.getLocation(MainUtil.getPlotHome(p.world,p.id))};
}
Program: 57963
Project: 57963
Buggy source:
/** 
 * Get the PlotSquared class
 * @return PlotSquared Class
 * @see com.intellectualcrafters.plot.PS
 */
public PS getPlotSquared(){
  return PS.get();
}

Fixed version (ground truth):
/** 
 * Get the PlotSquared class
 * @return PlotSquared Class
 * @see PS
 */
public PS getPlotSquared(){
  return PS.get();
}
Program: 57964
Project: 57964
Buggy source:
/** 
 * Check whether or not a player is in a plot
 * @param player who we're checking for
 * @return true if the player is in a plot, false if not-
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotAbs(com.intellectualcrafters.plot.object.Location)
 */
public boolean isInPlot(final Player player){
  return MainUtil.getPlotAbs(BukkitUtil.getLocation(player)) != null;
}

Fixed version (ground truth):
/** 
 * Check whether or not a player is in a plot
 * @param player who we're checking for
 * @return true if the player is in a plot, false if not-
 * @see MainUtil#getPlotAbs(com.intellectualcrafters.plot.object.Location)
 */
public boolean isInPlot(final Player player){
  return MainUtil.getPlotAbs(BukkitUtil.getLocation(player)) != null;
}
Program: 57965
Project: 57965
Buggy source:
/** 
 * Get the table entry ID
 * @param world Which the plot is located in
 * @param id2   Plot ID
 * @return Integer = Plot Entry Id
 */
int getId(final Plot plot);

Fixed version (ground truth):
/** 
 * Get the table entry ID
 * @param plot Plot Object
 * @return Integer = Plot Entry Id
 */
int getId(final Plot plot);
Program: 57966
Project: 57966
Buggy source:
/** 
 * Get the id of a given plot cluster
 * @param world Which the plot is located in
 * @param id cluster id
 * @return Integer = Cluster Entry Id
 */
int getClusterId(final PlotCluster cluster);

Fixed version (ground truth):
/** 
 * Get the id of a given plot cluster
 * @param cluster PlotCluster Object
 * @return Integer = Cluster Entry Id
 */
int getClusterId(final PlotCluster cluster);
Program: 57967
Project: 57967
Buggy source:
/** 
 * Get Plot Comments
 * @param world World in which the plot is located
 * @param plot  Plot Object
 * @param tier  Comment Tier
 * @return Plot Comments within the specified tier
 */
void getComments(final Plot plot,final String inbox,final RunnableVal whenDone);

Fixed version (ground truth):
/** 
 * Get Plot Comments
 * @param plot  Plot Object
 * @return Plot Comments within the specified tier
 */
void getComments(final Plot plot,final String inbox,final RunnableVal whenDone);
Program: 57968
Project: 57968
Buggy source:
/** 
 * Remove a plot comment
 * @param world   World in which the plot is located
 * @param plot    Plot Object
 * @param comment Comment to remove
 */
void removeComment(final Plot plot,final PlotComment comment);

Fixed version (ground truth):
/** 
 * Remove a plot comment
 * @param plot    Plot Object
 * @param comment Comment to remove
 */
void removeComment(final Plot plot,final PlotComment comment);
Program: 57969
Project: 57969
Buggy source:
/** 
 * @param world
 * @param cluster
 * @param uuid
 */
void setInvited(final PlotCluster cluster,final UUID uuid);

Fixed version (ground truth):
/** 
 * @param cluster
 * @param uuid
 */
void setInvited(final PlotCluster cluster,final UUID uuid);
Program: 57970
Project: 57970
Buggy source:
/** 
 * Create tables
 * @param database Database in which the tables will be created
 * @throws SQLException If the database manager is unable to create the tables
 */
void createTables() throws Exception ;

Fixed version (ground truth):
/** 
 * Create tables
 * @throws SQLException If the database manager is unable to create the tables
 */
void createTables() throws Exception ;
Program: 57971
Project: 57971
Buggy source:
/** 
 * Set a plot comment
 * @param world   World in which the plot is located
 * @param plot    Plot Object
 * @param comment Comment to add
 */
void setComment(final Plot plot,final PlotComment comment);

Fixed version (ground truth):
/** 
 * Set a plot comment
 * @param plot    Plot Object
 * @param comment Comment to add
 */
void setComment(final Plot plot,final PlotComment comment);
Program: 57972
Project: 57972
Buggy source:
/** 
 * Set the merged status for a plot
 * @param world  World in which the plot is located
 * @param plot   Plot Object
 * @param merged boolean[]
 */
void setMerged(final Plot plot,final boolean[] merged);

Fixed version (ground truth):
/** 
 * Set the merged status for a plot
 * @param plot   Plot Object
 * @param merged boolean[]
 */
void setMerged(final Plot plot,final boolean[] merged);
Program: 57973
Project: 57973
Buggy source:
@Override public void sendMessage(String message){
  player.sendMessage(ChatTypes.CHAT,message);
}

Fixed version (ground truth):
@Override public void sendMessage(String message){
  player.sendMessage(ChatTypes.CHAT,Texts.of(message));
}
Program: 57974
Project: 57974
Buggy source:
/** 
 * Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED)
 */
@Override public boolean finishPlotMerge(final PlotWorld plotworld,final ArrayList<PlotId> plotIds){
  final PlotId pos1=plotIds.get(0);
  final PlotBlock block=((ClassicPlotWorld)plotworld).CLAIMED_WALL_BLOCK;
  final PlotBlock unclaim=((ClassicPlotWorld)plotworld).WALL_BLOCK;
  if (!block.equals(unclaim)) {
    setWall(plotworld,pos1,new PlotBlock[]{block});
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED)
 */
@Override public boolean finishPlotMerge(final PlotWorld plotworld,final ArrayList<PlotId> plotIds){
  final PlotId pos1=plotIds.get(0);
  final PlotBlock block=((ClassicPlotWorld)plotworld).CLAIMED_WALL_BLOCK;
  final PlotBlock unclaim=((ClassicPlotWorld)plotworld).WALL_BLOCK;
  if (block.id != 0 || !block.equals(unclaim)) {
    setWall(plotworld,pos1,new PlotBlock[]{block});
  }
  return true;
}
Program: 57976
Project: 57976
Buggy source:
@Override public void run(){
  final PlotBlock wall=isDelete ? dpw.WALL_BLOCK : dpw.CLAIMED_WALL_BLOCK;
  setWall(dpw,plot.id,new PlotBlock[]{wall});
  SetBlockQueue.addNotify(whenDone);
}

Fixed version (ground truth):
@Override public void run(){
  final PlotBlock wall=isDelete ? dpw.WALL_BLOCK : dpw.CLAIMED_WALL_BLOCK;
  if (wall.id != 0 || !dpw.WALL_BLOCK.equals(dpw.CLAIMED_WALL_BLOCK)) {
    setWall(dpw,plot.id,new PlotBlock[]{wall});
  }
  SetBlockQueue.addNotify(whenDone);
}
Program: 57977
Project: 57977
Buggy source:
@Override public boolean hasPermission(final String perm){
  if (Settings.PERMISSION_CACHING) {
    if (this.noPerm.contains(perm)) {
      return false;
    }
    if (this.hasPerm.contains(perm)) {
      return true;
    }
    final boolean result=this.player.hasPermission(perm);
    if (!result) {
      this.noPerm.add(perm);
      return false;
    }
    this.hasPerm.add(perm);
    return true;
  }
  if (offline && EconHandler.manager != null) {
    System.out.print("String_Node_Str");
    return EconHandler.manager.hasPermission(getName(),perm);
  }
  System.out.print("String_Node_Str" + perm + "String_Node_Str"+ player.hasPermission(perm));
  return this.player.hasPermission(perm);
}

Fixed version (ground truth):
@Override public boolean hasPermission(final String perm){
  if (Settings.PERMISSION_CACHING) {
    if (this.noPerm.contains(perm)) {
      return false;
    }
    if (this.hasPerm.contains(perm)) {
      return true;
    }
    final boolean result=this.player.hasPermission(perm);
    if (!result) {
      this.noPerm.add(perm);
      return false;
    }
    this.hasPerm.add(perm);
    return true;
  }
  if (offline && EconHandler.manager != null) {
    return EconHandler.manager.hasPermission(getName(),perm);
  }
  return this.player.hasPermission(perm);
}
Program: 57982
Project: 57982
Buggy source:
public static List<Command> getCommands(final CommandCategory category,final PlotPlayer player){
  final List<Command> cmds=new ArrayList<>();
  for (  final Command c : instance.commands) {
    if (!c.getRequiredType().equals(PlotPlayer.class)) {
      if ((c.getCategory().equals(category)) && player.hasPermission(c.getPermission())) {
        cmds.add(c);
      }
    }
  }
  return cmds;
}

Fixed version (ground truth):
public static List<Command> getCommands(final CommandCategory category,final PlotPlayer player){
  final List<Command> cmds=new ArrayList<>();
  for (  final Command c : instance.commands.values()) {
    if (c.getRequiredType().isInstance(PlotPlayer.class)) {
      if ((category == null || (c.getCategory().equals(category))) && player.hasPermission(c.getPermission())) {
        cmds.add(c);
      }
    }
  }
  return cmds;
}
Program: 57983
Project: 57983
Buggy source:
public void displayGenerators(PlotPlayer plr){
  StringBuffer message=new StringBuffer();
  message.append("String_Node_Str");
  for (  Entry<String,ChunkGenerator> entry : SetupUtils.generators.entrySet()) {
    if (entry.getKey().equals("String_Node_Str")) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else     if (entry.getValue() instanceof HybridGen) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else     if (entry.getValue() instanceof PlotGenerator) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
  }
  MainUtil.sendMessage(plr,message.toString());
}

Fixed version (ground truth):
public void displayGenerators(PlotPlayer plr){
  StringBuffer message=new StringBuffer();
  message.append("String_Node_Str");
  for (  Entry<String,ChunkGenerator> entry : SetupUtils.generators.entrySet()) {
    if (entry.getKey().equals("String_Node_Str")) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else     if (entry.getValue() instanceof HybridGen) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else     if (entry.getValue() instanceof BukkitPlotGenerator) {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
 else {
      message.append("String_Node_Str" + entry.getKey() + "String_Node_Str");
    }
  }
  MainUtil.sendMessage(plr,message.toString());
}
Program: 57985
Project: 57985
Buggy source:
final public Collection<Command> getCommands(){
  return this.commands.values();
}

Fixed version (ground truth):
final public ArrayList<Command> getCommands(){
  ArrayList<Command> result=new ArrayList<>(this.commands.values());
  Collections.sort(result,new Comparator<Command>(){
    @Override public int compare(    Command a,    Command b){
      if (a == b) {
        return 0;
      }
      if (a == null) {
        return -1;
      }
      if (b == null) {
        return 1;
      }
      return a.getCommand().compareTo(b.getCommand());
    }
  }
);
  return result;
}
Program: 57989
Project: 57989
Buggy source:
@Override public Location getLocation(){
  System.out.print(loc);
  return loc;
}

Fixed version (ground truth):
@Override public Location getLocation(){
  return loc;
}
Program: 57994
Project: 57994
Buggy source:
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  final PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  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()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  UUID uuid;
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    uuid=DBFunc.everyone;
  }
 else {
    uuid=UUIDHandler.getUUID(args[0]);
  }
  if (uuid == null) {
    if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER_WAIT,args[0]);
    }
 else {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
    }
    return false;
  }
  if (plot.isOwner(uuid)) {
    MainUtil.sendMessage(plr,C.ALREADY_OWNER);
    return false;
  }
  if (plot.getDenied().contains(uuid)) {
    MainUtil.sendMessage(plr,C.ALREADY_ADDED);
    return false;
  }
  plot.removeMember(uuid);
  plot.removeTrusted(uuid);
  plot.addDenied(uuid);
  EventUtil.manager.callDenied(plr,plot,uuid,true);
  MainUtil.sendMessage(plr,C.DENIED_ADDED);
  if (!uuid.equals(DBFunc.everyone)) {
    handleKick(uuid,plot);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  final PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  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()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  UUID uuid;
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    uuid=DBFunc.everyone;
  }
 else {
    uuid=UUIDHandler.getUUID(args[0],null);
  }
  if (uuid == null) {
    if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER_WAIT,args[0]);
    }
 else {
      MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
    }
    return false;
  }
  if (plot.isOwner(uuid)) {
    MainUtil.sendMessage(plr,C.ALREADY_OWNER);
    return false;
  }
  if (plot.getDenied().contains(uuid)) {
    MainUtil.sendMessage(plr,C.ALREADY_ADDED);
    return false;
  }
  plot.removeMember(uuid);
  plot.removeTrusted(uuid);
  plot.addDenied(uuid);
  EventUtil.manager.callDenied(plr,plot,uuid,true);
  MainUtil.sendMessage(plr,C.DENIED_ADDED);
  if (!uuid.equals(DBFunc.everyone)) {
    handleKick(uuid,plot);
  }
  return true;
}
Program: 57997
Project: 57997
Buggy source:
private UUID getUUID(final String string){
  return UUIDHandler.getUUID(string);
}

Fixed version (ground truth):
private UUID getUUID(final String string){
  return UUIDHandler.getUUID(string,null);
}
Program: 57999
Project: 57999
Buggy source:
@Override public boolean onCommand(final CommandCaller caller,final String... args){
  final PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  int count=0;
switch (args[0]) {
case "String_Node_Str":
    ArrayList<UUID> toRemove=new ArrayList<>();
  for (  UUID uuid : plot.getDenied()) {
    if (UUIDHandler.getName(uuid) == null) {
      toRemove.add(uuid);
    }
  }
for (UUID uuid : toRemove) {
  plot.removeDenied(uuid);
  count++;
}
break;
case "String_Node_Str":
for (UUID uuid : new ArrayList<>(plot.getDenied())) {
plot.removeDenied(uuid);
count++;
}
break;
default :
UUID uuid=UUIDHandler.getUUID(args[0]);
if (uuid != null) {
if (plot.removeDenied(uuid)) {
count++;
}
}
break;
}
if (count == 0) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER_WAIT,args[0]);
}
 else {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
}
return false;
}
 else {
MainUtil.sendMessage(plr,C.REMOVED_PLAYERS,count + "String_Node_Str");
}
return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(final CommandCaller caller,final String... args){
  final PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  int count=0;
switch (args[0]) {
case "String_Node_Str":
    ArrayList<UUID> toRemove=new ArrayList<>();
  for (  UUID uuid : plot.getDenied()) {
    if (UUIDHandler.getName(uuid) == null) {
      toRemove.add(uuid);
    }
  }
for (UUID uuid : toRemove) {
  plot.removeDenied(uuid);
  count++;
}
break;
case "String_Node_Str":
for (UUID uuid : new ArrayList<>(plot.getDenied())) {
plot.removeDenied(uuid);
count++;
}
break;
default :
UUID uuid=UUIDHandler.getUUID(args[0],null);
if (uuid != null) {
if (plot.removeDenied(uuid)) {
count++;
}
}
break;
}
if (count == 0) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER_WAIT,args[0]);
}
 else {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
}
return false;
}
 else {
MainUtil.sendMessage(plr,C.REMOVED_PLAYERS,count + "String_Node_Str");
}
return true;
}
Program: 58000
Project: 58000
Buggy source:
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  int count=0;
switch (args[0]) {
case "String_Node_Str":
    ArrayList<UUID> toRemove=new ArrayList<>();
  for (  UUID uuid : plot.getTrusted()) {
    if (UUIDHandler.getName(uuid) == null) {
      toRemove.add(uuid);
    }
  }
for (UUID uuid : toRemove) {
  plot.removeTrusted(uuid);
  count++;
}
break;
case "String_Node_Str":
for (UUID uuid : new ArrayList<>(plot.getTrusted())) {
plot.removeTrusted(uuid);
count++;
}
break;
default :
UUID uuid=UUIDHandler.getUUID(args[0]);
if (uuid != null) {
if (plot.removeTrusted(uuid)) {
count++;
}
}
break;
}
if (count == 0) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
return false;
}
 else {
MainUtil.sendMessage(plr,C.REMOVED_PLAYERS,count + "String_Node_Str");
}
return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  PlotPlayer plr=(PlotPlayer)caller.getSuperCaller();
  final Location loc=plr.getLocation();
  final Plot plot=MainUtil.getPlot(loc);
  if (plot == null) {
    return !sendMessage(plr,C.NOT_IN_PLOT);
  }
  if (!plot.hasOwner()) {
    MainUtil.sendMessage(plr,C.PLOT_UNOWNED);
    return false;
  }
  if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PLOT_PERMS);
    return true;
  }
  int count=0;
switch (args[0]) {
case "String_Node_Str":
    ArrayList<UUID> toRemove=new ArrayList<>();
  for (  UUID uuid : plot.getTrusted()) {
    if (UUIDHandler.getName(uuid) == null) {
      toRemove.add(uuid);
    }
  }
for (UUID uuid : toRemove) {
  plot.removeTrusted(uuid);
  count++;
}
break;
case "String_Node_Str":
for (UUID uuid : new ArrayList<>(plot.getTrusted())) {
plot.removeTrusted(uuid);
count++;
}
break;
default :
UUID uuid=UUIDHandler.getUUID(args[0],null);
if (uuid != null) {
if (plot.removeTrusted(uuid)) {
count++;
}
}
break;
}
if (count == 0) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[0]);
return false;
}
 else {
MainUtil.sendMessage(plr,C.REMOVED_PLAYERS,count + "String_Node_Str");
}
return true;
}
Program: 58005
Project: 58005
Buggy source:
@Override public UUIDWrapper initUUIDHandler(){
  return null;
}

Fixed version (ground truth):
@Override public UUIDHandlerImplementation initUUIDHandler(){
  return null;
}
Program: 58006
Project: 58006
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onChange(final BlockFromToEvent e){
  final Block b=e.getToBlock();
  final Location loc=BukkitUtil.getLocation(b.getLocation());
  if (PS.get().isPlotWorld(loc.getWorld())) {
    if (MainUtil.isPlotRoad(loc)) {
      e.setCancelled(true);
    }
 else {
      Plot plot=MainUtil.getPlot(loc);
      if (FlagManager.isPlotFlagTrue(plot,"String_Node_Str")) {
        e.setCancelled(true);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onChange(final BlockFromToEvent e){
  final Block b=e.getToBlock();
  final Location loc=BukkitUtil.getLocation(b.getLocation());
  if (PS.get().isPlotWorld(loc.getWorld())) {
    if (MainUtil.isPlotRoad(loc)) {
      e.setCancelled(true);
    }
 else {
      Plot plot=MainUtil.getPlot(loc);
      if (plot != null && FlagManager.isPlotFlagTrue(plot,"String_Node_Str")) {
        e.setCancelled(true);
      }
    }
  }
}
Program: 58008
Project: 58008
Buggy source:
@Override public void run(){
  chunk.load(true);
  populateBlocks(world,rand,X,Z,x,z,check);
}

Fixed version (ground truth):
@Override public void run(){
  chunk.load(true);
  populateBlocks(world,rand,cx,cz,bx,bz,check);
}
Program: 58009
Project: 58009
Buggy source:
public abstract boolean regenerateRegion(final Location pos1,final Location pos2,final Runnable whenDone);

Fixed version (ground truth):
/** 
 * Assumptions:<br> - pos1 and pos2 are in the same plot<br> It can be harmful to the world if parameters outside this scope are provided
 * @param pos1
 * @param pos2
 * @param whenDone
 * @return
 */
public abstract boolean regenerateRegion(final Location pos1,final Location pos2,final Runnable whenDone);
Program: 58015
Project: 58015
Buggy source:
@Override public void run(){
  long start=System.currentTimeMillis();
  while (chunks.size() > 0 && System.currentTimeMillis() - start < 20) {
    ChunkLoc chunk=chunks.remove(0);
    int x=chunk.x;
    int z=chunk.z;
    int xxb=x << 4;
    int zzb=z << 4;
    int xxt=xxb + 15;
    int zzt=zzb + 15;
    if (canRegen) {
      if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z) {
        BukkitUtil.regenerateChunk(world,x,z);
        continue;
      }
    }
    if (x == bcx) {
      xxb=p1x;
    }
    if (x == tcx) {
      xxt=p2x;
    }
    if (z == bcz) {
      zzb=p1z;
    }
    if (z == tcz) {
      zzt=p2z;
    }
    BukkitUtil.setBiome(plot.world,xxb,zzb,xxt,zzt,dpw.PLOT_BIOME);
    Location bot=new Location(world,xxb,0,zzb);
    Location top=new Location(world,xxt + 1,1,zzt + 1);
    MainUtil.setCuboidAsync(world,bot,top,bedrock);
    bot.setY(1);
    top.setY(dpw.PLOT_HEIGHT);
    MainUtil.setCuboidAsync(world,bot,top,filling);
    bot.setY(dpw.PLOT_HEIGHT);
    top.setY(dpw.PLOT_HEIGHT + 1);
    MainUtil.setCuboidAsync(world,bot,top,plotfloor);
    bot.setY(dpw.PLOT_HEIGHT + 1);
    top.setY(256);
    MainUtil.setSimpleCuboidAsync(world,bot,top,air);
  }
  if (chunks.size() != 0) {
    TaskManager.runTaskLater(this,1);
  }
 else {
    pastePlotSchematic(dpw,pos1,pos2);
    final PlotBlock wall=isDelete ? dpw.WALL_BLOCK : dpw.CLAIMED_WALL_BLOCK;
    setWall(dpw,plot.id,new PlotBlock[]{wall});
    SetBlockQueue.addNotify(whenDone);
  }
}

Fixed version (ground truth):
@Override public void run(){
  final PlotBlock wall=isDelete ? dpw.WALL_BLOCK : dpw.CLAIMED_WALL_BLOCK;
  setWall(dpw,plot.id,new PlotBlock[]{wall});
  SetBlockQueue.addNotify(whenDone);
}
Program: 58017
Project: 58017
Buggy source:
/** 
 * Set the plot biome
 */
public void setBiome(String biome){
  MainUtil.setBiome(this,biome);
}

Fixed version (ground truth):
/** 
 * Set the plot biome
 */
public void setBiome(String biome,Runnable whenDone){
  MainUtil.setBiome(this,biome,whenDone);
}
Program: 58018
Project: 58018
Buggy source:
public static void setBiome(final Plot plot,final String biome){
  final int bottomX=getPlotBottomLoc(plot.world,plot.id).getX() + 1;
  final int topX=getPlotTopLoc(plot.world,plot.id).getX();
  final int bottomZ=getPlotBottomLoc(plot.world,plot.id).getZ() + 1;
  final int topZ=getPlotTopLoc(plot.world,plot.id).getZ();
  BukkitUtil.setBiome(plot.world,bottomX,bottomZ,topX,topZ,biome);
  update(plot);
}

Fixed version (ground truth):
public static void setBiome(final Plot plot,final String biome,final Runnable whenDone){
  Location pos1=plot.getBottom().add(1,0,1);
  Location pos2=plot.getTop();
  ChunkManager.chunkTask(pos1,pos2,new RunnableVal<int[]>(){
    @Override public void run(){
      BukkitUtil.loadChunkAt(plot.world,value[0],value[1],false);
      BukkitUtil.setBiome(plot.world,value[2],value[3],value[4],value[4],biome);
      BukkitUtil.unloadChunkAt(plot.world,value[0],value[1],true,true);
    }
  }
,new Runnable(){
    @Override public void run(){
      update(plot);
      TaskManager.runTask(whenDone);
    }
  }
,5);
}
Program: 58021
Project: 58021
Buggy source:
@Override public void run(){
  final ArrayList<String> strings=new ArrayList<String>(){
{
      add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
    }
  }
;
  for (  final String s : strings) {
    MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements));
  }
}

Fixed version (ground truth):
@Override public void run(){
  final ArrayList<String> strings=new ArrayList<String>(){
{
      add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
    }
  }
;
  for (  final String s : strings) {
    MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements),false);
  }
}
Program: 58022
Project: 58022
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      final ArrayList<String> strings=new ArrayList<String>(){
{
          add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
        }
      }
;
      for (      final String s : strings) {
        MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements));
      }
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      final ArrayList<String> strings=new ArrayList<String>(){
{
          add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
        }
      }
;
      for (      final String s : strings) {
        MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements),false);
      }
    }
  }
);
  return true;
}
Program: 58024
Project: 58024
Buggy source:
@Override public void run(){
  final ArrayList<String> strings=new ArrayList<String>(){
{
      add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
    }
  }
;
  for (  final String s : strings) {
    MainUtil.sendMessage(plr,s);
  }
}

Fixed version (ground truth):
@Override public void run(){
  final ArrayList<String> strings=new ArrayList<String>(){
{
      add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str"));
      add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
    }
  }
;
  for (  final String s : strings) {
    MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements));
  }
}
Program: 58025
Project: 58025
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      final ArrayList<String> strings=new ArrayList<String>(){
{
          add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
        }
      }
;
      for (      final String s : strings) {
        MainUtil.sendMessage(plr,s);
      }
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      final ArrayList<String> strings=new ArrayList<String>(){
{
          add(String.format("String_Node_Str",PS.get().IMP.getVersion()));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str"));
          add(String.format("String_Node_Str" + (PS.get().update == null ? PS.get().IMP.getVersion() : PS.get().update)));
        }
      }
;
      for (      final String s : strings) {
        MainUtil.sendMessage(plr,StringMan.replaceFromMap(s,C.replacements));
      }
    }
  }
);
  return true;
}
Program: 58029
Project: 58029
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(accepter,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.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(accepter,C.MERGE_NOT_VALID);
      return;
    }
    final PlotWorld plotWorld=PlotSquared.getPlotWorld(world);
    if ((EconHandler.manager != null) && plotWorld.USE_ECONOMY) {
      double cost=plotWorld.MERGE_PRICE;
      cost=plots.size() * cost;
      if (cost > 0d) {
        if (EconHandler.manager.getMoney(plr) < cost) {
          sendMessage(plr,C.CANNOT_AFFORD_MERGE,cost + "String_Node_Str");
          return;
        }
        EconHandler.manager.withdrawMoney(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.sendMessage(accepter,C.MERGE_ACCEPTED);
}
Program: 58032
Project: 58032
Buggy source:
public void noArgs(PlotPlayer plr){
  final StringBuilder builder=new StringBuilder();
  builder.append(C.SUBCOMMAND_SET_OPTIONS_HEADER.s());
  if (plr != null) {
    if (PlotSquared.economy != null) {
      builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
    }
 else {
      builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
    }
  }
 else {
    builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  }
  MainUtil.sendMessage(plr,builder.toString());
}

Fixed version (ground truth):
public void noArgs(PlotPlayer plr){
  final StringBuilder builder=new StringBuilder();
  builder.append(C.SUBCOMMAND_SET_OPTIONS_HEADER.s());
  if (plr != null) {
    if (EconHandler.manager != null) {
      builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
    }
 else {
      builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
    }
  }
 else {
    builder.append(getArgumentList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  }
  MainUtil.sendMessage(plr,builder.toString());
}
Program: 58034
Project: 58034
Buggy source:
/** 
 * Return the plot manager for this type of generator, or create one For square plots you may as well use the default plot manager which comes with PlotSquared
 */
@Override public PlotManager getPlotManager(){
  if (HybridGen.manager == null) {
    HybridGen.manager=new HybridPlotManager();
  }
  return HybridGen.manager;
}

Fixed version (ground truth):
/** 
 * Return the plot manager for this type of generator, or create one For square plots you may as well use the default plot manager which comes with PlotSquared
 */
public PlotManager getPlotManager(){
  if (HybridGen.manager == null) {
    HybridGen.manager=new HybridPlotManager();
  }
  return HybridGen.manager;
}
Program: 58035
Project: 58035
Buggy source:
/** 
 * Get a new plotworld class For square plots you can use the DefaultPlotWorld class which comes with PlotSquared
 */
@Override public PlotWorld getNewPlotWorld(final String world){
  if (this.plotworld == null) {
    this.plotworld=new HybridPlotWorld(world);
  }
  return this.plotworld;
}

Fixed version (ground truth):
/** 
 * Get a new plotworld class For square plots you can use the DefaultPlotWorld class which comes with PlotSquared
 */
public PlotWorld getNewPlotWorld(final String world){
  if (this.plotworld == null) {
    this.plotworld=new HybridPlotWorld(world);
  }
  return this.plotworld;
}
Program: 58037
Project: 58037
Buggy source:
@Override public short[][] generateExtBlockSections(final World world,final Random r,final int cx,final int cz,final BiomeGrid biomes){
  final int prime=13;
  int h=1;
  h=(prime * h) + cx;
  h=(prime * h) + cz;
  this.random.state=h;
  this.result=new short[256 / 16][];
  PlotWorld plotworld=PlotSquared.getPlotWorld(world.getName());
  Biome biome=Biome.valueOf(plotworld.PLOT_BIOME);
  if (ChunkManager.FORCE_PASTE) {
    X=cx << 4;
    Z=cz << 4;
    for (short x=0; x < 16; x++) {
      for (short z=0; z < 16; z++) {
        if (biomes != null) {
          biomes.setBiome(x,z,biome);
        }
        final PlotLoc loc=new PlotLoc((short)(X + x),(short)(Z + z));
        final HashMap<Short,Short> blocks=ChunkManager.GENERATE_BLOCKS.get(loc);
        for (        final Entry<Short,Short> entry : blocks.entrySet()) {
          setBlock(x,entry.getKey(),z,entry.getValue());
        }
      }
    }
    return this.result;
  }
  this.result=generateChunk(world,ChunkManager.CURRENT_PLOT_CLEAR,random,cx,cz,biomes,result);
  if (ChunkManager.CURRENT_PLOT_CLEAR != null) {
    PlotLoc loc;
    for (    Entry<PlotLoc,HashMap<Short,Short>> entry : ChunkManager.GENERATE_BLOCKS.entrySet()) {
      for (      Entry<Short,Short> entry2 : entry.getValue().entrySet()) {
        loc=entry.getKey();
        setBlock(loc.x,entry2.getKey(),loc.z,entry2.getValue());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public short[][] generateExtBlockSections(World world,Random r,int cx,int cz,BiomeGrid biomes){
  final int prime=13;
  int h=1;
  h=(prime * h) + cx;
  h=(prime * h) + cz;
  this.random.state=h;
  this.result=new short[256 / 16][];
  PlotWorld plotworld=PlotSquared.getPlotWorld(world.getName());
  Biome biome=Biome.valueOf(plotworld.PLOT_BIOME);
  this.X=cx << 4;
  this.Z=cz << 4;
  if (ChunkManager.FORCE_PASTE) {
    for (short x=0; x < 16; x++) {
      for (short z=0; z < 16; z++) {
        if (biomes != null) {
          biomes.setBiome(x,z,biome);
        }
        final PlotLoc loc=new PlotLoc((short)(X + x),(short)(Z + z));
        final HashMap<Short,Short> blocks=ChunkManager.GENERATE_BLOCKS.get(loc);
        for (        final Entry<Short,Short> entry : blocks.entrySet()) {
          setBlock(x,entry.getKey(),z,entry.getValue());
        }
      }
    }
    return this.result;
  }
  generateChunk(world,ChunkManager.CURRENT_PLOT_CLEAR,random,cx,cz,biomes);
  if (ChunkManager.CURRENT_PLOT_CLEAR != null) {
    PlotLoc loc;
    for (    Entry<PlotLoc,HashMap<Short,Short>> entry : ChunkManager.GENERATE_BLOCKS.entrySet()) {
      for (      Entry<Short,Short> entry2 : entry.getValue().entrySet()) {
        loc=entry.getKey();
        setBlock(loc.x - X,entry2.getKey(),loc.z - Z,entry2.getValue());
      }
    }
  }
  return result;
}
Program: 58038
Project: 58038
Buggy source:
private void setBlock(final int x,final int y,final int z,final short blkid){
  if (result[y >> 4] == null) {
    result[y >> 4]=new short[4096];
  }
  result[y >> 4][((y & 0xF) << 8) | (z << 4) | x]=blkid;
}

Fixed version (ground truth):
public void setBlock(final int x,final int y,final int z,final short[] blkid){
  if (blkid.length == 1) {
    setBlock(x,y,z,blkid[0]);
  }
  short id=blkid[random.random(blkid.length)];
  if (result[y >> 4] == null) {
    result[y >> 4]=new short[4096];
  }
  result[y >> 4][((y & 0xF) << 8) | (z << 4) | x]=id;
}
Program: 58039
Project: 58039
Buggy source:
/** 
 * <b>random</b> is a optimized random number generator.<br>  - Change the state to have the same chunk random each time it generates<br> <b>requiredRegion</b> If a plot is being regenerated, you are only required to generate content in this area<br> - use the contains(RegionWrapper, x, z) method to check if the region contains a location<br> - You can ignore this if you do not want to further optimize your generator<br> - will be null if no restrictions are set<br> <b>result</b> is the standard 2D block data array used for generation<br> <b>biomes</b> is the standard BiomeGrid used for generation
 * @param world
 * @param random
 * @param cx
 * @param cz
 * @param requiredRegion
 * @param biomes
 * @param result
 * @return
 */
public abstract short[][] generateChunk(final World world,RegionWrapper requiredRegion,final PseudoRandom random,final int cx,final int cz,final BiomeGrid biomes,final short[][] result);

Fixed version (ground truth):
/** 
 * <b>random</b> is a optimized random number generator.<br>  - Change the state to have the same chunk random each time it generates<br> <b>requiredRegion</b> If a plot is being regenerated, you are only required to generate content in this area<br> - use the contains(RegionWrapper, x, z) method to check if the region contains a location<br> - You can ignore this if you do not want to further optimize your generator<br> - will be null if no restrictions are set<br> <b>result</b> is the standard 2D block data array used for generation<br> <b>biomes</b> is the standard BiomeGrid used for generation
 * @param world
 * @param random
 * @param cx
 * @param cz
 * @param requiredRegion
 * @param biomes
 * @param result
 * @return
 */
public abstract void generateChunk(final World world,RegionWrapper requiredRegion,final PseudoRandom random,final int cx,final int cz,final BiomeGrid biomes);
Program: 58040
Project: 58040
Buggy source:
/** 
 * Set the data at a location. (x, y, z) must be between [0,15], [0,255], [0,15]
 * @param x
 * @param y
 * @param z
 * @param data
 */
public void setBlock(int x,int y,int z,byte data){
  world.getBlockAt(X + x,y,Z + z).setTypeId(data);
}

Fixed version (ground truth):
/** 
 * Set the data at a location. (x, y, z) must be between [0,15], [0,255], [0,15]
 * @param x
 * @param y
 * @param z
 * @param data
 */
public void setBlock(int x,int y,int z,byte data){
  world.getBlockAt(X + x,y,Z + z).setData(data);
}
Program: 58041
Project: 58041
Buggy source:
@Override public void movePlot(Plot original,final Plot newPlot){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      try {
        final int id=getId(original.world,original.id);
        final PreparedStatement stmt=SQLManager.this.connection.prepareStatement("String_Node_Str" + SQLManager.this.prefix + "String_Node_Str");
        stmt.setInt(1,newPlot.id.x);
        stmt.setInt(2,newPlot.id.y);
        stmt.setInt(3,id);
        stmt.executeUpdate();
        stmt.close();
      }
 catch (      final Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void movePlot(final Plot original,final Plot newPlot){
  TaskManager.runTaskAsync(new Runnable(){
    @Override public void run(){
      try {
        final int id=getId(original.world,original.id);
        final PreparedStatement stmt=SQLManager.this.connection.prepareStatement("String_Node_Str" + SQLManager.this.prefix + "String_Node_Str");
        stmt.setInt(1,newPlot.id.x);
        stmt.setInt(2,newPlot.id.y);
        stmt.setInt(3,id);
        stmt.executeUpdate();
        stmt.close();
      }
 catch (      final Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}