nus-yam/ex-repair huggingface dataset:
Program: 178726
Project: 178726
Buggy source:
@EventHandler() public void onEntityExplode(EntityExplodeEvent event){
  if (event.isCancelled())   return;
  Region region=plugin.regionManager.getRegion(new V10Location(event.getLocation()));
  for (  Block block : event.blockList().toArray(new Block[0])) {
    Location loc=block.getLocation();
    if (block.getType() == Material.WOOL) {
      Portal portal=plugin.portalManager.borderBlocks.get(loc);
      if (portal == null)       portal=plugin.portalManager.insideBlocks.get(loc);
      if (portal == null)       portal=plugin.portalManager.behindBlocks.get(loc);
      if (portal != null) {
        portal.delete();
        if (region.getBoolean(RegionSetting.PREVENT_TNT_NEAR_PORTALS))         event.setCancelled(true);
        return;
      }
    }
    if (block.getType() == Material.SUGAR_CANE_BLOCK || plugin.blockUtil.compareBlockToString(block,region.getString(RegionSetting.GRILL_MATERIAL))) {
      Grill grill=plugin.grillManager.insideBlocks.get(loc);
      if (grill == null)       grill=plugin.grillManager.borderBlocks.get(loc);
      if (grill != null) {
        event.setCancelled(true);
        return;
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onEntityExplode(EntityExplodeEvent event){
  Region region=plugin.regionManager.getRegion(new V10Location(event.getLocation()));
  Iterator<Block> iter=event.blockList().iterator();
  Block block;
  V10Location loc;
  Portal portal;
  while (iter.hasNext()) {
    block=iter.next();
    loc=new V10Location(block.getLocation());
    if (block.getType() == Material.WOOL) {
      portal=plugin.portalManager.borderBlocks.get(loc);
      if (portal == null)       portal=plugin.portalManager.insideBlocks.get(loc);
      if (portal == null)       portal=plugin.portalManager.behindBlocks.get(loc);
      if (portal != null) {
        if (region.getBoolean(RegionSetting.PROTECT_PORTALS_FROM_TNT))         iter.remove();
 else {
          portal.delete();
          return;
        }
      }
    }
 else     if (block.getType() == Material.SUGAR_CANE_BLOCK || plugin.blockUtil.compareBlockToString(block,region.getString(RegionSetting.GRILL_MATERIAL))) {
      Grill grill=plugin.grillManager.insideBlocks.get(loc);
      if (grill == null)       grill=plugin.grillManager.borderBlocks.get(loc);
      if (grill != null) {
        event.setCancelled(true);
        return;
      }
    }
  }
}
Program: 178731
Project: 178731
Buggy source:
public void activate(){
  deactivate();
  BlockFace face=facingSide;
  V10Location nextV10Location=startBlock;
  Block nextBlock=nextV10Location.getHandle().getBlock();
  while (true) {
    Portal portal=plugin.portalManager.insideBlocks.get(nextV10Location);
    if (portal == null)     portal=plugin.portalManager.borderBlocks.get(nextV10Location);
    if (portal != null && portal.open) {
      nextV10Location=portal.getDestination().teleport;
      nextBlock=nextV10Location.getHandle().getBlock();
      face=portal.getDestination().teleportFace.getOppositeFace();
      involvedPortals.add(portal);
      plugin.funnelBridgeManager.involvedPortals.put(portal,this);
      continue;
    }
 else     if (nextBlock.getY() > 127 || (!nextBlock.isLiquid() && nextBlock.getType() != Material.AIR))     break;
    if (!nextBlock.getWorld().isChunkLoaded(nextBlock.getChunk()))     return;
    nextBlock.setType(Material.GLASS);
    bridgeBlocks.put(nextV10Location,0);
    plugin.funnelBridgeManager.bridgeBlocks.put(nextV10Location,this);
    nextBlock=nextBlock.getRelative(face);
  }
}

Fixed version (ground truth):
public void activate(){
  deactivate();
  BlockFace face=facingSide;
  V10Location nextV10Location=startBlock;
  Block nextBlock=nextV10Location.getHandle().getBlock();
  while (true) {
    Portal portal=plugin.portalManager.insideBlocks.get(nextV10Location);
    if (portal == null)     portal=plugin.portalManager.borderBlocks.get(nextV10Location);
    if (portal != null && portal.open) {
      nextV10Location=portal.getDestination().teleport;
      nextBlock=nextV10Location.getHandle().getBlock();
      face=portal.getDestination().teleportFace.getOppositeFace();
      involvedPortals.add(portal);
      plugin.funnelBridgeManager.involvedPortals.put(portal,this);
      continue;
    }
 else     if (nextBlock.getY() > nextBlock.getWorld().getMaxHeight() - 1 || (!nextBlock.isLiquid() && nextBlock.getType() != Material.AIR) || !nextBlock.getWorld().isChunkLoaded(nextBlock.getChunk()))     return;
    nextBlock.setType(Material.GLASS);
    bridgeBlocks.put(nextV10Location,0);
    plugin.funnelBridgeManager.bridgeBlocks.put(nextV10Location,this);
    nextBlock=nextBlock.getRelative(face);
  }
}
Program: 178733
Project: 178733
Buggy source:
public boolean placeRecursiveEmancipationGrill(V10Location initial){
  Region region=plugin.regionManager.getRegion(initial);
  String borderID=region.getString(RegionSetting.GRILL_MATERIAL);
  if (!plugin.blockUtil.compareBlockToString(initial,borderID) || !region.getBoolean(RegionSetting.ENABLE_GRILLS))   return false;
  for (  Grill grill : grills)   if (grill.border.contains(initial))   return false;
  startRecurse(initial,borderID,BlockFace.WEST,BlockFace.NORTH,BlockFace.SOUTH,BlockFace.EAST,BlockFace.DOWN,BlockFace.UP);
  if (!complete)   startRecurse(initial,borderID,BlockFace.UP,BlockFace.WEST,BlockFace.EAST,BlockFace.DOWN,BlockFace.SOUTH,BlockFace.NORTH);
  if (!complete)   startRecurse(initial,borderID,BlockFace.UP,BlockFace.SOUTH,BlockFace.NORTH,BlockFace.DOWN,BlockFace.EAST,BlockFace.WEST);
  if (!complete)   return false;
  Grill grill=new Grill(plugin,border,inside,initial);
  grills.add(grill);
  grill.create();
  return true;
}

Fixed version (ground truth):
public boolean placeRecursiveEmancipationGrill(V10Location initial){
  Region region=plugin.regionManager.getRegion(initial);
  String borderID=region.getString(RegionSetting.GRILL_MATERIAL);
  System.out.print(initial.getHandle().getBlock().getTypeId() + "String_Node_Str" + borderID);
  if (!plugin.blockUtil.compareBlockToString(initial,borderID) || !region.getBoolean(RegionSetting.ENABLE_GRILLS))   return false;
  for (  Grill grill : grills)   if (grill.border.contains(initial))   return false;
  startRecurse(initial,borderID,BlockFace.WEST,BlockFace.NORTH,BlockFace.SOUTH,BlockFace.EAST,BlockFace.DOWN,BlockFace.UP);
  if (!complete)   startRecurse(initial,borderID,BlockFace.UP,BlockFace.WEST,BlockFace.EAST,BlockFace.DOWN,BlockFace.SOUTH,BlockFace.NORTH);
  if (!complete)   startRecurse(initial,borderID,BlockFace.UP,BlockFace.SOUTH,BlockFace.NORTH,BlockFace.DOWN,BlockFace.EAST,BlockFace.WEST);
  if (!complete)   return false;
  Grill grill=new Grill(plugin,border,inside,initial);
  grills.add(grill);
  grill.create();
  return true;
}
Program: 178734
Project: 178734
Buggy source:
public void onEnable(){
  config=new Config(this);
  Server s=getServer();
  PluginManager pm=s.getPluginManager();
  pm.registerEvents(new PortalStickPlayerListener(this),this);
  pm.registerEvents(new PortalStickBlockListener(this),this);
  pm.registerEvents(new PortalStickVehicleListener(this),this);
  pm.registerEvents(new PortalStickEntityListener(this),this);
  pm.registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)pm.getPlugin("String_Node_Str");
  config.load();
  s.getScheduler().scheduleSyncRepeatingTask(this,grillManager,400L,400L);
  s.getScheduler().scheduleSyncRepeatingTask(this,entityManager,1L,2L);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
}

Fixed version (ground truth):
public void onEnable(){
  config=new Config(this);
  Server s=getServer();
  PluginManager pm=s.getPluginManager();
  pm.registerEvents(pL,this);
  pm.registerEvents(new PortalStickBlockListener(this),this);
  pm.registerEvents(new PortalStickVehicleListener(this),this);
  pm.registerEvents(new PortalStickEntityListener(this),this);
  pm.registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)pm.getPlugin("String_Node_Str");
  config.load();
  s.getScheduler().scheduleSyncRepeatingTask(this,grillManager,400L,400L);
  s.getScheduler().scheduleSyncRepeatingTask(this,entityManager,1L,2L);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
  PlayerJoinEvent pje;
  for (  Player p : getServer().getOnlinePlayers()) {
    pje=new PlayerJoinEvent(p,null);
    pL.onPlayerJoin(pje);
  }
}
Program: 178735
Project: 178735
Buggy source:
public void onDisable(){
  ArrayList<String> copy=new ArrayList<String>(gelManager.onRedGel.keySet());
  Player p;
  Server s=getServer();
  for (  String pn : copy) {
    p=s.getPlayerExact(pn);
    gelManager.resetPlayer(p);
  }
  config.saveAll();
  config.unLoad();
}

Fixed version (ground truth):
public void onDisable(){
  PlayerQuitEvent pqe;
  for (  Player p : getServer().getOnlinePlayers()) {
    pqe=new PlayerQuitEvent(p,null);
    pL.onPlayerQuit(pqe);
  }
  for (  User user : userManager.users.values())   portalManager.deletePortals(user);
}
Program: 178736
Project: 178736
Buggy source:
@EventHandler(ignoreCancelled=true) public void onBlockBurn2(BlockBurnEvent event){
  V10Location loc=new V10Location(event.getBlock().getLocation());
  Portal portal=plugin.portalManager.borderBlocks.get(loc);
  if (portal == null)   portal=plugin.portalManager.insideBlocks.get(loc);
  if (portal == null)   portal=plugin.portalManager.behindBlocks.get(loc);
  if (plugin.portalManager.borderBlocks.containsKey(loc) || plugin.portalManager.insideBlocks.containsKey(loc) || plugin.portalManager.behindBlocks.containsKey(loc)) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(loc);
  if (plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.BLUE_GEL_BLOCK)) || plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.RED_GEL_BLOCK))) {
    System.out.print("String_Node_Str");
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onBlockBurn2(BlockBurnEvent event){
  V10Location loc=new V10Location(event.getBlock());
  if (plugin.portalManager.borderBlocks.containsKey(loc) || plugin.portalManager.insideBlocks.containsKey(loc) || plugin.portalManager.behindBlocks.containsKey(loc)) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(loc);
  if (plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.BLUE_GEL_BLOCK)) || plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.RED_GEL_BLOCK))) {
    System.out.print("String_Node_Str");
    event.setCancelled(true);
  }
}
Program: 178738
Project: 178738
Buggy source:
@EventHandler(ignoreCancelled=true) public void onBlockPlace(BlockPlaceEvent event){
  Material block=event.getBlock().getType();
  Bridge bridge=plugin.funnelBridgeManager.bridgeBlocks.get(new V10Location(event.getBlock()));
  if (bridge != null)   event.setCancelled(true);
  if (block == Material.RAILS || block == Material.POWERED_RAIL || block == Material.DETECTOR_RAIL)   return;
  Portal portal=plugin.portalManager.insideBlocks.get(new V10Location(event.getBlockPlaced()));
  if (portal != null) {
    event.setCancelled(true);
    return;
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onBlockPlace(BlockPlaceEvent event){
  Material block=event.getBlock().getType();
  if (plugin.funnelBridgeManager.bridgeBlocks.containsKey(new V10Location(event.getBlock()))) {
    event.setCancelled(true);
    return;
  }
  if (block == Material.RAILS || block == Material.POWERED_RAIL || block == Material.DETECTOR_RAIL)   return;
  if (plugin.portalManager.insideBlocks.containsKey(new V10Location(event.getBlockPlaced())))   event.setCancelled(true);
}
Program: 178739
Project: 178739
Buggy source:
@EventHandler(ignoreCancelled=true) public void onBlockBurn(BlockIgniteEvent event){
  V10Location loc=new V10Location(event.getBlock().getLocation());
  Portal portal=plugin.portalManager.borderBlocks.get(loc);
  if (portal == null)   portal=plugin.portalManager.insideBlocks.get(loc);
  if (portal == null)   portal=plugin.portalManager.behindBlocks.get(loc);
  if (plugin.portalManager.borderBlocks.containsKey(loc) || plugin.portalManager.insideBlocks.containsKey(loc) || plugin.portalManager.behindBlocks.containsKey(loc)) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(loc);
  if (plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.BLUE_GEL_BLOCK)) || plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.RED_GEL_BLOCK))) {
    System.out.print("String_Node_Str");
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onBlockBurn(BlockIgniteEvent event){
  V10Location loc=new V10Location(event.getBlock());
  if (plugin.portalManager.borderBlocks.containsKey(loc) || plugin.portalManager.insideBlocks.containsKey(loc) || plugin.portalManager.behindBlocks.containsKey(loc)) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(loc);
  if (plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.BLUE_GEL_BLOCK)) || plugin.blockUtil.compareBlockToString(loc,(String)region.settings.get(RegionSetting.RED_GEL_BLOCK))) {
    System.out.print("String_Node_Str");
    event.setCancelled(true);
  }
}
Program: 178741
Project: 178741
Buggy source:
public void onEnable(){
  config=new Config(this);
  getServer().getPluginManager().registerEvents(new PortalStickPlayerListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickBlockListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickVehicleListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickEntityListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  getServer().getScheduler().scheduleSyncRepeatingTask(this,grillManager,400L,400L);
  getServer().getScheduler().scheduleSyncRepeatingTask(this,entityManager,2L,2L);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
}

Fixed version (ground truth):
public void onEnable(){
  config=new Config(this);
  getServer().getPluginManager().registerEvents(new PortalStickPlayerListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickBlockListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickVehicleListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickEntityListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  getServer().getScheduler().scheduleSyncRepeatingTask(this,grillManager,400L,400L);
  getServer().getScheduler().scheduleSyncRepeatingTask(this,entityManager,1L,2L);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
}
Program: 178742
Project: 178742
Buggy source:
public void onEnable(){
  getServer().getPluginManager().registerEvents(new PortalStickPlayerListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickBlockListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickVehicleListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickEntityListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  getServer().getScheduler().scheduleSyncRepeatingTask(this,new GrillManager(this),400,400);
  getServer().getScheduler().scheduleSyncRepeatingTask(this,new EntityManager(this),2,2);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
}

Fixed version (ground truth):
public void onEnable(){
  config=new Config(this);
  getServer().getPluginManager().registerEvents(new PortalStickPlayerListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickBlockListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickVehicleListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickEntityListener(this),this);
  getServer().getPluginManager().registerEvents(new PortalStickWorldListener(this),this);
  worldGuard=(WorldGuardPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  getServer().getScheduler().scheduleSyncRepeatingTask(this,new GrillManager(this),400,400);
  getServer().getScheduler().scheduleSyncRepeatingTask(this,new EntityManager(this),2,2);
  ArrayList<BaseCommand> tmpList=new ArrayList<BaseCommand>();
  tmpList.add(new RegionToolCommand(this));
  tmpList.add(new SetRegionCommand(this));
  tmpList.add(new ReloadCommand(this));
  tmpList.add(new DeleteAllCommand(this));
  tmpList.add(new DeleteCommand(this));
  tmpList.add(new HelpCommand(this));
  tmpList.add(new RegionListCommand(this));
  tmpList.add(new DeleteRegionCommand(this));
  tmpList.add(new FlagCommand(this));
  tmpList.add(new RegionInfoCommand(this));
  commands=tmpList.toArray(new BaseCommand[0]);
}
Program: 178743
Project: 178743
Buggy source:
public Config(PortalStick instance){
  plugin=instance;
  mainConfigFile=getConfigFile("String_Node_Str");
  regionConfigFile=getConfigFile("String_Node_Str");
  grillConfigFile=getConfigFile("String_Node_Str");
  bridgeConfigFile=getConfigFile("String_Node_Str");
  mainConfig=getConfig(mainConfigFile);
  regionConfig=getConfig(regionConfigFile);
  grillConfig=getConfig(grillConfigFile);
  bridgeConfig=getConfig(bridgeConfigFile);
  load();
}

Fixed version (ground truth):
public Config(PortalStick instance){
  plugin=instance;
  mainConfigFile=getConfigFile("String_Node_Str");
  regionConfigFile=getConfigFile("String_Node_Str");
  grillConfigFile=getConfigFile("String_Node_Str");
  bridgeConfigFile=getConfigFile("String_Node_Str");
  mainConfig=getConfig(mainConfigFile);
  regionConfig=getConfig(regionConfigFile);
  grillConfig=getConfig(grillConfigFile);
  bridgeConfig=getConfig(bridgeConfigFile);
  plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
    public void run(){
      load();
    }
  }
);
}
Program: 178747
Project: 178747
Buggy source:
public static void deleteDroppedItems(User user){
  if (user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     if (item != null)     item.remove();
    user.resetItems();
  }
}

Fixed version (ground truth):
public static void deleteDroppedItems(User user){
  if (user != null || user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     if (item != null)     item.remove();
    user.resetItems();
  }
}
Program: 178748
Project: 178748
Buggy source:
public static void deleteDroppedItems(User user){
  if (user != null || user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     if (item != null)     item.remove();
    user.resetItems();
  }
}

Fixed version (ground truth):
public static void deleteDroppedItems(User user){
  if (user != null && user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     if (item != null)     item.remove();
    user.resetItems();
  }
}
Program: 178750
Project: 178750
Buggy source:
public static void deleteDroppedItems(User user){
  if (user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     item.remove();
    user.resetItems();
  }
}

Fixed version (ground truth):
public static void deleteDroppedItems(User user){
  if (user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     if (item != null)     item.remove();
    user.resetItems();
  }
}
Program: 178754
Project: 178754
Buggy source:
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if ((!oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) && (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (!region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId())))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  Region region=RegionManager.getRegion(portal.destloc);
  if (!region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getTypeId()) && !region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getRelative(BlockFace.UP).getTypeId()))   return false;
  return true;
}

