nus-yam/ex-repair huggingface dataset:
Program: 57909
Project: 57909
Buggy source:
@Test public void flagTest() throws Exception {
  Plot plot=new Plot(null,new PlotId(0,0));
  plot.owner=UUID.fromString("String_Node_Str");
  Optional<? extends Collection> flag=plot.getFlag(use);
  if (flag.isPresent()) {
    System.out.println(Flags.USE.valueToString(flag.get()));
    testBlock=new PlotBlock((short)1,(byte)0);
    flag.get().add(testBlock);
  }
  if (flag.isPresent()) {
    System.out.println(Flags.USE.valueToString(flag.get()));
  }
  Optional<HashSet<PlotBlock>> flag2=plot.getFlag(Flags.USE);
  if (flag2.isPresent()) {
    assertThat(flag2.get(),(Matcher<? super HashSet<PlotBlock>>)IsCollectionContaining.hasItem(testBlock));
  }
  if (flag.isPresent() && flag2.isPresent()) {
    assertEquals(flag.get(),flag2.get());
  }
}

Fixed version (ground truth):
@Test public void flagTest() throws Exception {
  Plot plot=new Plot(null,new PlotId(0,0));
  plot.owner=UUID.fromString("String_Node_Str");
  Optional<? extends Collection> flag=plot.getFlag(use);
  if (flag.isPresent()) {
    System.out.println(Flags.USE.valueToString(flag.get()));
    testBlock=new PlotBlock((short)1,(byte)0);
    flag.get().add(testBlock);
  }
  if (flag.isPresent()) {
    System.out.println(Flags.USE.valueToString(flag.get()));
  }
  Optional<HashSet<PlotBlock>> flag2=plot.getFlag(Flags.USE);
  if (flag2.isPresent()) {
  }
  if (flag.isPresent() && flag2.isPresent()) {
    assertEquals(flag.get(),flag2.get());
  }
}
Program: 57910
Project: 57910
Buggy source:
@Override public PlotPlayer wrapPlayer(Object player){
  if (player instanceof Player) {
    return BukkitUtil.getPlayer((Player)player);
  }
 else   if (player instanceof OfflinePlayer) {
    return BukkitUtil.getPlayer((OfflinePlayer)player);
  }
 else   if (player instanceof String) {
    return UUIDHandler.getPlayer((String)player);
  }
 else   if (player instanceof UUID) {
    return UUIDHandler.getPlayer((UUID)player);
  }
  return null;
}

Fixed version (ground truth):
@Override public PlotPlayer wrapPlayer(Object player){
  if (player instanceof Player) {
    return BukkitUtil.getPlayer((Player)player);
  }
  if (player instanceof OfflinePlayer) {
    return BukkitUtil.getPlayer((OfflinePlayer)player);
  }
  if (player instanceof String) {
    return UUIDHandler.getPlayer((String)player);
  }
  if (player instanceof UUID) {
    return UUIDHandler.getPlayer((UUID)player);
  }
  return null;
}
Program: 57911
Project: 57911
Buggy source:
@Override public TextualComponent clone() throws CloneNotSupportedException {
  return new ComplexTextTypeComponent(getKey(),getValue());
}