Fixed version (ground truth):
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if ((!oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) && (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (!region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId())))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  Region region=RegionManager.getRegion(portal.destloc);
  if (!portal.vertical && !region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getTypeId()) && !region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getRelative(BlockFace.UP).getTypeId()))   return false;
  return true;
}
Program: 178755
Project: 178755
Buggy source:
public void create(){
  for (  Block b : inside) {
    b.setType(Material.SUGAR_CANE_BLOCK);
  }
}

Fixed version (ground truth):
public void create(){
  for (  Block b : inside) {
    if (b.getType() != Material.SUGAR_CANE_BLOCK)     b.setType(Material.SUGAR_CANE_BLOCK);
  }
}
Program: 178756
Project: 178756
Buggy source:
public static void checkPlayerMove(Player player,Region regionFrom,Region regionTo){
  User user=UserManager.getUser(player);
  if (user.getUsingTool())   return;
  if (!regionFrom.World.equalsIgnoreCase(regionTo.World))   return;
  if (!regionTo.Name.equals(regionFrom.Name)) {
    if (!Config.RestoreInvOnWorldChange && !regionFrom.World.equalsIgnoreCase(regionTo.World))     ;
 else {
      if (regionTo.Name.equalsIgnoreCase("String_Node_Str"))       user.revertInventory(player);
 else {
        user.saveInventory(player);
        setPortalInventory(player);
      }
    }
    if (regionFrom.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE) || regionTo.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE))     deletePortals(user);
    UserManager.deleteDroppedItems(player);
  }
}

Fixed version (ground truth):
public static void checkPlayerMove(Player player,Region regionFrom,Region regionTo){
  User user=UserManager.getUser(player);
  if (user.getUsingTool())   return;
  if (!regionTo.Name.equals(regionFrom.Name)) {
    if (regionFrom.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE) || regionTo.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE))     deletePortals(user);
    UserManager.deleteDroppedItems(player);
    if (regionTo.Name.equalsIgnoreCase("String_Node_Str"))     user.revertInventory(player);
 else {
      user.saveInventory(player);
      setPortalInventory(player);
    }
  }
}
Program: 178758
Project: 178758
Buggy source:
public void onPlayerTeleport(PlayerTeleportEvent event){
  PortalManager.checkPlayerMove(event.getPlayer(),RegionManager.getRegion(event.getFrom()),RegionManager.getRegion(event.getTo()));
}

Fixed version (ground truth):
public void onPlayerTeleport(PlayerTeleportEvent event){
  Region regionFrom=RegionManager.getRegion(event.getFrom());
  Region regionTo=RegionManager.getRegion(event.getTo());
  if (!Config.RestoreInvOnWorldChange && !event.getFrom().getWorld().getName().equalsIgnoreCase(event.getTo().getWorld().getName()))   return;
  PortalManager.checkPlayerMove(event.getPlayer(),regionFrom,regionTo);
}
Program: 178760
Project: 178760
Buggy source:
public void delete(){
  deleteInside();
  Config.deleteGrill(getStringLocation());
  GrillManager.grills.remove(this);
}