Fixed version (ground truth):
@Override public TextualComponent clone(){
  return new ComplexTextTypeComponent(getKey(),getValue());
}
Program: 57913
Project: 57913
Buggy source:
@EventHandler(ignoreCancelled=true,priority=EventPriority.HIGHEST) public void onEntityFall(EntityChangeBlockEvent event){
  if (event.getEntityType() != EntityType.FALLING_BLOCK) {
    return;
  }
  Block block=event.getBlock();
  World world=block.getWorld();
  String worldName=world.getName();
  if (!PS.get().hasPlotArea(worldName)) {
    return;
  }
  Location location=BukkitUtil.getLocation(block.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlotAbs(location);
  if (plot == null) {
    event.setCancelled(true);
    return;
  }
  if (plot.getFlag(Flags.DISABLE_PHYSICS).or(false)) {
    event.setCancelled(true);
    return;
  }
  if (event.getTo().hasGravity()) {
    Entity entity=event.getEntity();
    List<MetadataValue> meta=entity.getMetadata("String_Node_Str");
    if (meta.isEmpty()) {
      return;
    }
    Plot origin=(Plot)meta.get(0).value();
    if (origin != null && !origin.equals(plot)) {
      event.setCancelled(true);
      entity.remove();
    }
  }
 else   if (event.getTo() == Material.AIR) {
    event.getEntity().setMetadata("String_Node_Str",new FixedMetadataValue((Plugin)PS.get().IMP,plot));
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true,priority=EventPriority.HIGHEST) public void onEntityFall(EntityChangeBlockEvent event){
  if (event.getEntityType() != EntityType.FALLING_BLOCK) {
    return;
  }
  Block block=event.getBlock();
  World world=block.getWorld();
  String worldName=world.getName();
  if (!PS.get().hasPlotArea(worldName)) {
    return;
  }
  Location location=BukkitUtil.getLocation(block.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlotAbs(location);
  if (plot == null || plot.getFlag(Flags.DISABLE_PHYSICS).or(false)) {
    event.setCancelled(true);
    return;
  }
  if (event.getTo().hasGravity()) {
    Entity entity=event.getEntity();
    List<MetadataValue> meta=entity.getMetadata("String_Node_Str");
    if (meta.isEmpty()) {
      return;
    }
    Plot origin=(Plot)meta.get(0).value();
    if (origin != null && !origin.equals(plot)) {
      event.setCancelled(true);
      entity.remove();
    }
  }
 else   if (event.getTo() == Material.AIR) {
    event.getEntity().setMetadata("String_Node_Str",new FixedMetadataValue((Plugin)PS.get().IMP,plot));
  }
}
Program: 57914
Project: 57914
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent e){
  Entity damager=e.getDamager();
  Location l=BukkitUtil.getLocation(damager);
  if (!PS.get().hasPlotArea(l.getWorld())) {
    return;
  }
  Entity victim=e.getEntity();
  if (!entityDamage(damager,victim)) {
    e.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event){
  Entity damager=event.getDamager();
  Location l=BukkitUtil.getLocation(damager);
  if (!PS.get().hasPlotArea(l.getWorld())) {
    return;
  }
  Entity victim=event.getEntity();
  if (!entityDamage(damager,victim)) {
    event.setCancelled(true);
  }
}
Program: 57915
Project: 57915
Buggy source:
@EventHandler public boolean onProjectileHit(ProjectileHitEvent event){
  Projectile entity=event.getEntity();
  Location loc=BukkitUtil.getLocation(entity);
  if (!PS.get().hasPlotArea(loc.getWorld())) {
    return true;
  }
  PlotArea area=loc.getPlotArea();
  if (area == null) {
    return true;
  }
  Plot plot=area.getPlotAbs(loc);
  ProjectileSource shooter=entity.getShooter();
  if (shooter instanceof Player) {
    PlotPlayer pp=BukkitUtil.getPlayer((Player)shooter);
    if (plot == null) {
      if (!Permissions.hasPermission(pp,C.PERMISSION_PROJECTILE_UNOWNED)) {
        entity.remove();
        return false;
      }
      return true;
    }
    if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp,C.PERMISSION_PROJECTILE_OTHER)) {
      return true;
    }
    entity.remove();
    return false;
  }
 else   if (!(shooter instanceof Entity) && shooter != null) {
    if (plot == null) {
      entity.remove();
      return false;
    }
    Location sLoc=BukkitUtil.getLocation(((BlockProjectileSource)shooter).getBlock().getLocation());
    if (!area.contains(sLoc.getX(),sLoc.getZ())) {
      entity.remove();
      return false;
    }
    Plot sPlot=area.getOwnedPlotAbs(sLoc);
    if (sPlot == null || !PlotHandler.sameOwners(plot,sPlot)) {
      entity.remove();
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@EventHandler public boolean onProjectileHit(ProjectileHitEvent event){
  Projectile entity=event.getEntity();
  Location loc=BukkitUtil.getLocation(entity);
  if (!PS.get().hasPlotArea(loc.getWorld())) {
    return true;
  }
  PlotArea area=loc.getPlotArea();
  if (area == null) {
    return true;
  }
  Plot plot=area.getPlotAbs(loc);
  ProjectileSource shooter=entity.getShooter();
  if (shooter instanceof Player) {
    PlotPlayer pp=BukkitUtil.getPlayer((Player)shooter);
    if (plot == null) {
      if (!Permissions.hasPermission(pp,C.PERMISSION_PROJECTILE_UNOWNED)) {
        entity.remove();
        return false;
      }
      return true;
    }
    if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp,C.PERMISSION_PROJECTILE_OTHER)) {
      return true;
    }
    entity.remove();
    return false;
  }
  if (!(shooter instanceof Entity) && shooter != null) {
    if (plot == null) {
      entity.remove();
      return false;
    }
    Location sLoc=BukkitUtil.getLocation(((BlockProjectileSource)shooter).getBlock().getLocation());
    if (!area.contains(sLoc.getX(),sLoc.getZ())) {
      entity.remove();
      return false;
    }
    Plot sPlot=area.getOwnedPlotAbs(sLoc);
    if (sPlot == null || !PlotHandler.sameOwners(plot,sPlot)) {
      entity.remove();
      return false;
    }
  }
  return true;
}
Program: 57916
Project: 57916
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockSpread(BlockSpreadEvent event){
  Block block=event.getBlock();
  Location location=BukkitUtil.getLocation(block.getLocation());
  if (location.isPlotRoad()) {
    event.setCancelled(true);
    return;
  }
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(location);
switch (block.getType()) {
case GRASS:
    if (plot.getFlag(Flags.GRASS_GROW).isPresent() && plot.getFlag(Flags.GRASS_GROW).get()) {
      event.setCancelled(true);
    }
  break;
case MYCEL:
if (plot.getFlag(Flags.MYCEL_GROW).isPresent() && plot.getFlag(Flags.MYCEL_GROW).get()) {
  event.setCancelled(true);
}
break;
case VINE:
if (plot.getFlag(Flags.VINE_GROW).isPresent() && plot.getFlag(Flags.VINE_GROW).get()) {
event.setCancelled(true);
}
break;
}
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockSpread(BlockSpreadEvent event){
  Block block=event.getBlock();
  Location location=BukkitUtil.getLocation(block.getLocation());
  if (location.isPlotRoad()) {
    event.setCancelled(true);
    return;
  }
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(location);
  Optional<Boolean> flag;
switch (block.getType()) {
case GRASS:
    flag=plot.getFlag(Flags.GRASS_GROW);
  if (flag.isPresent() && flag.get()) {
    event.setCancelled(true);
  }
break;
case MYCEL:
flag=plot.getFlag(Flags.MYCEL_GROW);
if (flag.isPresent() && flag.get()) {
event.setCancelled(true);
}
break;
case VINE:
flag=plot.getFlag(Flags.VINE_GROW);
if (flag.isPresent() && flag.get()) {
event.setCancelled(true);
}
break;
}
}
Program: 57919
Project: 57919
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockDamage(BlockDamageEvent event){
  Player player=event.getPlayer();
  Location location=BukkitUtil.getLocation(event.getBlock().getLocation());
  if (player == null) {
    if (location.isPlotRoad()) {
      event.setCancelled(true);
      return;
    }
  }
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getPlotAbs(location);
  if (plot != null) {
    if (location.getY() == 0) {
      event.setCancelled(true);
      return;
    }
    if (!plot.hasOwner()) {
      PlotPlayer pp=BukkitUtil.getPlayer(player);
      if (Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
        return;
      }
      event.setCancelled(true);
      return;
    }
    PlotPlayer pp=BukkitUtil.getPlayer(player);
    if (!plot.isAdded(pp.getUUID())) {
      Optional<HashSet<PlotBlock>> destroy=plot.getFlag(Flags.BREAK);
      Block block=event.getBlock();
      if (destroy.isPresent() && destroy.get().contains(new PlotBlock((short)block.getTypeId(),block.getData()))) {
        return;
      }
      if (Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_OTHER)) {
        return;
      }
      event.setCancelled(true);
      return;
    }
    return;
  }
  PlotPlayer pp=BukkitUtil.getPlayer(player);
  if (Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_ROAD)) {
    return;
  }
  event.setCancelled(true);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockDamage(BlockDamageEvent event){
  Player player=event.getPlayer();
  Location location=BukkitUtil.getLocation(event.getBlock().getLocation());
  if (player == null) {
    if (location.isPlotRoad()) {
      event.setCancelled(true);
      return;
    }
  }
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getPlotAbs(location);
  if (plot != null) {
    if (location.getY() == 0) {
      event.setCancelled(true);
      return;
    }
    if (!plot.hasOwner()) {
      PlotPlayer pp=BukkitUtil.getPlayer(player);
      if (Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
        return;
      }
      event.setCancelled(true);
      return;
    }
    PlotPlayer pp=BukkitUtil.getPlayer(player);
    if (!plot.isAdded(pp.getUUID())) {
      Optional<HashSet<PlotBlock>> destroy=plot.getFlag(Flags.BREAK);
      Block block=event.getBlock();
      if (destroy.isPresent() && destroy.get().contains(new PlotBlock((short)block.getTypeId(),block.getData())) || Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_OTHER)) {
        return;
      }
      event.setCancelled(true);
      return;
    }
    return;
  }
  PlotPlayer pp=BukkitUtil.getPlayer(player);
  if (Permissions.hasPermission(pp,C.PERMISSION_ADMIN_DESTROY_ROAD)) {
    return;
  }
  event.setCancelled(true);
}
Program: 57922
Project: 57922
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onFade(BlockFadeEvent e){
  Block b=e.getBlock();
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(location);
  if (plot == null) {
    e.setCancelled(true);
    return;
  }
switch (b.getType()) {
case ICE:
    Optional<Boolean> ice_melt=plot.getFlag(Flags.ICE_MELT);
  if (ice_melt.isPresent()) {
    if (!ice_melt.get()) {
      e.setCancelled(true);
    }
  }
break;
case SNOW:
Optional<Boolean> snow_melt=plot.getFlag(Flags.SNOW_MELT);
if (snow_melt.isPresent()) {
if (!snow_melt.get()) {
e.setCancelled(true);
}
}
break;
case SOIL:
Optional<Boolean> soil_dry=plot.getFlag(Flags.SOIL_DRY);
if (soil_dry.isPresent()) {
if (!soil_dry.get()) {
e.setCancelled(true);
}
}
break;
}
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onFade(BlockFadeEvent event){
  Block b=event.getBlock();
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(location);
  if (plot == null) {
    event.setCancelled(true);
    return;
  }
switch (b.getType()) {
case ICE:
    Optional<Boolean> ice_melt=plot.getFlag(Flags.ICE_MELT);
  if (ice_melt.isPresent()) {
    if (!ice_melt.get()) {
      event.setCancelled(true);
    }
  }
break;
case SNOW:
Optional<Boolean> snow_melt=plot.getFlag(Flags.SNOW_MELT);
if (snow_melt.isPresent()) {
if (!snow_melt.get()) {
event.setCancelled(true);
}
}
break;
case SOIL:
Optional<Boolean> soil_dry=plot.getFlag(Flags.SOIL_DRY);
if (soil_dry.isPresent()) {
if (!soil_dry.get()) {
event.setCancelled(true);
}
}
break;
}
}
Program: 57923
Project: 57923
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onChange(BlockFromToEvent event){
  Block from=event.getBlock();
  Block to=event.getToBlock();
  Location tLocation=BukkitUtil.getLocation(to.getLocation());
  PlotArea area=tLocation.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(tLocation);
  Location fLocation=BukkitUtil.getLocation(from.getLocation());
  if (plot != null) {
    if (plot.getFlag(Flags.DISABLE_PHYSICS).or(false)) {
      event.setCancelled(true);
    }
 else     if (!area.contains(fLocation.getX(),fLocation.getZ()) || !Objects.equals(plot,area.getOwnedPlot(fLocation))) {
      event.setCancelled(true);
    }
  }
 else   if (!area.contains(fLocation.getX(),fLocation.getZ()) || !Objects.equals(plot,area.getOwnedPlot(fLocation))) {
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onChange(BlockFromToEvent event){
  Block from=event.getBlock();
  Block to=event.getToBlock();
  Location tLocation=BukkitUtil.getLocation(to.getLocation());
  PlotArea area=tLocation.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=area.getOwnedPlot(tLocation);
  Location fLocation=BukkitUtil.getLocation(from.getLocation());
  if (plot != null) {
    if (plot.getFlag(Flags.DISABLE_PHYSICS).or(false) || !area.contains(fLocation.getX(),fLocation.getZ()) || !Objects.equals(plot,area.getOwnedPlot(fLocation))) {
      event.setCancelled(true);
    }
  }
 else   if (!area.contains(fLocation.getX(),fLocation.getZ()) || !Objects.equals(plot,area.getOwnedPlot(fLocation))) {
    event.setCancelled(true);
  }
}
Program: 57924
Project: 57924
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onHangingPlace(HangingPlaceEvent event){
  Block b=event.getBlock().getRelative(event.getBlockFace());
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Player p=event.getPlayer();
  PlotPlayer pp=BukkitUtil.getPlayer(p);
  Plot plot=area.getPlotAbs(location);
  if (plot == null) {
    if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_ROAD)) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_ROAD);
      event.setCancelled(true);
    }
  }
 else {
    if (!plot.hasOwner()) {
      if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_UNOWNED)) {
        MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_UNOWNED);
        event.setCancelled(true);
      }
      return;
    }
 else     if (!plot.isAdded(pp.getUUID())) {
      if (!plot.getFlag(Flags.HANGING_PLACE).or(false)) {
        if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_OTHER)) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_OTHER);
          event.setCancelled(true);
        }
        return;
      }
    }
    if (checkEntity(event.getEntity(),plot)) {
      event.setCancelled(true);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onHangingPlace(HangingPlaceEvent event){
  Block b=event.getBlock().getRelative(event.getBlockFace());
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Player p=event.getPlayer();
  PlotPlayer pp=BukkitUtil.getPlayer(p);
  Plot plot=area.getPlotAbs(location);
  if (plot == null) {
    if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_ROAD)) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_ROAD);
      event.setCancelled(true);
    }
  }
 else {
    if (!plot.hasOwner()) {
      if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_UNOWNED)) {
        MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_UNOWNED);
        event.setCancelled(true);
      }
      return;
    }
    if (!plot.isAdded(pp.getUUID())) {
      if (!plot.getFlag(Flags.HANGING_PLACE).or(false)) {
        if (!Permissions.hasPermission(pp,C.PERMISSION_ADMIN_BUILD_OTHER)) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,C.PERMISSION_ADMIN_BUILD_OTHER);
          event.setCancelled(true);
        }
        return;
      }
    }
    if (checkEntity(event.getEntity(),plot)) {
      event.setCancelled(true);
    }
  }
}
Program: 57926
Project: 57926
Buggy source:
@EventHandler public void onRedstoneEvent(BlockRedstoneEvent event){
  Block block=event.getBlock();
switch (block.getType()) {
case REDSTONE_LAMP_OFF:
case REDSTONE_WIRE:
case REDSTONE_LAMP_ON:
case PISTON_BASE:
case PISTON_STICKY_BASE:
case IRON_DOOR_BLOCK:
case LEVER:
case WOODEN_DOOR:
case FENCE_GATE:
case WOOD_BUTTON:
case STONE_BUTTON:
case IRON_PLATE:
case WOOD_PLATE:
case STONE_PLATE:
case GOLD_PLATE:
case SPRUCE_DOOR:
case BIRCH_DOOR:
case JUNGLE_DOOR:
case ACACIA_DOOR:
case DARK_OAK_DOOR:
case IRON_TRAPDOOR:
case SPRUCE_FENCE_GATE:
case BIRCH_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case ACACIA_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case POWERED_RAIL:
    return;
default :
  Location loc=BukkitUtil.getLocation(block.getLocation());
PlotArea area=loc.getPlotArea();
if (area == null) {
return;
}
Plot plot=area.getOwnedPlotAbs(loc);
if (plot == null) {
return;
}
if (plot.getFlag(Flags.REDSTONE).isPresent()) {
if (plot.getFlag(Flags.REDSTONE).get()) {
return;
}
 else {
event.setNewCurrent(0);
return;
}
}
if (Settings.REDSTONE_DISABLER) {
if (UUIDHandler.getPlayer(plot.owner) == null) {
boolean disable=true;
for (UUID trusted : plot.getTrusted()) {
if (UUIDHandler.getPlayer(trusted) != null) {
disable=false;
break;
}
}
if (disable) {
event.setNewCurrent(0);
return;
}
}
}
if (Settings.REDSTONE_DISABLER_UNOCCUPIED) {
for (Entry<String,PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
if (plot.equals(entry.getValue().getCurrentPlot())) {
return;
}
}
event.setNewCurrent(0);
}
}
}