Fixed version (ground truth):
public void delete(){
  deleteInside();
  Config.deleteGrill(getStringLocation());
  GrillManager.grills.remove(this);
  Config.saveAll();
}
Program: 178761
Project: 178761
Buggy source:
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if ((!oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) && (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (!region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId())))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  HashSet<Integer> walkableblocks=new HashSet<Integer>();
  Region region=RegionManager.getRegion(portal.destloc);
  if (!region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getTypeId()) && !region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getRelative(BlockFace.UP).getTypeId()))   return false;
  return true;
}

Fixed version (ground truth):
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if ((!oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) && (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (!region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId())))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  Region region=RegionManager.getRegion(portal.destloc);
  if (!region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getTypeId()) && !region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(portal.destloc.getBlock().getRelative(BlockFace.UP).getTypeId()))   return false;
  return true;
}
Program: 178764
Project: 178764
Buggy source:
public Config(PortalStick instance){
  plugin=instance;
  mainConfig=plugin.getConfiguration();
  mainConfig.load();
  regionConfig=getConfigFile("String_Node_Str");
  grillConfig=getConfigFile("String_Node_Str");
  load();
}

Fixed version (ground truth):
public Config(PortalStick instance){
  plugin=instance;
  mainConfig=plugin.getConfiguration();
  regionConfig=getConfigFile("String_Node_Str");
  grillConfig=getConfigFile("String_Node_Str");
  load();
}
Program: 178765
Project: 178765
Buggy source:
public static void deleteDroppedItems(User user){
  for (  Item item : user.getDroppedItems())   item.remove();
  user.resetItems();
}

Fixed version (ground truth):
public static void deleteDroppedItems(User user){
  if (user.getDroppedItems() != null) {
    for (    Item item : user.getDroppedItems())     item.remove();
    user.resetItems();
  }
}
Program: 178768
Project: 178768
Buggy source:
public static void deleteRegion(String name){
  Region region=getRegion(name);
  Config.deleteRegion(name);
  regions.remove(region);
}

Fixed version (ground truth):
public static void deleteRegion(String name){
  Region region=getRegion(name);
  regions.remove(region.Name);
  Config.deleteRegion(name);
}
Program: 178769
Project: 178769
Buggy source:
public boolean run(CommandSender sender,String[] preArgs){
  this.sender=sender;
  for (  String arg : preArgs)   args.add(arg);
  args.remove(0);
  if (argLength != args.size()) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  region=RegionManager.getRegion(player.getLocation());
  user=UserManager.getUser(player);
  if (!permission(player))   return false;
  return execute();
}

Fixed version (ground truth):
public boolean run(CommandSender sender,String[] preArgs){
  this.sender=sender;
  args.clear();
  for (  String arg : preArgs)   args.add(arg);
  args.remove(0);
  if (argLength != args.size()) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  region=RegionManager.getRegion(player.getLocation());
  user=UserManager.getUser(player);
  if (!permission(player))   return false;
  return execute();
}
Program: 178770
Project: 178770
Buggy source:
public boolean execute(){
  if (args.get(0).equalsIgnoreCase("String_Node_Str"))   Util.sendMessage(player,"String_Node_Str");
 else   if (RegionManager.getRegion(args.get(0)) != null) {
    RegionManager.deleteRegion(args.get(0));
    Util.sendMessage(player,"String_Node_Str" + args.get(0) + "String_Node_Str");
  }
 else   Util.sendMessage(player,"String_Node_Str" + args.get(0) + "String_Node_Str");
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  if (args.get(0).equalsIgnoreCase("String_Node_Str"))   Util.sendMessage(player,"String_Node_Str");
 else   if (RegionManager.getRegion(args.get(0)) != null) {
    RegionManager.deleteRegion(args.get(0));
    Config.reLoad();
    Util.sendMessage(player,"String_Node_Str" + args.get(0) + "String_Node_Str");
  }
 else   Util.sendMessage(player,"String_Node_Str" + args.get(0) + "String_Node_Str");
  return true;
}
Program: 178772
Project: 178772
Buggy source:
public static void deleteRegion(String name){
  regionConfig.removeProperty(name);
  saveAll();
}