Fixed version (ground truth):
@EventHandler public void onRedstoneEvent(BlockRedstoneEvent event){
  Block block=event.getBlock();
switch (block.getType()) {
case REDSTONE_LAMP_OFF:
case REDSTONE_WIRE:
case REDSTONE_LAMP_ON:
case PISTON_BASE:
case PISTON_STICKY_BASE:
case IRON_DOOR_BLOCK:
case LEVER:
case WOODEN_DOOR:
case FENCE_GATE:
case WOOD_BUTTON:
case STONE_BUTTON:
case IRON_PLATE:
case WOOD_PLATE:
case STONE_PLATE:
case GOLD_PLATE:
case SPRUCE_DOOR:
case BIRCH_DOOR:
case JUNGLE_DOOR:
case ACACIA_DOOR:
case DARK_OAK_DOOR:
case IRON_TRAPDOOR:
case SPRUCE_FENCE_GATE:
case BIRCH_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case ACACIA_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case POWERED_RAIL:
    return;
default :
  Location loc=BukkitUtil.getLocation(block.getLocation());
PlotArea area=loc.getPlotArea();
if (area == null) {
return;
}
Plot plot=area.getOwnedPlotAbs(loc);
if (plot == null) {
return;
}
Optional<Boolean> flag=plot.getFlag(Flags.REDSTONE);
if (flag.isPresent()) {
if (flag.get()) {
return;
}
 else {
event.setNewCurrent(0);
return;
}
}
if (Settings.REDSTONE_DISABLER) {
if (UUIDHandler.getPlayer(plot.owner) == null) {
boolean disable=true;
for (UUID trusted : plot.getTrusted()) {
if (UUIDHandler.getPlayer(trusted) != null) {
disable=false;
break;
}
}
if (disable) {
event.setNewCurrent(0);
return;
}
}
}
if (Settings.REDSTONE_DISABLER_UNOCCUPIED) {
for (Entry<String,PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
if (plot.equals(entry.getValue().getCurrentPlot())) {
return;
}
}
event.setNewCurrent(0);
}
}
}
Program: 57930
Project: 57930
Buggy source:
@EventHandler(ignoreCancelled=true,priority=EventPriority.HIGHEST) public void onPhysicsEvent(BlockPhysicsEvent event){
switch (event.getChangedType()) {
case REDSTONE_COMPARATOR_OFF:
case REDSTONE_COMPARATOR_ON:
{
      Block block=event.getBlock();
      Location loc=BukkitUtil.getLocation(block.getLocation());
      PlotArea area=loc.getPlotArea();
      if (area == null) {
        return;
      }
      Plot plot=area.getOwnedPlotAbs(loc);
      if (plot == null) {
        return;
      }
      if (plot.getFlag(Flags.REDSTONE).isPresent() && !plot.getFlag(Flags.REDSTONE).get()) {
        event.setCancelled(true);
      }
      return;
    }
case DRAGON_EGG:
case ANVIL:
case SAND:
case GRAVEL:
  Block block=event.getBlock();
Location loc=BukkitUtil.getLocation(block.getLocation());
PlotArea area=loc.getPlotArea();
if (area == null) {
return;
}
Plot plot=area.getOwnedPlotAbs(loc);
if (plot != null && plot.getFlag(Flags.DISABLE_PHYSICS).or(false)) {
event.setCancelled(true);
return;
}
return;
default :
break;
}
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true,priority=EventPriority.HIGHEST) public void onPhysicsEvent(BlockPhysicsEvent event){
switch (event.getChangedType()) {
case REDSTONE_COMPARATOR_OFF:
case REDSTONE_COMPARATOR_ON:
{
      Block block=event.getBlock();
      Location loc=BukkitUtil.getLocation(block.getLocation());
      PlotArea area=loc.getPlotArea();
      if (area == null) {
        return;
      }
      Plot plot=area.getOwnedPlotAbs(loc);
      if (plot == null) {
        return;
      }
      Optional<Boolean> flag=plot.getFlag(Flags.REDSTONE);
      if (flag.isPresent() && !flag.get()) {
        event.setCancelled(true);
      }
      return;
    }
case DRAGON_EGG:
case ANVIL:
case SAND:
case GRAVEL:
  Block block=event.getBlock();
Location loc=BukkitUtil.getLocation(block.getLocation());
PlotArea area=loc.getPlotArea();
if (area == null) {
return;
}
Plot plot=area.getOwnedPlotAbs(loc);
if (plot != null && plot.getFlag(Flags.DISABLE_PHYSICS).or(false)) {
event.setCancelled(true);
return;
}
return;
default :
break;
}
}
Program: 57931
Project: 57931
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onVehicleDestroy(VehicleDestroyEvent e){
  Location l=BukkitUtil.getLocation(e.getVehicle());
  PlotArea area=l.getPlotArea();
  if (area == null) {
    return;
  }
  Entity d=e.getAttacker();
  if (d instanceof Player) {
    Player p=(Player)d;
    PlotPlayer pp=BukkitUtil.getPlayer(p);
    Plot plot=area.getPlotAbs(l);
    if (plot == null) {
      if (!Permissions.hasPermission(pp,"String_Node_Str")) {
        MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
        e.setCancelled(true);
      }
    }
 else {
      if (!plot.hasOwner()) {
        if (!Permissions.hasPermission(pp,"String_Node_Str")) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
          e.setCancelled(true);
          return;
        }
        return;
      }
      if (!plot.isAdded(pp.getUUID())) {
        if (plot.getFlag(Flags.VEHICLE_BREAK).or(false)) {
          return;
        }
        if (!Permissions.hasPermission(pp,"String_Node_Str")) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
          e.setCancelled(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onVehicleDestroy(VehicleDestroyEvent event){
  Location l=BukkitUtil.getLocation(event.getVehicle());
  PlotArea area=l.getPlotArea();
  if (area == null) {
    return;
  }
  Entity d=event.getAttacker();
  if (d instanceof Player) {
    Player p=(Player)d;
    PlotPlayer pp=BukkitUtil.getPlayer(p);
    Plot plot=area.getPlotAbs(l);
    if (plot == null) {
      if (!Permissions.hasPermission(pp,"String_Node_Str")) {
        MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
        event.setCancelled(true);
      }
    }
 else {
      if (!plot.hasOwner()) {
        if (!Permissions.hasPermission(pp,"String_Node_Str")) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
          event.setCancelled(true);
          return;
        }
        return;
      }
      if (!plot.isAdded(pp.getUUID())) {
        if (plot.getFlag(Flags.VEHICLE_BREAK).or(false)) {
          return;
        }
        if (!Permissions.hasPermission(pp,"String_Node_Str")) {
          MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
          event.setCancelled(true);
        }
      }
    }
  }
}
Program: 57933
Project: 57933
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockBurn(BlockBurnEvent e){
  Block b=e.getBlock();
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=location.getOwnedPlot();
  if (plot == null || !plot.getFlag(Flags.BLOCK_BURN).or(false)) {
    e.setCancelled(true);
    return;
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onBlockBurn(BlockBurnEvent event){
  Block b=event.getBlock();
  Location location=BukkitUtil.getLocation(b.getLocation());
  PlotArea area=location.getPlotArea();
  if (area == null) {
    return;
  }
  Plot plot=location.getOwnedPlot();
  if (plot == null || !plot.getFlag(Flags.BLOCK_BURN).or(false)) {
    event.setCancelled(true);
  }
}
Program: 57934
Project: 57934
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onPlayerEggThrow(PlayerEggThrowEvent e){
  Location l=BukkitUtil.getLocation(e.getEgg().getLocation());
  PlotArea area=l.getPlotArea();
  if (area == null) {
    return;
  }
  Player p=e.getPlayer();
  PlotPlayer pp=BukkitUtil.getPlayer(p);
  Plot plot=area.getPlot(l);
  if (plot == null) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      e.setHatching(false);
    }
  }
 else   if (!plot.hasOwner()) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      e.setHatching(false);
    }
  }
 else   if (!plot.isAdded(pp.getUUID())) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      e.setHatching(false);
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onPlayerEggThrow(PlayerEggThrowEvent event){
  Location l=BukkitUtil.getLocation(event.getEgg().getLocation());
  PlotArea area=l.getPlotArea();
  if (area == null) {
    return;
  }
  Player p=event.getPlayer();
  PlotPlayer pp=BukkitUtil.getPlayer(p);
  Plot plot=area.getPlot(l);
  if (plot == null) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      event.setHatching(false);
    }
  }
 else   if (!plot.hasOwner()) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      event.setHatching(false);
    }
  }
 else   if (!plot.isAdded(pp.getUUID())) {
    if (!Permissions.hasPermission(pp,"String_Node_Str")) {
      MainUtil.sendMessage(pp,C.NO_PERMISSION_EVENT,"String_Node_Str");
      event.setHatching(false);
    }
  }
}
Program: 57936
Project: 57936
Buggy source:
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onChat(AsyncPlayerChatEvent event){
  PlotPlayer plotPlayer=BukkitUtil.getPlayer(event.getPlayer());
  Location location=plotPlayer.getLocation();
  PlotArea area=location.getPlotArea();
  if (area == null || (!area.PLOT_CHAT && !plotPlayer.getAttribute("String_Node_Str"))) {
    return;
  }
  Plot plot=area.getPlot(location);
  if (plot == null) {
    return;
  }
  event.setCancelled(true);
  String message=event.getMessage();
  String format=C.PLOT_CHAT_FORMAT.s();
  String sender=event.getPlayer().getDisplayName();
  PlotId id=plot.getId();
  Set<Player> recipients=event.getRecipients();
  recipients.clear();
  for (  Entry<String,PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
    PlotPlayer pp=entry.getValue();
    if (pp.getAttribute("String_Node_Str")) {
      String spy=event.getFormat();
      spy=String.format(spy,sender,message);
      pp.sendMessage(spy);
    }
 else {
      Plot current=pp.getCurrentPlot();
      if (current != null && current.getBasePlot(false).equals(plot)) {
        recipients.add(((BukkitPlayer)pp).player);
      }
    }
  }
  String full=format.replaceAll("String_Node_Str",id.x + "String_Node_Str" + id.y).replaceAll("String_Node_Str",sender).replaceAll("String_Node_Str",message);
  full=ChatColor.translateAlternateColorCodes('&',full);
  for (  Player receiver : recipients) {
    receiver.sendMessage(full);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onChat(AsyncPlayerChatEvent event){
  PlotPlayer plotPlayer=BukkitUtil.getPlayer(event.getPlayer());
  Location location=plotPlayer.getLocation();
  PlotArea area=location.getPlotArea();
  if (area == null || (!area.PLOT_CHAT && !plotPlayer.getAttribute("String_Node_Str"))) {
    return;
  }
  Plot plot=area.getPlot(location);
  if (plot == null) {
    return;
  }
  event.setCancelled(true);
  String message=event.getMessage();
  String format=C.PLOT_CHAT_FORMAT.s();
  String sender=event.getPlayer().getDisplayName();
  PlotId id=plot.getId();
  Set<Player> recipients=event.getRecipients();
  recipients.clear();
  for (  Entry<String,PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
    PlotPlayer pp=entry.getValue();
    if (pp.getAttribute("String_Node_Str")) {
      String spy=event.getFormat();
      spy=String.format(spy,sender,message);
      pp.sendMessage(spy);
    }
 else {
      Plot current=pp.getCurrentPlot();
      if (current != null && current.getBasePlot(false).equals(plot)) {
        recipients.add(((BukkitPlayer)pp).player);
      }
    }
  }
  String full=format.replace("String_Node_Str",id.x + "String_Node_Str" + id.y).replace("String_Node_Str",sender).replace("String_Node_Str",message);
  full=ChatColor.translateAlternateColorCodes('&',full);
  for (  Player receiver : recipients) {
    receiver.sendMessage(full);
  }
}
Program: 57937
Project: 57937
Buggy source:
/** 
 * Remove a helper (use DBFunc as well)<br> Using the * uuid will remove all users
 * @param uuid
 */
public boolean removeTrusted(UUID uuid){
  if (uuid == DBFunc.everyone) {
    boolean result=false;
    for (    UUID other : getTrusted()) {
      result=result || rmvTrusted(other);
    }
    return result;
  }
  return rmvTrusted(uuid);
}

Fixed version (ground truth):
/** 
 * Remove a helper (use DBFunc as well)<br> Using the * uuid will remove all users
 * @param uuid
 */
public boolean removeTrusted(UUID uuid){
  if (uuid == DBFunc.everyone) {
    boolean result=false;
    for (    UUID other : new HashSet<>(getTrusted())) {
      result=result || rmvTrusted(other);
    }
    return result;
  }
  return rmvTrusted(uuid);
}
Program: 57938
Project: 57938
Buggy source:
/** 
 * Remove a denied player (use DBFunc as well)<br> Using the * uuid will remove all users
 * @param uuid
 */
public boolean removeDenied(UUID uuid){
  if (uuid == DBFunc.everyone) {
    boolean result=false;
    for (    UUID other : getDenied()) {
      result=result || rmvDenied(other);
    }
    return result;
  }
  return rmvDenied(uuid);
}

Fixed version (ground truth):
/** 
 * Remove a denied player (use DBFunc as well)<br> Using the * uuid will remove all users
 * @param uuid
 */
public boolean removeDenied(UUID uuid){
  if (uuid == DBFunc.everyone) {
    boolean result=false;
    for (    UUID other : new HashSet<>(getDenied())) {
      result=result || rmvDenied(other);
    }
    return result;
  }
  return rmvDenied(uuid);
}
Program: 57939
Project: 57939
Buggy source:
@Override public boolean onCommand(PlotPlayer plr,String[] args){
  try {
    Field fPlots=PS.class.getDeclaredField("String_Node_Str");
    fPlots.setAccessible(true);
    fPlots.set(null,DBFunc.getPlots());
  }
 catch (  Exception e) {
    PS.debug("String_Node_Str");
    e.printStackTrace();
    PS.debug("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(PlotPlayer plr,String[] args){
  PS.get().plots_tmp=DBFunc.getPlots();
  return true;
}
Program: 57942
Project: 57942
Buggy source:
public boolean update(final PlotPlayer sender,final URL url){
  try {
    final String name=FILE.getName();
    final File newJar=new File("String_Node_Str" + name);
    MainUtil.sendMessage(sender,"String_Node_Str" + url);
    final URLConnection con=url.openConnection();
    try (InputStream stream=con.getInputStream()){
      final File parent=newJar.getParentFile();
      if (!parent.exists()) {
        parent.mkdirs();
      }
      MainUtil.sendMessage(sender,"String_Node_Str" + newJar);
      if (newJar.delete()) {
        MainUtil.sendMessage(sender,"String_Node_Str");
        MainUtil.sendMessage(sender,"String_Node_Str");
        MainUtil.sendMessage(sender,"String_Node_Str");
      }
      Files.copy(stream,newJar.toPath());
    }
     MainUtil.sendMessage(sender,"String_Node_Str");
    return true;
  }
 catch (  IOException e) {
    MainUtil.sendMessage(sender,"String_Node_Str");
    MainUtil.sendMessage(sender,"String_Node_Str");
    log("String_Node_Str");
    e.printStackTrace();
    log("String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
public boolean update(final PlotPlayer sender,final URL url){
  try {
    final String name=FILE.getName();
    final File newJar=new File("String_Node_Str" + name);
    MainUtil.sendMessage(sender,"String_Node_Str" + url);
    final URLConnection con=url.openConnection();
    try (InputStream stream=con.getInputStream()){
      final File parent=newJar.getParentFile();
      if (!parent.exists()) {
        parent.mkdirs();
      }
      MainUtil.sendMessage(sender,"String_Node_Str" + newJar);
      if (!newJar.delete()) {
        MainUtil.sendMessage(sender,"String_Node_Str");
        MainUtil.sendMessage(sender,"String_Node_Str");
        MainUtil.sendMessage(sender,"String_Node_Str");
      }
      Files.copy(stream,newJar.toPath());
    }
     MainUtil.sendMessage(sender,"String_Node_Str");
    return true;
  }
 catch (  IOException e) {
    MainUtil.sendMessage(sender,"String_Node_Str");
    MainUtil.sendMessage(sender,"String_Node_Str");
    log("String_Node_Str");
    e.printStackTrace();
    log("String_Node_Str");
  }
  return false;
}
Program: 57943
Project: 57943
Buggy source:
/** 
 * Get the raw plot object
 * @return set of plot
 * @see #setAllPlotsRaw(LinkedHashMap) to set the raw plot object
 */
@Deprecated public Set<Plot> getPlotsRaw(){
  int size=0;
  for (  final Entry<String,ConcurrentHashMap<PlotId,Plot>> entry : plots.entrySet()) {
    size+=entry.getValue().size();
  }
  final Set<Plot> result=new HashSet<>(size);
  for (  final Entry<String,ConcurrentHashMap<PlotId,Plot>> entry : plots.entrySet()) {
    for (    Entry<PlotId,Plot> entry2 : entry.getValue().entrySet()) {
      result.add(entry2.getValue());
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Get the raw plot object
 * @return set of plot
 * @see #setAllPlotsRaw(ConcurrentHashMap) to set the raw plot object
 */
@Deprecated public Set<Plot> getPlotsRaw(){
  int size=0;
  for (  final Entry<String,ConcurrentHashMap<PlotId,Plot>> entry : plots.entrySet()) {
    size+=entry.getValue().size();
  }
  final Set<Plot> result=new HashSet<>(size);
  for (  final Entry<String,ConcurrentHashMap<PlotId,Plot>> entry : plots.entrySet()) {
    for (    Entry<PlotId,Plot> entry2 : entry.getValue().entrySet()) {
      result.add(entry2.getValue());
    }
  }
  return result;
}
Program: 57944
Project: 57944
Buggy source:
/** 
 * Get all plots for the world
 * @param world to get plots of
 * @return Plot[] - array of plot objects in world
 * @see PS#getPlots(String)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Plot[] getPlots(final World world){
  final Collection<Plot> plots=PS.get().getPlotsInWorld(world.getName());
  return plots.toArray(new Plot[plots.size()]);
}

Fixed version (ground truth):
/** 
 * Get all plots for the world
 * @param world to get plots of
 * @return Plot[] - array of plot objects in world
 * @see PS#getPlots(String)
 * @see Plot
 */
public Plot[] getPlots(final World world){
  final Collection<Plot> plots=PS.get().getPlotsInWorld(world.getName());
  return plots.toArray(new Plot[plots.size()]);
}
Program: 57945
Project: 57945
Buggy source:
/** 
 * Get the PlotPlayer for an offline player<br> Note that this will work if the player is offline, however not all functionality will work
 * @see PlotPlayer.wrap(OfflinePlayer op)
 * @param player
 * @return
 */
public PlotPlayer wrapPlayer(final OfflinePlayer player){
  return PlotPlayer.wrap(player);
}

Fixed version (ground truth):
/** 
 * Get the PlotPlayer for an offline player<br> Note that this will work if the player is offline, however not all functionality will work
 * @see PlotPlayer#wrap(Object)
 * @param player
 * @return
 */
public PlotPlayer wrapPlayer(final OfflinePlayer player){
  return PlotPlayer.wrap(player);
}
Program: 57946
Project: 57946
Buggy source:
/** 
 * Do not use this. Instead use MainUtil.[method] in your code. - Basic plot management stuff
 * @return MainUtil
 * @see com.intellectualcrafters.plot.util.MainUtil
 */
@Deprecated public MainUtil getMainUtil(){
  return new MainUtil();
}

Fixed version (ground truth):
/** 
 * Do not use this. Instead use MainUtil.[method] in your code. - Basic plot management stuff
 * @return MainUtil
 * @see MainUtil
 */
@Deprecated public MainUtil getMainUtil(){
  return new MainUtil();
}
Program: 57947
Project: 57947
Buggy source:
/** 
 * Get a plot based on the player location
 * @param player Get the current plot for the player location
 * @return plot if found, otherwise it creates a temporary plot
 * @see #getPlot(org.bukkit.Location)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Plot getPlot(final Player player){
  return this.getPlot(player.getLocation());
}

Fixed version (ground truth):
/** 
 * Get a plot based on the player location
 * @param player Get the current plot for the player location
 * @return plot if found, otherwise it creates a temporary plot
 * @see #getPlot(org.bukkit.Location)
 * @see Plot
 */
public Plot getPlot(final Player player){
  return this.getPlot(player.getLocation());
}
Program: 57948
Project: 57948
Buggy source:
/** 
 * @param plugin Plugin used to access this method
 * @throws com.intellectualcrafters.plot.util.PlotSquaredException if the program fails to fetch the PlotSquaredinstance
 * @see com.intellectualcrafters.plot.PS
 * @deprecated Use this class if you just want to do a few simple things.<br>- It will remain stable for future versions of the plugin - The PlotPlayer and Plot class should be considered relatively safe - For more advanced/intensive tasks you should consider using other classes
 */
@Deprecated public PlotAPI(){
}

Fixed version (ground truth):
/** 
 * @see PS
 * @deprecated Use this class if you just want to do a few simple things.<br>- It will remain stable for future versions of the plugin - The PlotPlayer and Plot class should be considered relatively safe - For more advanced/intensive tasks you should consider using other classes
 */
@Deprecated public PlotAPI(){
}
Program: 57949
Project: 57949
Buggy source:
/** 
 * Get if plot world
 * @param world (to check if plot world)
 * @return boolean (if plot world or not)
 * @see com.intellectualcrafters.plot.PS#isPlotWorld(String)
 */
public boolean isPlotWorld(final World world){
  return PS.get().isPlotWorld(world.getName());
}

Fixed version (ground truth):
/** 
 * Get if plot world
 * @param world (to check if plot world)
 * @return boolean (if plot world or not)
 * @see PS#isPlotWorld(String)
 */
public boolean isPlotWorld(final World world){
  return PS.get().isPlotWorld(world.getName());
}
Program: 57950
Project: 57950
Buggy source:
/** 
 * Get home location
 * @param p Plot that you want to get the location for
 * @return plot bottom location
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotHome(String,com.intellectualcrafters.plot.object.Plot)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Location getHomeLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotHome(p.world,p.id));
}

Fixed version (ground truth):
/** 
 * Get home location
 * @param p Plot that you want to get the location for
 * @return plot bottom location
 * @see MainUtil#getPlotHome(String,PlotId)
 * @see Plot
 */
public Location getHomeLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotHome(p.world,p.id));
}
Program: 57951
Project: 57951
Buggy source:
/** 
 * Get Top Location (max, max, max)
 * @param p Plot that you want to get the location for
 * @return plot top location
 * @see MainUtil#getPlotTopLoc(String,com.intellectualcrafters.plot.object.PlotId)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Location getTopLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotTopLocAbs(p.world,p.id));
}

Fixed version (ground truth):
/** 
 * Get Top Location (max, max, max)
 * @param p Plot that you want to get the location for
 * @return plot top location
 * @see MainUtil#getPlotTopLocAbs(String,PlotId)
 * @see Plot
 */
public Location getTopLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotTopLocAbs(p.world,p.id));
}
Program: 57952
Project: 57952
Buggy source:
/** 
 * Get the player plot count
 * @param world  Specify the world we want to select the plots from
 * @param player Player, for whom we're getting the plot count
 * @return the number of plots the player has
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlayerPlotCount(String,PlotPlayer)
 */
public int getPlayerPlotCount(final World world,final Player player){
  return MainUtil.getPlayerPlotCount(world.getName(),BukkitUtil.getPlayer(player));
}

Fixed version (ground truth):
/** 
 * Get the player plot count
 * @param world  Specify the world we want to select the plots from
 * @param player Player, for whom we're getting the plot count
 * @return the number of plots the player has
 * @see MainUtil#getPlayerPlotCount(String,PlotPlayer)
 */
public int getPlayerPlotCount(final World world,final Player player){
  return MainUtil.getPlayerPlotCount(world.getName(),BukkitUtil.getPlayer(player));
}
Program: 57953
Project: 57953
Buggy source:
/** 
 * Get Bottom Location (min, min, min)
 * @param p Plot that you want to get the location for
 * @return plot bottom location
 * @see com.intellectualcrafters.plot.util.MainUtil#getPlotBottomLoc(String,com.intellectualcrafters.plot.object.PlotId)
 * @see com.intellectualcrafters.plot.object.Plot
 */
public Location getBottomLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotBottomLocAbs(p.world,p.id).subtract(1,0,1));
}

Fixed version (ground truth):
/** 
 * Get Bottom Location (min, min, min)
 * @param p Plot that you want to get the location for
 * @return plot bottom location
 * @see MainUtil#getPlotBottomLocAbs(String,PlotId)
 * @see Plot
 */
public Location getBottomLocation(final Plot p){
  return BukkitUtil.getLocation(MainUtil.getPlotBottomLocAbs(p.world,p.id).subtract(1,0,1));
}
Program: 57954
Project: 57954
Buggy source:
/** 
 * Get all plot worlds
 * @return World[] - array of plot worlds
 * @see com.intellectualcrafters.plot.PS#getPlotWorlds()
 */
public String[] getPlotWorlds(){
  final Set<String> worlds=PS.get().getPlotWorlds();
  return worlds.toArray(new String[worlds.size()]);
}

Fixed version (ground truth):
/** 
 * Get all plot worlds
 * @return World[] - array of plot worlds
 * @see PS#getPlotWorlds()
 */
public String[] getPlotWorlds(){
  final Set<String> worlds=PS.get().getPlotWorlds();
  return worlds.toArray(new String[worlds.size()]);
}
Program: 57955
Project: 57955
Buggy source:
/** 
 * Send a message to a player. - Supports color codes
 * @param player Player that will receive the message
 * @param string The message
 * @see com.intellectualcrafters.plot.util.MainUtil#sendMessage(PlotPlayer,String)
 */
public void sendMessage(final Player player,final String string){
  MainUtil.sendMessage(BukkitUtil.getPlayer(player),string);
}

Fixed version (ground truth):
/** 
 * Send a message to a player. - Supports color codes
 * @param player Player that will receive the message
 * @param string The message
 * @see MainUtil#sendMessage(PlotPlayer,String)
 */
public void sendMessage(final Player player,final String string){
  MainUtil.sendMessage(BukkitUtil.getPlayer(player),string);
}
Program: 57956
Project: 57956
Buggy source:
/** 
 * Add a plot world
 * @param world     World Name
 * @param plotWorld Plot World Object
 * @param manager   World Manager
 * @see com.intellectualcrafters.plot.PS#addPlotWorld(String,com.intellectualcrafters.plot.object.PlotWorld,com.intellectualcrafters.plot.object.PlotManager)
 */
public void addPlotWorld(final String world,final PlotWorld plotWorld,final PlotManager manager){
  PS.get().addPlotWorld(world,plotWorld,manager);
}

Fixed version (ground truth):
/** 
 * Add a plot world
 * @param world     World Name
 * @param plotWorld Plot World Object
 * @param manager   World Manager
 * @see PS#addPlotWorld(String,com.intellectualcrafters.plot.object.PlotWorld,com.intellectualcrafters.plot.object.PlotManager)
 */
public void addPlotWorld(final String world,final PlotWorld plotWorld,final PlotManager manager){
  PS.get().addPlotWorld(world,plotWorld,manager);
}