Fixed version (ground truth):
public static void deleteRegion(String name){
  regionConfig.removeProperty("String_Node_Str" + name);
  saveAll();
}
Program: 178773
Project: 178773
Buggy source:
public static void deleteUser(User user){
  PortalManager.deletePortals(user);
  deleteDroppedItems(user);
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet())   if (entry.getValue() == user)   users.remove(entry.getKey());
}

Fixed version (ground truth):
public static void deleteUser(User user){
  PortalManager.deletePortals(user);
  deleteDroppedItems(user);
  for (  Map.Entry<String,User> entry : users.entrySet())   if (entry.getValue() == user)   users.remove(entry.getKey());
}
Program: 178774
Project: 178774
Buggy source:
public void onPlayerTeleport(PlayerTeleportEvent event){
  if (event.isCancelled())   PortalManager.checkPlayerMove(event.getPlayer(),RegionManager.getRegion(event.getFrom()),RegionManager.getRegion(event.getTo()));
}

Fixed version (ground truth):
public void onPlayerTeleport(PlayerTeleportEvent event){
  PortalManager.checkPlayerMove(event.getPlayer(),RegionManager.getRegion(event.getFrom()),RegionManager.getRegion(event.getTo()));
}
Program: 178775
Project: 178775
Buggy source:
public static void checkPlayerMove(Player player,Region regionFrom,Region regionTo){
  User user=UserManager.getUser(player);
  if (!regionTo.Name.equals(regionFrom.Name)) {
    if (regionTo.Name == "String_Node_Str") {
      player.getInventory().setContents(user.getInventory().getContents());
    }
 else {
      user.setInventory(player.getInventory());
      setPortalInventory(player);
    }
    if (regionFrom.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE) || regionTo.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE))     deletePortals(user);
    UserManager.deleteDroppedItems(player);
  }
}

Fixed version (ground truth):
public static void checkPlayerMove(Player player,Region regionFrom,Region regionTo){
  User user=UserManager.getUser(player);
  if (user.getUsingTool())   return;
  if (!regionTo.Name.equals(regionFrom.Name)) {
    if (regionTo.Name == "String_Node_Str") {
      player.getInventory().setContents(user.getInventory().getContents());
    }
 else {
      user.setInventory(player.getInventory());
      setPortalInventory(player);
    }
    if (regionFrom.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE) || regionTo.getBoolean(RegionSetting.DELETE_ON_EXITENTRANCE))     deletePortals(user);
    UserManager.deleteDroppedItems(player);
  }
}
Program: 178776
Project: 178776
Buggy source:
public boolean run(CommandSender sender,String[] preArgs){
  this.sender=sender;
  for (  String arg : preArgs)   args.add(arg);
  args.remove(0);
  if (argLength != args.size()) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  return execute();
}

Fixed version (ground truth):
public boolean run(CommandSender sender,String[] preArgs){
  this.sender=sender;
  for (  String arg : preArgs)   args.add(arg);
  args.remove(0);
  if (argLength != args.size()) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  region=RegionManager.getRegion(player.getLocation());
  return execute();
}
Program: 178777
Project: 178777
Buggy source:
public boolean execute(){
  if (!Permission.adminRegions(player))   return false;
  User user=UserManager.getUser(player);
  if (user.getUsingTool()) {
    user.setUsingTool(false);
    Util.sendMessage(sender,"String_Node_Str");
  }
 else {
    user.setUsingTool(true);
    Util.sendMessage(sender,"String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  if (!Permission.adminRegions(player))   return false;
  User user=UserManager.getUser(player);
  if (user.getUsingTool()) {
    user.setUsingTool(false);
    Util.sendMessage(sender,"String_Node_Str");
  }
 else {
    user.setUsingTool(true);
    Util.sendMessage(sender,"String_Node_Str");
    if (!player.getInventory().contains(Config.RegionTool)) {
      int slot=player.getInventory().firstEmpty();
      if (slot == -1)       player.getWorld().dropItem(player.getLocation(),new ItemStack(Config.RegionTool));
 else       player.getInventory().setItem(slot,new ItemStack(Config.RegionTool));
    }
  }
  return true;
}
Program: 178778
Project: 178778
Buggy source:
public void deleteInside(){
  for (  Block b : inside) {
    b.setType(Material.AIR);
    GrillManager.grills.remove(this);
  }
}

Fixed version (ground truth):
public void deleteInside(){
  for (  Block b : inside) {
    b.setType(Material.AIR);
  }
}
Program: 178779
Project: 178779
Buggy source:
public void delete(){
  deleteInside();
  Config.deleteGrill(getStringLocation());
}

Fixed version (ground truth):
public void delete(){
  deleteInside();
  Config.deleteGrill(getStringLocation());
  GrillManager.grills.remove(this);
}
Program: 178780
Project: 178780
Buggy source:
public static HashMap<String,User> getUserList(){
  return users;
}

Fixed version (ground truth):
public static ConcurrentHashMap<String,User> getUserList(){
  return users;
}
Program: 178782
Project: 178782
Buggy source:
public void onDisable(){
  Config.saveAll();
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    User user=entry.getValue();
    Player player=getServer().getPlayer(entry.getKey());
    if (player != null)     user.revertInventory(player);
    UserManager.deleteUser(user);
  }
}

Fixed version (ground truth):
public void onDisable(){
  Config.saveAll();
  Config.unLoad();
  Util.info("String_Node_Str");
}
Program: 178783
Project: 178783
Buggy source:
public void revertInventory(Player player){
  PlayerInventory inv=player.getInventory();
  inv.clear();
  for (  ItemStack old : inventory) {
    if (old != null) {
      ItemStack stack=new ItemStack(old.getType());
      stack.setAmount(old.getAmount());
      stack.setData(old.getData());
      inv.addItem(stack);
    }
  }
  if (boots != null && boots.getTypeId() != 0)   inv.setBoots(new ItemStack(boots.getType()));
  if (chest != null && chest.getTypeId() != 0)   inv.setChestplate(new ItemStack(chest.getType()));
  if (legs != null && legs.getTypeId() != 0)   inv.setLeggings(new ItemStack(legs.getType()));
  if (helmet != null && helmet.getTypeId() != 0)   inv.setHelmet(new ItemStack(helmet.getType()));
}

Fixed version (ground truth):
public void revertInventory(Player player){
  if (inventory == null)   return;
  PlayerInventory inv=player.getInventory();
  inv.clear();
  for (  ItemStack old : inventory) {
    if (old != null) {
      ItemStack stack=new ItemStack(old.getType());
      stack.setAmount(old.getAmount());
      stack.setData(old.getData());
      inv.addItem(stack);
    }
  }
  if (boots != null && boots.getTypeId() != 0)   inv.setBoots(new ItemStack(boots.getType()));
  if (chest != null && chest.getTypeId() != 0)   inv.setChestplate(new ItemStack(chest.getType()));
  if (legs != null && legs.getTypeId() != 0)   inv.setLeggings(new ItemStack(legs.getType()));
  if (helmet != null && helmet.getTypeId() != 0)   inv.setHelmet(new ItemStack(helmet.getType()));
}
Program: 178784
Project: 178784
Buggy source:
public FlagCommand(){
  name="String_Node_Str";
  argLength=0;
  usage="String_Node_Str";
}

Fixed version (ground truth):
public FlagCommand(){
  name="String_Node_Str";
  argLength=3;
  usage="String_Node_Str";
}
Program: 178785
Project: 178785
Buggy source:
public boolean execute(){
  Config.unLoad();
  Config.load();
  Util.sendMessage(player,"String_Node_Str");
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  Region editRegion=RegionManager.getRegion(args.get(0));
  if (editRegion == null) {
    Util.sendMessage(player,"String_Node_Str");
    return true;
  }
  for (  RegionSetting setting : RegionSetting.values()) {
    if (setting.getYaml().equalsIgnoreCase(args.get(1)) && setting.getEditable()) {
      Object old=editRegion.settings.remove(setting);
      try {
        if (setting.getDefault() instanceof Integer)         editRegion.settings.put(setting,Integer.parseInt(args.get(2)));
 else         if (setting.getDefault() instanceof Double)         editRegion.settings.put(setting,Double.parseDouble(args.get(2)));
 else         if (setting.getDefault() instanceof Boolean)         editRegion.settings.put(setting,Boolean.parseBoolean(args.get(2)));
 else         editRegion.settings.put(setting,args.get(2));
        Util.sendMessage(player,"String_Node_Str" + editRegion.Name + "String_Node_Str");
        Config.saveAll();
        Config.reLoad();
        return true;
      }
 catch (      Throwable t) {
        Util.sendMessage(player,"String_Node_Str" + setting.getYaml());
        editRegion.settings.put(setting,old);
        return true;
      }
    }
  }
  Util.sendMessage(player,"String_Node_Str");
  String flags="String_Node_Str";
  for (  RegionSetting setting : RegionSetting.values())   if (setting.getEditable())   flags+="String_Node_Str" + setting.getYaml() + "String_Node_Str";
  Util.sendMessage(player,"String_Node_Str" + flags.substring(0,flags.length() - 2));
  return true;
}
Program: 178786
Project: 178786
Buggy source:
public ReloadCommand(){
  name="String_Node_Str";
  argLength=2;
  usage="String_Node_Str";
}

Fixed version (ground truth):
public ReloadCommand(){
  name="String_Node_Str";
  argLength=0;
  usage="String_Node_Str";
}
Program: 178787
Project: 178787
Buggy source:
public boolean execute(){
  Region editRegion=RegionManager.getRegion(args.get(0));
  if (editRegion == null) {
    Util.sendMessage(player,"String_Node_Str");
    return true;
  }
  for (  RegionSetting setting : editRegion.settings.values().toArray(new RegionSetting[0])) {
    if (setting.getYaml().equalsIgnoreCase(args.get(1)) && setting.getEditable()) {
      Object old=editRegion.settings.remove(setting);
      try {
        if (setting.getDefault() instanceof Integer)         editRegion.settings.put(setting,Integer.parseInt(args.get(2)));
 else         if (setting.getDefault() instanceof Double)         editRegion.settings.put(setting,Double.parseDouble(args.get(2)));
 else         if (setting.getDefault() instanceof Boolean)         editRegion.settings.put(setting,Boolean.parseBoolean(args.get(2)));
 else         editRegion.settings.put(setting,args.get(2));
        Util.sendMessage(player,"String_Node_Str" + editRegion.Name + "String_Node_Str");
        return true;
      }
 catch (      Exception e) {
        Util.sendMessage(player,"String_Node_Str" + setting.getYaml());
        editRegion.settings.put(setting,old);
        return true;
      }
    }
  }
  Util.sendMessage(player,"String_Node_Str");
  String flags="String_Node_Str";
  for (  RegionSetting setting : RegionSetting.values())   if (setting.getEditable())   flags+=setting.getYaml() + "String_Node_Str";
  Util.sendMessage(player,"String_Node_Str" + flags.substring(0,flags.length() - 2));
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  Config.unLoad();
  Config.load();
  Util.sendMessage(player,"String_Node_Str");
  return true;
}
Program: 178788
Project: 178788
Buggy source:
public static void unLoad(){
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    User user=entry.getValue();
    Player player=plugin.getServer().getPlayer(entry.getKey());
    if (player != null)     user.revertInventory(player);
    UserManager.deleteUser(user);
  }
}

Fixed version (ground truth):
public static void unLoad(){
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    User user=entry.getValue();
    Player player=plugin.getServer().getPlayer(entry.getKey());
    if (player != null) {
      if (!RegionManager.getRegion(player.getLocation()).Name.equalsIgnoreCase("String_Node_Str"))       user.revertInventory(player);
    }
    UserManager.deleteUser(user);
  }
}
Program: 178790
Project: 178790
Buggy source:
public void onDisable(){
  Config.saveAll();
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    Player player=getServer().getPlayer(entry.getKey());
    User user=entry.getValue();
    if (player != null && user.getInventory() != null)     player.getInventory().setContents(user.getInventory().getContents());
  }
}

Fixed version (ground truth):
public void onDisable(){
  Config.saveAll();
  Config.unLoad();
}
Program: 178791
Project: 178791
Buggy source:
public static void deleteUser(Player player){
  PortalManager.deletePortals(getUser(player));
  deleteDroppedItems(player);
  users.remove(player.getName());
}

Fixed version (ground truth):
public static void deleteUser(User user){
  PortalManager.deletePortals(user);
  deleteDroppedItems(user);
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet())   if (entry.getValue() == user)   users.remove(entry.getKey());
}
Program: 178792
Project: 178792
Buggy source:
public static void deleteDroppedItems(Player player){
  User user=getUser(player);
  for (  Item item : user.getDroppedItems())   item.remove();
  user.resetItems();
}

Fixed version (ground truth):
public static void deleteDroppedItems(User user){
  for (  Item item : user.getDroppedItems())   item.remove();
  user.resetItems();
}
Program: 178793
Project: 178793
Buggy source:
public static void unLoad(){
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    Player player=plugin.getServer().getPlayer(entry.getKey());
    User user=entry.getValue();
    if (player != null && user.getInventory() != null)     player.getInventory().setContents(user.getInventory().getContents());
  }
}

Fixed version (ground truth):
public static void unLoad(){
  PortalManager.deleteAll();
  GrillManager.deleteAll();
  for (  Map.Entry<String,User> entry : UserManager.getUserList().entrySet()) {
    User user=entry.getValue();
    Player player=plugin.getServer().getPlayer(entry.getKey());
    if (player != null && user.getInventory() != null)     player.getInventory().setContents(user.getInventory().getContents());
    UserManager.deleteUser(user);
  }
}
Program: 178795
Project: 178795
Buggy source:
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId()) && !oldportal.getInside().contains(b)&& !oldportal.getBorder().contains(b))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private static Boolean checkPortal(PortalCoord portal,Portal oldportal){
  for (  Block b : portal.border) {
    Region region=RegionManager.getRegion(b.getLocation());
    if (region.getList(RegionSetting.TRANSPARENT_BLOCKS).contains(b.getTypeId()) || (!region.getBoolean(RegionSetting.ALL_BLOCKS_PORTAL) && !region.getList(RegionSetting.PORTAL_BLOCKS).contains(b.getTypeId()) && !oldportal.getInside().contains(b)&& !oldportal.getBorder().contains(b))) {
      return false;
    }
  }
  for (  Block b : portal.inside) {
    if (b.getTypeId() == 0 && !oldportal.getInside().contains(b) && !oldportal.getBorder().contains(b)) {
      return false;
    }
  }
  return true;
}