nus-yam/ex-repair huggingface dataset:
Program: 86300
Project: 86300
Buggy source:
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",value);
    s=s.replaceAll(stringStringEntry.getKey(),value);
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}

Fixed version (ground truth):
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",value);
    if (stringStringEntry.getKey().matches("String_Node_Str"))     s=s.replaceAll(stringStringEntry.getKey(),value);
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}
Program: 86301
Project: 86301
Buggy source:
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll(String.format("String_Node_Str",stringStringEntry.getKey()),value).replaceAll(String.format("String_Node_Str",stringStringEntry.getKey()),stringStringEntry.getValue());
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}

Fixed version (ground truth):
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll(String.format("String_Node_Str",stringStringEntry.getKey()),value).replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",stringStringEntry.getValue());
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}
Program: 86302
Project: 86302
Buggy source:
/** 
 * @param slot
 */
public void clearSlot(Integer slot){
  inventoryButtons.remove(slot);
  markForUpdate(slot);
}

Fixed version (ground truth):
/** 
 * @param slot
 */
public void clearSlot(Integer slot){
  if (!inventoryButtons.containsKey(slot))   return;
  inventoryButtons.remove(slot);
  markForUpdate(slot);
}
Program: 86303
Project: 86303
Buggy source:
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",value);
    s=s.replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",value);
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}

Fixed version (ground truth):
public String get(){
  if (formatString == null)   return "String_Node_Str";
  String s=ChatColor.translateAlternateColorCodes('&',formatString);
  for (  Map.Entry<String,String> stringStringEntry : modifiers.entrySet()) {
    String value=stringStringEntry.getValue();
    if (coloredInputs)     value=ChatColor.translateAlternateColorCodes('&',value);
    s=s.replaceAll("String_Node_Str" + stringStringEntry.getKey() + "String_Node_Str",value);
    s=s.replaceAll(stringStringEntry.getKey(),value);
  }
  if (prefix && loadedPrefix != null)   return loadedPrefix + s;
  return s;
}
Program: 86304
Project: 86304
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerChangeWorld(PlayerChangedWorldEvent event){
  CPlayer player=Core.getOnlinePlayer(event.getPlayer());
  MobNPCWither wither=manager.witherBar.get(player);
  if (wither != null) {
    wither.despawn();
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerChangeWorld(PlayerChangedWorldEvent event){
  CPlayer player=Core.getOnlinePlayer(event.getPlayer());
  MobNPCWither wither=manager.witherBar.get(player);
  if (wither != null) {
    wither.despawn();
    manager.witherBar.remove(player);
  }
}
Program: 86305
Project: 86305
Buggy source:
protected final Player[] getTargets(){
  CPlayer[] cPlayers=(this.viewers.size() == 0 ? Core.getPlayerManager().getOnlinePlayers() : this.viewers).toArray(new CPlayer[this.viewers.size()]);
  Player[] players=new Player[cPlayers.length];
  for (int x=0; x < cPlayers.length; x++) {
    Player bukkitPlayer=cPlayers[x].getBukkitPlayer();
    if (this.world != null && !bukkitPlayer.getWorld().equals(world))     continue;
    players[x]=bukkitPlayer;
  }
  return players;
}

Fixed version (ground truth):
protected final Player[] getTargets(){
  CPlayer[] cPlayers=(this.viewers.size() == 0 ? Core.getPlayerManager().getOnlinePlayers() : this.viewers).toArray(new CPlayer[this.viewers.size()]);
  Player[] players=new Player[cPlayers.length];
  int x=0;
  for (int i=0; i < cPlayers.length; i++) {
    Player bukkitPlayer=cPlayers[x].getBukkitPlayer();
    UUID uid=bukkitPlayer.getWorld().getUID();
    UUID uid1=this.world != null ? world.getUID() : null;
    if (this.world != null && !uid.equals(uid1))     continue;
    players[x]=bukkitPlayer;
    x++;
  }
  return x == 0 ? new Player[]{} : Arrays.copyOfRange(players,0,x);
}
Program: 86306
Project: 86306
Buggy source:
protected final void setItemStackUsing(Material material,Integer quantity,String title,String lore){
  stack=new ItemStack(material,quantity);
  ItemMeta meta=stack.getItemMeta();
  meta.setDisplayName(title);
  meta.setLore(wrapLoreText(lore));
}

Fixed version (ground truth):
protected final void setItemStackUsing(Material material,Integer quantity,String title,String lore){
  stack=new ItemStack(material,quantity);
  ItemMeta meta=stack.getItemMeta();
  meta.setDisplayName(title);
  meta.setLore(wrapLoreText(lore));
  stack.setItemMeta(meta);
}
Program: 86308
Project: 86308
Buggy source:
public void update(){
  if (!spawned)   spawn();
  updateDataWatcher();
  WrapperPlayServerEntityMetadata packet=new WrapperPlayServerEntityMetadata();
  List<WrappedWatchableObject> watchableObjects=dataWatcher.getWatchableObjects();
  List<WrappedWatchableObject> toBeSent=new ArrayList<>();
  for (  WrappedWatchableObject watchableObject : watchableObjects) {
    if (!lastDataWatcher.getObject(watchableObject.getIndex()).equals(watchableObject.getValue()))     toBeSent.add(watchableObject);
  }
  packet.setEntityMetadata(toBeSent);
  packet.setEntityId(id);
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  lastDataWatcher=dataWatcher.deepClone();
  onUpdate();
}

Fixed version (ground truth):
public void update(){
  if (!spawned)   spawn();
  updateDataWatcher();
  WrapperPlayServerEntityMetadata packet=new WrapperPlayServerEntityMetadata();
  List<WrappedWatchableObject> watchableObjects=dataWatcher.getWatchableObjects();
  List<WrappedWatchableObject> toBeSent=new ArrayList<>();
  if (lastDataWatcher == null)   toBeSent.addAll(dataWatcher.getWatchableObjects());
 else {
    for (    WrappedWatchableObject watchableObject : watchableObjects) {
      Object object=lastDataWatcher.getObject(watchableObject.getIndex());
      if (object == null || !object.equals(watchableObject.getValue()))       toBeSent.add(watchableObject);
    }
  }
  packet.setEntityMetadata(toBeSent);
  packet.setEntityId(id);
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  lastDataWatcher=dataWatcher.deepClone();
  onUpdate();
}
Program: 86309
Project: 86309
Buggy source:
public AbstractMobNPC(@NonNull Point location,World world,Set<CPlayer> observers,@NonNull String title){
  this.location=location;
  this.world=world;
  this.viewers=new HashSet<>();
  if (observers != null)   this.viewers.addAll(observers);
  this.dataWatcher=new WrappedDataWatcher();
  this.observers=new HashSet<>();
  this.spawned=false;
  this.customName=title;
  this.id=CustomEntityIDManager.getNextId();
  updateDataWatcher();
}

Fixed version (ground truth):
public AbstractMobNPC(@NonNull Point location,World world,Set<CPlayer> observers,@NonNull String title){
  this.location=location;
  this.world=world;
  this.viewers=new HashSet<>();
  if (observers != null)   this.viewers.addAll(observers);
  this.dataWatcher=new WrappedDataWatcher();
  this.observers=new HashSet<>();
  this.spawned=false;
  this.customName=title;
  this.id=CustomEntityIDManager.getNextId();
}
Program: 86310
Project: 86310
Buggy source:
@Override protected void onDataWatcherUpdate(){
  super.onDataWatcherUpdate();
  int bools=0;
  if (isTame())   bools|=0x02;
  if (saddled)   bools|=0x04;
  if (chest)   bools|=0x08;
  if (bred)   bools|=0x10;
  if (eating)   bools|=0x20;
  if (rearing)   bools|=0x40;
  if (mouthOpen)   bools|=0x80;
  dataWatcher.setObject(16,bools);
  dataWatcher.setObject(19,(byte)variant.ordinal());
  dataWatcher.setObject(20,color.ordinal() & 0xFF | style.ordinal() << 8);
  dataWatcher.setObject(21,getOwnerName());
  dataWatcher.setObject(22,armorType.ordinal());
}

Fixed version (ground truth):
@Override protected void onDataWatcherUpdate(){
  super.onDataWatcherUpdate();
  int bools=0;
  if (isTame())   bools|=0x02;
  if (saddled)   bools|=0x04;
  if (chest)   bools|=0x08;
  if (bred)   bools|=0x10;
  if (eating)   bools|=0x20;
  if (rearing)   bools|=0x40;
  if (mouthOpen)   bools|=0x80;
  dataWatcher.setObject(16,bools);
  dataWatcher.setObject(19,(byte)variant.ordinal());
  dataWatcher.setObject(20,color.ordinal() & 0xFF | style.ordinal() << 8);
  dataWatcher.removeObject(17);
  dataWatcher.setObject(21,getOwnerName());
  dataWatcher.setObject(22,armorType.ordinal());
}
Program: 86311
Project: 86311
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerMove(PlayerMoveEvent event){
  CPlayer onlinePlayer=Core.getOnlinePlayer(event.getPlayer());
  EnderBar enderBarFor=manager.getEnderBarFor(onlinePlayer);
  if (enderBarFor != null && enderBarFor.isSpawned() && event.getTo().distanceSquared(enderBarFor.getCurrentLocation()) > 25)   enderBarFor.updateLocation();
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerMove(PlayerMoveEvent event){
  CPlayer onlinePlayer=Core.getOnlinePlayer(event.getPlayer());
  MobNPCEnderDragon enderBarFor=manager.enderBars.get(onlinePlayer);
  Point current=Point.of(event.getTo());
  current.setY(-300D);
  if (enderBarFor != null && enderBarFor.isSpawned() && current.distanceSquared(enderBarFor.getLocation()) > 9) {
    enderBarFor.move(Point.of(event.getTo().getX(),-300d,event.getTo().getZ(),0F,0F));
  }
}
Program: 86312
Project: 86312
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerChangeWorld(PlayerChangedWorldEvent event){
  CPlayer player=Core.getOnlinePlayer(event.getPlayer());
  EnderBar enderBarFor=manager.getEnderBarFor(player);
  if (enderBarFor != null)   enderBarFor.newWorld();
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onPlayerChangeWorld(PlayerChangedWorldEvent event){
  CPlayer player=Core.getOnlinePlayer(event.getPlayer());
  MobNPCEnderDragon enderBarFor=manager.enderBars.get(player);
  if (enderBarFor != null) {
    enderBarFor.despawn();
  }
}
Program: 86313
Project: 86313
Buggy source:
/** 
 * Creates an Ender Dragon for the player if it does not exist, then updates the text for the dragon.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to set ender bar text for.
 * @param text The text to set the bar to.
 */
public void setTextFor(CPlayer player,String text){
  createIfDoesNotExist(player);
  enderBars.get(player).setText(text);
}

Fixed version (ground truth):
/** 
 * Creates an Ender Dragon for the player if it does not exist, then updates the text for the dragon.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to set ender bar text for.
 * @param text The text to set the bar to.
 */
public void setTextFor(CPlayer player,String text){
  createIfDoesNotExist(player);
  MobNPCEnderDragon mobNPCEnderDragon=enderBars.get(player);
  mobNPCEnderDragon.setCustomName(text);
  mobNPCEnderDragon.update();
}
Program: 86314
Project: 86314
Buggy source:
private boolean createIfDoesNotExist(CPlayer player){
  if (enderBars.containsKey(player))   return false;
  EnderBar enderBar=new EnderBar(player,getNextId());
  enderBar.spawn();
  enderBars.put(player,enderBar);
  return true;
}

Fixed version (ground truth):
private boolean createIfDoesNotExist(CPlayer player){
  if (enderBars.containsKey(player))   return false;
  Player bukkitPlayer=player.getBukkitPlayer();
  HashSet<CPlayer> cPlayers=new HashSet<>();
  cPlayers.add(player);
  Point of=Point.of(bukkitPlayer.getLocation());
  of.setY(-300D);
  MobNPCEnderDragon enderDragon=new MobNPCEnderDragon(of,bukkitPlayer.getWorld(),cPlayers,"String_Node_Str");
  enderBars.put(player,enderDragon);
  enderDragon.spawn();
  return true;
}
Program: 86315
Project: 86315
Buggy source:
/** 
 * Creates an Ender Dragon for the player if it does not exist, then updates the health percentage for that dragon.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to set ender bar health for.
 * @param health The health to set the ender dragon's bar to.
 */
public void setHealthPercentageFor(CPlayer player,Float health){
  createIfDoesNotExist(player);
  enderBars.get(player).setHealth(health);
}

Fixed version (ground truth):
/** 
 * Creates an Ender Dragon for the player if it does not exist, then updates the health percentage for that dragon.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to set ender bar health for.
 * @param health The health to set the ender dragon's bar to.
 */
public void setHealthPercentageFor(CPlayer player,Float health){
  createIfDoesNotExist(player);
  MobNPCEnderDragon mobNPCEnderDragon=enderBars.get(player);
  mobNPCEnderDragon.setHealth(health * 200F);
  mobNPCEnderDragon.update();
}
Program: 86316
Project: 86316
Buggy source:
/** 
 * Hides the bar for the specified player if it is currently visible.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to hide the bar for.
 */
public void hideBarFor(CPlayer player){
  if (!enderBars.containsKey(player))   return;
  EnderBar enderBar=enderBars.get(player);
  if (enderBar.isSpawned())   enderBar.remove();
}

Fixed version (ground truth):
/** 
 * Hides the bar for the specified player if it is currently visible.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to hide the bar for.
 */
public void hideBarFor(CPlayer player){
  if (!enderBars.containsKey(player))   return;
  MobNPCEnderDragon enderBar=enderBars.get(player);
  if (enderBar.isSpawned())   enderBar.despawn();
}
Program: 86317
Project: 86317
Buggy source:
/** 
 * Creates an ender dragon if the player does not already have one, and then shows it if it is hidden.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to show the ender bar for.
 */
public void showBarFor(CPlayer player){
  EnderBar enderBar=enderBars.get(player);
  if (!createIfDoesNotExist(player) && !enderBar.isSpawned())   enderBar.spawn();
}

Fixed version (ground truth):
/** 
 * Creates an ender dragon if the player does not already have one, and then shows it if it is hidden.
 * @param player The {@link net.cogzmc.core.player.CPlayer} to show the ender bar for.
 */
public void showBarFor(CPlayer player){
  MobNPCEnderDragon enderBar=enderBars.get(player);
  if (!createIfDoesNotExist(player) && !enderBar.isSpawned())   enderBar.spawn();
}
Program: 86318
Project: 86318
Buggy source:
public void update(){
  if (!spawned)   spawn();
  updateDataWatcher();
  WrapperPlayServerEntityMetadata packet=new WrapperPlayServerEntityMetadata();
  List<WrappedWatchableObject> watchableObjects=new ArrayList<>();
  if (lastDataWatcher == null)   watchableObjects.addAll(dataWatcher.getWatchableObjects());
 else {
    for (    WrappedWatchableObject watchableObject : dataWatcher.getWatchableObjects()) {
      Object object=lastDataWatcher.getObject(watchableObject.getIndex());
      if (object == null || !object.equals(watchableObject.getValue()))       watchableObjects.add(watchableObject);
    }
  }
  packet.setEntityMetadata(watchableObjects);
  packet.setEntityId(id);
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  lastDataWatcher=dataWatcher.deepClone();
  onUpdate();
}

Fixed version (ground truth):
public void update(){
  if (!spawned)   spawn();
  updateDataWatcher();
  WrapperPlayServerEntityMetadata packet=new WrapperPlayServerEntityMetadata();
  List<WrappedWatchableObject> watchableObjects=new ArrayList<>();
  if (lastDataWatcher == null)   watchableObjects.addAll(dataWatcher.getWatchableObjects());
 else {
    for (    WrappedWatchableObject watchableObject : dataWatcher.getWatchableObjects()) {
      Object object=lastDataWatcher.getObject(watchableObject.getIndex());
      if (object == null || !object.equals(watchableObject.getValue()))       watchableObjects.add(watchableObject);
    }
  }
  if (Core.DEBUG) {
    for (    WrappedWatchableObject watchableObject : watchableObjects) {
      log.info("String_Node_Str" + watchableObject.getIndex() + "String_Node_Str"+ id+ "String_Node_Str"+ getClass().getSimpleName()+ "String_Node_Str"+ watchableObject.getValue()+ "String_Node_Str"+ watchableObject.getType().getName()+ "String_Node_Str");
    }
  }
  packet.setEntityMetadata(watchableObjects);
  packet.setEntityId(id);
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  lastDataWatcher=dataWatcher.deepClone();
  onUpdate();
}
Program: 86319
Project: 86319
Buggy source:
public void despawn(){
  if (!spawned)   throw new IllegalStateException("String_Node_Str");
  WrapperPlayServerEntityDestroy packet=getDespawnPacket();
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  ProtocolLibrary.getProtocolManager().removePacketListener(listener);
  listener=null;
  spawned=false;
}

Fixed version (ground truth):
public void despawn(){
  if (!spawned)   throw new IllegalStateException("String_Node_Str");
  WrapperPlayServerEntityDestroy packet=getDespawnPacket();
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  ProtocolLibrary.getProtocolManager().removePacketListener(listener);
  listener=null;
  spawned=false;
  log.info("String_Node_Str" + id + "String_Node_Str"+ getClass().getSimpleName());
}
Program: 86320
Project: 86320
Buggy source:
protected void updateDataWatcher(){
  dataWatcher.setObject(6,getHealth());
  if (showingNametag)   dataWatcher.setObject(11,(byte)1);
 else   if (dataWatcher.getObject(11) != null)   dataWatcher.removeObject(11);
  if (customName != null)   dataWatcher.setObject(10,customName.substring(0,Math.min(customName.length(),64)));
 else   if (dataWatcher.getObject(10) != null)   dataWatcher.removeObject(10);
  onDataWatcherUpdate();
}

Fixed version (ground truth):
protected void updateDataWatcher(){
  if (Core.DEBUG)   log.info("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ id+ "String_Node_Str");
  dataWatcher.setObject(6,getHealth());
  if (showingNametag)   dataWatcher.setObject(11,(byte)1);
 else   if (dataWatcher.getObject(11) != null)   dataWatcher.removeObject(11);
  if (customName != null)   dataWatcher.setObject(10,customName.substring(0,Math.min(customName.length(),64)));
 else   if (dataWatcher.getObject(10) != null)   dataWatcher.removeObject(10);
  byte zeroByte=0;
  if (onFire)   zeroByte|=0x01;
  if (crouched)   zeroByte|=0x02;
  if (sprinting)   zeroByte|=0x08;
  if (blocking)   zeroByte|=0x10;
  if (invisible)   zeroByte|=0x20;
  dataWatcher.setObject(0,zeroByte);
  onDataWatcherUpdate();
}
Program: 86321
Project: 86321
Buggy source:
protected Player[] getTargets(){
  CPlayer[] cPlayers=(this.viewers.size() == 0 ? Core.getPlayerManager().getOnlinePlayers() : this.viewers).toArray(new CPlayer[this.viewers.size()]);
  Player[] players=new Player[cPlayers.length];
  for (int x=0; x < cPlayers.length; x++) {
    Player bukkitPlayer=cPlayers[x].getBukkitPlayer();
    if (!bukkitPlayer.getWorld().equals(world))     continue;
    players[x]=bukkitPlayer;
  }
  return players;
}

Fixed version (ground truth):
protected Player[] getTargets(){
  CPlayer[] cPlayers=(this.viewers.size() == 0 ? Core.getPlayerManager().getOnlinePlayers() : this.viewers).toArray(new CPlayer[this.viewers.size()]);
  Player[] players=new Player[cPlayers.length];
  for (int x=0; x < cPlayers.length; x++) {
    Player bukkitPlayer=cPlayers[x].getBukkitPlayer();
    if (this.world != null && !bukkitPlayer.getWorld().equals(world))     continue;
    players[x]=bukkitPlayer;
  }
  return players;
}
Program: 86322
Project: 86322
Buggy source:
public void move(Point point){
  if (!spawned)   throw new IllegalStateException("String_Node_Str");
  final Point location1=this.location;
  this.location=point;
  AbstractPacket packet;
  if (location1.distanceSquared(point) > 16) {
    WrapperPlayServerEntityMoveLook packet1=new WrapperPlayServerEntityMoveLook();
    packet1.setEntityID(id);
    packet1.setDx(location1.getX() - point.getX());
    packet1.setDy(location1.getY() - point.getY());
    packet1.setDz(location1.getZ() - point.getZ());
    packet1.setPitch(point.getPitch());
    packet1.setYaw(point.getYaw());
    packet=packet1;
  }
 else {
    WrapperPlayServerEntityTeleport packet1=new WrapperPlayServerEntityTeleport();
    packet1.setEntityID(id);
    packet1.setX(point.getX());
    packet1.setY(point.getY());
    packet1.setZ(point.getZ());
    packet1.setPitch(point.getPitch());
    packet1.setYaw(point.getYaw());
    packet=packet1;
  }
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
}

Fixed version (ground truth):
public void move(Point point){
  if (!spawned)   throw new IllegalStateException("String_Node_Str");
  final Point location1=this.location;
  this.location=point;
  AbstractPacket packet;
  if (Core.DEBUG)   log.info("String_Node_Str" + location1.toString() + "String_Node_Str"+ point.toString()+ "String_Node_Str"+ location1.distance(point));
  if (location1.distanceSquared(point) <= 16) {
    if (Core.DEBUG)     log.info("String_Node_Str" + id + "String_Node_Str"+ getClass().getSimpleName());
    WrapperPlayServerEntityMoveLook packet1=new WrapperPlayServerEntityMoveLook();
    packet1.setEntityID(id);
    packet1.setDx(location1.getX() - point.getX());
    packet1.setDy(location1.getY() - point.getY());
    packet1.setDz(location1.getZ() - point.getZ());
    packet1.setPitch(point.getPitch());
    packet1.setYaw(point.getYaw());
    packet=packet1;
  }
 else {
    if (Core.DEBUG)     log.info("String_Node_Str" + id + "String_Node_Str"+ getClass().getSimpleName());
    WrapperPlayServerEntityTeleport packet1=new WrapperPlayServerEntityTeleport();
    packet1.setEntityID(id);
    packet1.setX(point.getX());
    packet1.setY(point.getY());
    packet1.setZ(point.getZ());
    packet1.setPitch(point.getPitch());
    packet1.setYaw(point.getYaw());
    packet=packet1;
  }
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
}
Program: 86323
Project: 86323
Buggy source:
public void spawn(){
  if (spawned)   throw new IllegalStateException("String_Node_Str");
  ProtocolLibrary.getProtocolManager().addPacketListener(createNewInteractWatcher());
  WrapperPlayServerSpawnEntityLiving packet=getSpawnPacket();
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  spawned=true;
  log.info("String_Node_Str" + packet.getType() + "String_Node_Str"+ id);
}

Fixed version (ground truth):
public void spawn(){
  if (spawned)   throw new IllegalStateException("String_Node_Str");
  ProtocolLibrary.getProtocolManager().addPacketListener(createNewInteractWatcher());
  WrapperPlayServerSpawnEntityLiving packet=getSpawnPacket();
  for (  Player player : getTargets()) {
    packet.sendPacket(player);
  }
  spawned=true;
  if (Core.DEBUG)   log.info("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ id);
}
Program: 86324
Project: 86324
Buggy source:
protected List<String> handleTabComplete(CommandSender sender,Command command,String alias,String[] args){
  List<String> ss=new ArrayList<>();
  String arg=args.length > 0 ? args[args.length - 1] : "String_Node_Str";
  for (  Player player : Bukkit.getOnlinePlayers()) {
    String name1=player.getName();
    if (name1.startsWith(arg))     ss.add(name1);
  }
  return ss;
}

Fixed version (ground truth):
protected List<String> handleTabComplete(CommandSender sender,Command command,String alias,String[] args){
  List<String> ss=new ArrayList<>();
  String arg=args.length > 0 ? args[args.length - 1].toLowerCase() : "String_Node_Str";
  for (  Player player : Bukkit.getOnlinePlayers()) {
    String name1=player.getName();
    if (name1.toLowerCase().startsWith(arg))     ss.add(name1);
  }
  return ss;
}
Program: 86325
Project: 86325
Buggy source:
@Override public void reloadPermissions(){
  save();
  reloadGroups();
  Iterator<WeakReference<GroupReloadObserver>> iterator=groupReloadObservers.iterator();
  while (iterator.hasNext()) {
    GroupReloadObserver observer=iterator.next().get();
    if (observer == null) {
      iterator.remove();
      continue;
    }
    observer.onReloadPermissions(this);
  }
}

Fixed version (ground truth):
@Override public void reloadPermissions(){
  reloadGroups();
  Iterator<WeakReference<GroupReloadObserver>> iterator=groupReloadObservers.iterator();
  while (iterator.hasNext()) {
    GroupReloadObserver observer=iterator.next().get();
    if (observer == null) {
      iterator.remove();
      continue;
    }
    observer.onReloadPermissions(this);
  }
}
Program: 86326
Project: 86326
Buggy source:
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onPlayerInteractBlock(PlayerInteractEvent event){
  if (shouldIgnoreLimitation(event))   return;
switch (event.getAction()) {
case LEFT_CLICK_BLOCK:
case RIGHT_CLICK_BLOCK:
    break;
default :
  return;
}
switch (event.getClickedBlock().getType()) {
case TRAP_DOOR:
case TRAPPED_CHEST:
case CHEST:
case IRON_DOOR:
case WOOD_DOOR:
case ANVIL:
case BED:
case BED_BLOCK:
case BEACON:
case BREWING_STAND:
case REDSTONE_COMPARATOR_OFF:
case REDSTONE_COMPARATOR_ON:
case LEVER:
case DIODE_BLOCK_OFF:
case DIODE_BLOCK_ON:
case STONE_BUTTON:
case WOOD_BUTTON:
case BURNING_FURNACE:
case FURNACE:
case WORKBENCH:
case CAULDRON:
case ENCHANTMENT_TABLE:
case NOTE_BLOCK:
case JUKEBOX:
case CAKE_BLOCK:
case ENDER_PORTAL_FRAME:
break;
default :
return;
}
event.setCancelled(true);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onPlayerInteractBlock(PlayerInteractEvent event){
  if (shouldIgnoreLimitation(event))   return;
switch (event.getAction()) {
case LEFT_CLICK_BLOCK:
case RIGHT_CLICK_BLOCK:
    break;
default :
  return;
}
switch (event.getClickedBlock().getType()) {
case TRAP_DOOR:
case TRAPPED_CHEST:
case CHEST:
case IRON_DOOR:
case WOOD_DOOR:
case ANVIL:
case BED:
case BED_BLOCK:
case BEACON:
case BREWING_STAND:
case REDSTONE_COMPARATOR_OFF:
case REDSTONE_COMPARATOR_ON:
case LEVER:
case DIODE_BLOCK_OFF:
case DIODE_BLOCK_ON:
case STONE_BUTTON:
case WOOD_BUTTON:
case BURNING_FURNACE:
case FURNACE:
case WORKBENCH:
case CAULDRON:
case ENCHANTMENT_TABLE:
case NOTE_BLOCK:
case JUKEBOX:
case CAKE_BLOCK:
case ENDER_PORTAL_FRAME:
case WOODEN_DOOR:
case ENDER_CHEST:
case DISPENSER:
case DROPPER:
break;
default :
return;
}
event.setCancelled(true);
}
Program: 86327
Project: 86327
Buggy source:
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onPlayerMove(PlayerMoveEvent event){
  if (event.getTo().getY() > 0)   return;
  if (shouldIgnoreLimitation(event))   return;
  event.setCancelled(true);
  Player player=event.getPlayer();
  player.teleport(Hub.getInstance().getSpawnHandler().getSpawn());
  player.setFallDistance(0f);
  Core.getOnlinePlayer(player).playSoundForPlayer(Sound.CHICKEN_EGG_POP);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onPlayerMove(PlayerMoveEvent event){
  if (event.getTo().getY() > 1)   return;
  if (shouldIgnoreLimitation(event))   return;
  event.setCancelled(true);
  Player player=event.getPlayer();
  player.teleport(Hub.getInstance().getSpawnHandler().getSpawn());
  player.setFallDistance(0f);
  Core.getOnlinePlayer(player).playSoundForPlayer(Sound.CHICKEN_EGG_POP);
}
Program: 86328
Project: 86328
Buggy source:
@Override protected void handleCommand(CPlayer sender,String[] args) throws CommandException {
  Punishments module=Core.getModule(Punishments.class);
  String name=clazz.getSimpleName().toLowerCase();
  super.handleCommand(sender,args);
  if (args.length < 2)   throw new ArgumentRequirementException("String_Node_Str" + name + "String_Node_Str");
  String target=args[0];
  String reason=Joiner.on("String_Node_Str").join(Arrays.copyOfRange(args,1,args.length));
  COfflinePlayer targetPlayer=getTargetByArg(target);
  if (targetPlayer == null)   throw new ArgumentRequirementException("String_Node_Str");
  try {
    punishmentManager.punish(targetPlayer,reason,sender);
  }
 catch (  PunishmentException e) {
    sender.sendMessage(module.getFormat("String_Node_Str",new String[]{"String_Node_Str",e.getMessage()}));
  }
  sender.sendMessage(module.getFormat("String_Node_Str",new String[]{"String_Node_Str",name},new String[]{"String_Node_Str",targetPlayer.getName()},new String[]{"String_Node_Str",reason}));
}

Fixed version (ground truth):
@Override protected void handleCommand(CPlayer sender,String[] args) throws CommandException {
  Punishments module=Core.getModule(Punishments.class);
  String name=clazz.getSimpleName().toLowerCase();
  super.handleCommand(sender,args);
  if (args.length < 2)   throw new ArgumentRequirementException("String_Node_Str" + name + "String_Node_Str");
  String target=args[0];
  String reason=Joiner.on("String_Node_Str").join(Arrays.copyOfRange(args,1,args.length));
  COfflinePlayer targetPlayer=getTargetByArg(target);
  if (targetPlayer == null)   throw new ArgumentRequirementException("String_Node_Str");
  try {
    punishmentManager.punish(targetPlayer,reason,sender);
  }
 catch (  PunishmentException e) {
    sender.sendMessage(module.getFormat("String_Node_Str",new String[]{"String_Node_Str",e.getMessage()}));
    return;
  }
  sender.sendMessage(module.getFormat("String_Node_Str",new String[]{"String_Node_Str",name},new String[]{"String_Node_Str",targetPlayer.getName()},new String[]{"String_Node_Str",reason}));
}
Program: 86329
Project: 86329
Buggy source:
@Override void onPunish(CPlayer player,Ban activePunishmentFor){
  player.getBukkitPlayer().kickPlayer(Core.getModule(Punishments.class).getFormat("String_Node_Str",false,new String[]{"String_Node_Str",activePunishmentFor.getClass().getSimpleName()},new String[]{"String_Node_Str",activePunishmentFor.getMessage()},new String[]{"String_Node_Str",activePunishmentFor.getIssuer().getName()},new String[]{"String_Node_Str",PRETTY_TIME_FORMATTER.format(activePunishmentFor.getDateIssued())}));
}

Fixed version (ground truth):
@Override void onPunish(CPlayer player,Ban activePunishmentFor){
  player.getBukkitPlayer().kickPlayer(Core.getModule(Punishments.class).getFormat("String_Node_Str",false,new String[]{"String_Node_Str",activePunishmentFor.getClass().getSimpleName()},new String[]{"String_Node_Str",activePunishmentFor.getMessage()},new String[]{"String_Node_Str",activePunishmentFor.getIssuer().getName()},new String[]{"String_Node_Str",PRETTY_TIME_FORMATTER.format(activePunishmentFor.getDateIssued())},new String[]{"String_Node_Str","String_Node_Str"}));
}
Program: 86330
Project: 86330
Buggy source:
@Override public T getActivePunishmentFor(COfflinePlayer target){
  if (target instanceof CPlayer)   return activePunishments.get(target);
  for (  T t : getPunishmentsFor(target)) {
    if (t.isActive())     return t;
  }
  return null;
}

Fixed version (ground truth):
@Override public T getActivePunishmentFor(COfflinePlayer target){
  if (target instanceof CPlayer && activePunishments.containsKey(target))   return activePunishments.get(target);
  for (  T t : getPunishmentsFor(target)) {
    if (t.isActive())     return t;
  }
  return null;
}
Program: 86331
Project: 86331
Buggy source:
@Override void onPunish(CPlayer player,TemporaryBan activePunishmentFor){
  player.getBukkitPlayer().kickPlayer(Core.getModule(Punishments.class).getFormat("String_Node_Str",false,new String[]{"String_Node_Str",activePunishmentFor.getClass().getSimpleName()},new String[]{"String_Node_Str",activePunishmentFor.getMessage()},new String[]{"String_Node_Str",activePunishmentFor.getIssuer().getName()},new String[]{"String_Node_Str",PRETTY_TIME_FORMATTER.format(activePunishmentFor.getDateIssued())}));
}

Fixed version (ground truth):
@Override void onPunish(CPlayer player,TemporaryBan activePunishmentFor){
  player.getBukkitPlayer().kickPlayer(Core.getModule(Punishments.class).getFormat("String_Node_Str",false,new String[]{"String_Node_Str",activePunishmentFor.getClass().getSimpleName()},new String[]{"String_Node_Str",activePunishmentFor.getMessage()},new String[]{"String_Node_Str",activePunishmentFor.getIssuer().getName()},new String[]{"String_Node_Str",PRETTY_TIME_FORMATTER.format(activePunishmentFor.getDateIssued())},new String[]{"String_Node_Str","String_Node_Str" + PRETTY_TIME_FORMATTER.format(new Date(activePunishmentFor.getDateIssued().getTime() + (activePunishmentFor.getLengthInSeconds() * 1000)))}));
}
Program: 86332
Project: 86332
Buggy source:
@Override protected void handleCommand(CPlayer sender,String[] args) throws CommandException {
}

Fixed version (ground truth):
@Override protected void handleCommand(CPlayer sender,String[] args) throws CommandException {
  String name=clazz.getSimpleName().toLowerCase();
  if (!sender.hasPermission("String_Node_Str" + name))   throw new PermissionException("String_Node_Str" + name + "String_Node_Str");
}
Program: 86333
Project: 86333
Buggy source:
static void handleCrossServer(COfflinePlayer sender,String message,Channel channel) throws ChannelException {
  IChannelManager cManager=CoreChat.getInstance().getChannelManager();
  String formatMessage=channel.formatMessage(sender,message);
  String s=channel.formatMessage(sender,message);
  for (  CPlayer cPlayer : cManager.getListeners(channel)) {
    cPlayer.sendMessage(s);
  }
  for (  ChatterObserver chatterObserver : cManager.getChatterObservers()) {
    chatterObserver.onMessageSent(sender,channel,message);
  }
}

Fixed version (ground truth):
static void handleCrossServer(COfflinePlayer sender,String message,Channel channel) throws ChannelException {
  IChannelManager cManager=CoreChat.getInstance().getChannelManager();
  String s=channel.formatMessage(sender,message);
  for (  CPlayer cPlayer : cManager.getListeners(channel)) {
    cPlayer.sendMessage(s);
  }
  for (  ChatterObserver chatterObserver : cManager.getChatterObservers()) {
    chatterObserver.onMessageSent(sender,channel,message);
  }
}
Program: 86334
Project: 86334
Buggy source:
/** 
 * Registers sub commands with the command and re-creates the help command.
 * @param subCommands The sub-commands you wish to register.
 */
public final void registerSubCommand(ModuleCommand... subCommands){
  for (  ModuleCommand subCommand : subCommands) {
    this.subCommands.put(subCommand.getName(),subCommand);
    subCommand.setSuperCommand(this);
  }
  final Map<String,ModuleCommand> subCommandsLV=this.subCommands;
  final ModuleCommand superHelpCommand=this;
  this.subCommands.put("String_Node_Str",new ModuleCommand("String_Node_Str"){
    @Override public void handleCommandUnspecific(    CommandSender sender,    String[] args){
      StringBuilder builder=new StringBuilder();
      for (      Map.Entry<String,ModuleCommand> stringModuleCommandEntry : subCommandsLV.entrySet()) {
        builder.append(stringModuleCommandEntry.getKey()).append("String_Node_Str");
      }
      String s=builder.toString();
      sender.sendMessage(ChatColor.AQUA + "String_Node_Str" + ChatColor.DARK_AQUA+ superHelpCommand.getFormattedName()+ ChatColor.YELLOW+ "String_Node_Str"+ s.substring(0,s.length() - 1)+ "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Registers sub commands with the command and re-creates the help command.
 * @param subCommands The sub-commands you wish to register.
 */
public final void registerSubCommand(ModuleCommand... subCommands){
  for (  ModuleCommand subCommand : subCommands) {
    this.subCommands.put(subCommand.getName(),subCommand);
    subCommand.setSuperCommand(this);
  }
  regenerateHelpCommand();
}
Program: 86335
Project: 86335
Buggy source:
@SuppressWarnings("String_Node_Str") @Override @Synchronized public void updateHeartbeat(){
  long time=new Date().getTime();
  Iterator<NetworkServer> iterator=servers.iterator();
  while (iterator.hasNext())   if (time - iterator.next().getLastPing().getTime() > 10000)   iterator.remove();
  JSONObject object=new JSONObject();
  JSONArray uuids=new JSONArray();
  for (  CPlayer onlinePlayer : Core.getOnlinePlayers()) {
    uuids.add(onlinePlayer.getUniqueIdentifier().toString());
  }
  object.put(HEARTBEAT_PLAYERS_KEY,uuids);
  MessageRequest messageRequest;
  try {
    messageRequest=new MessageRequest(Collections.EMPTY_LIST,NETWORK_MANAGER_CHANNEL,object.toJSONString());
  }
 catch (  UnsupportedEncodingException e) {
    return;
  }
  boolean completedHeartbeat=false;
  int attempts=0;
  while (attempts < HEARTBEAT_ATTEMPTS_MAX) {
    attempts++;
    try {
      connect.request(messageRequest);
    }
 catch (    RequestException e) {
      e.printStackTrace();
      continue;
    }
    completedHeartbeat=true;
    break;
  }
  updateThisServer();
  if (!completedHeartbeat)   throw new RuntimeException("String_Node_Str");
  resetHeartbeat(4L,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override @Synchronized public void updateHeartbeat(){
  long time=new Date().getTime();
  Iterator<NetworkServer> iterator=servers.iterator();
  while (iterator.hasNext()) {
    NetworkServer next=iterator.next();
    if (next.getName().equals(connect.getSettings().getUsername()))     continue;
    if (time - next.getLastPing().getTime() > 10000) {
      iterator.remove();
      for (      NetworkServerDiscoverObserver discoverObserver : discoverObservers) {
        discoverObserver.onNetworkServerRemove(next);
      }
    }
  }
  JSONObject object=new JSONObject();
  JSONArray uuids=new JSONArray();
  for (  CPlayer onlinePlayer : Core.getOnlinePlayers()) {
    uuids.add(onlinePlayer.getUniqueIdentifier().toString());
  }
  object.put(HEARTBEAT_PLAYERS_KEY,uuids);
  MessageRequest messageRequest;
  try {
    messageRequest=new MessageRequest(Collections.EMPTY_LIST,NETWORK_MANAGER_CHANNEL,object.toJSONString());
  }
 catch (  UnsupportedEncodingException e) {
    return;
  }
  boolean completedHeartbeat=false;
  int attempts=0;
  while (attempts < HEARTBEAT_ATTEMPTS_MAX) {
    attempts++;
    try {
      connect.request(messageRequest);
    }
 catch (    RequestException e) {
      e.printStackTrace();
      continue;
    }
    completedHeartbeat=true;
    break;
  }
  updateThisServer();
  if (!completedHeartbeat)   throw new RuntimeException("String_Node_Str");
  resetHeartbeat(4L,TimeUnit.SECONDS);
}
Program: 86336
Project: 86336
Buggy source:
private void receivedUpdate(String server,List<UUID> uuids){
  LilyPadServer s;
  boolean shouldAdd=false;
  if ((s=(LilyPadServer)getServer(server)) == null) {
    s=new LilyPadServer(server,this);
    shouldAdd=true;
  }
  s.setLastPing(new Date());
  List<COfflinePlayer> players=s.getPlayers();
  Iterator<COfflinePlayer> playerIterator=players.iterator();
  List<UUID> uuidsWeHave=new ArrayList<>();
  while (playerIterator.hasNext()) {
    COfflinePlayer offlinePlayer=playerIterator.next();
    UUID uniqueIdentifier=offlinePlayer.getUniqueIdentifier();
    if (!uuids.contains(uniqueIdentifier))     playerIterator.remove();
 else     uuidsWeHave.add(uniqueIdentifier);
  }
  for (  UUID uuid : uuids) {
    if (uuidsWeHave.contains(uuid))     continue;
    players.add(Core.getOfflinePlayerByUUID(uuid));
  }
  if (shouldAdd)   this.servers.add(s);
}

Fixed version (ground truth):
private void receivedUpdate(String server,List<UUID> uuids){
  LilyPadServer s;
  boolean shouldAdd=false;
  if ((s=(LilyPadServer)getServer(server)) == null) {
    s=new LilyPadServer(server,this);
    shouldAdd=true;
  }
  s.setLastPing(new Date());
  List<COfflinePlayer> players=s.getPlayers();
  Iterator<COfflinePlayer> playerIterator=players.iterator();
  List<UUID> uuidsWeHave=new ArrayList<>();
  while (playerIterator.hasNext()) {
    COfflinePlayer offlinePlayer=playerIterator.next();
    UUID uniqueIdentifier=offlinePlayer.getUniqueIdentifier();
    if (!uuids.contains(uniqueIdentifier))     playerIterator.remove();
 else     uuidsWeHave.add(uniqueIdentifier);
  }
  for (  UUID uuid : uuids) {
    if (uuidsWeHave.contains(uuid))     continue;
    players.add(Core.getOfflinePlayerByUUID(uuid));
  }
  if (shouldAdd) {
    this.servers.add(s);
    Core.logInfo("String_Node_Str" + s.getName() + "String_Node_Str");
    for (    NetworkServerDiscoverObserver discoverObserver : discoverObservers) {
      discoverObserver.onNetworkServerDiscover(s);
    }
  }
}
Program: 86337
Project: 86337
Buggy source:
public LilyPadNetworkManager(){
  connect=Core.getInstance().getServer().getServicesManager().getRegistration(Connect.class).getProvider();
  if (connect == null)   throw new IllegalStateException("String_Node_Str");
  connect.registerEvents(this);
  LilyPadServer thisServer=new LilyPadServer(connect.getSettings().getUsername(),this);
  servers.add(thisServer);
  updateThisServer();
}

Fixed version (ground truth):
public LilyPadNetworkManager(){
  connect=Core.getInstance().getServer().getServicesManager().getRegistration(Connect.class).getProvider();
  if (connect == null)   throw new IllegalStateException("String_Node_Str");
  connect.registerEvents(this);
  LilyPadServer thisServer=new LilyPadServer(connect.getSettings().getUsername(),this);
  servers.add(thisServer);
  updateThisServer();
  scheduleHeartbeat(5l,TimeUnit.SECONDS);
}
Program: 86338
Project: 86338
Buggy source:
private void scheduleHeartbeat(Long time,TimeUnit unit){
  long ticks=unit.convert(time,TimeUnit.SECONDS) * 20;
  this.heartbeatScheduled=Bukkit.getScheduler().runTaskTimerAsynchronously(Core.getInstance(),new CPlayerManagerSaveTask(Core.getPlayerManager()),ticks,ticks);
}

Fixed version (ground truth):
private void scheduleHeartbeat(Long time,TimeUnit unit){
  long ticks=unit.convert(time,TimeUnit.SECONDS) * 20;
  this.heartbeatScheduled=Bukkit.getScheduler().runTaskTimerAsynchronously(Core.getInstance(),new NetworkUpdaterTask(this),ticks,ticks);
}
Program: 86339
Project: 86339
Buggy source:
@Override protected void onModuleEnable(){
  registerCommand(new PluginsCommand());
  registerCommand(new NickNameCommand());
  tabColorManager=new TabColorManager();
  Core.getPermissionsManager().registerObserver(tabColorManager);
  registerListener(tabColorManager);
}

Fixed version (ground truth):
@Override protected void onModuleEnable(){
  registerCommand(new PluginsCommand());
  registerCommand(new NickNameCommand());
  registerCommand(new LagInfoCommand());
  if (Core.getNetworkManager() != null)   registerCommand(new ServerCommand());
  tabColorManager=new TabColorManager();
  Core.getPermissionsManager().registerObserver(tabColorManager);
  registerListener(tabColorManager);
}
Program: 86340
Project: 86340
Buggy source:
@Override protected void handleCommandUnspecific(CommandSender sender,String[] args) throws CommandException {
}

Fixed version (ground truth):
@Override protected void handleCommandUnspecific(CommandSender sender,String[] args) throws CommandException {
  long memoryAv=Runtime.getRuntime().maxMemory();
  long usedMemory=Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
  long freeMemory=memoryAv - usedMemory;
  sender.sendMessage(formatStat("String_Node_Str",ByteLevels.formatBytes(memoryAv)));
  sender.sendMessage(formatStat("String_Node_Str",ByteLevels.formatBytes(usedMemory)));
  sender.sendMessage(formatStat("String_Node_Str",ByteLevels.formatBytes(freeMemory)));
  sender.sendMessage(formatStat("String_Node_Str",String.valueOf(Core.getPlayerManager().getOnlinePlayers().size())));
}
Program: 86342
Project: 86342
Buggy source:
@Override @SneakyThrows public T deserialize(Object object,Class<T> modelClass){
  T t=modelClass.newInstance();
  DBObject dbObject=(DBObject)object;
  for (  String key : dbObject.keySet()) {
    Field declaredField=modelClass.getDeclaredField(key);
    if (declaredField == null)     continue;
    declaredField.setAccessible(true);
    declaredField.set(t,applyTypeFiltersFromDB(dbObject.get(key),declaredField.getType()));
  }
  return t;
}

Fixed version (ground truth):
@Override @SneakyThrows public T deserialize(Object object,Class<T> modelClass){
  T t=modelClass.newInstance();
  DBObject dbObject=(DBObject)object;
  for (  String key : dbObject.keySet()) {
    Field declaredField;
    try {
      declaredField=modelClass.getDeclaredField(key);
    }
 catch (    NoSuchFieldException e) {
      continue;
    }
    declaredField.setAccessible(true);
    declaredField.set(t,applyTypeFiltersFromDB(dbObject.get(key),declaredField.getType()));
  }
  return t;
}
Program: 86343
Project: 86343
Buggy source:
@Override public final void onEnable(){
  instance=this;
  try {
    saveDefaultConfig();
    for (    Player player : Bukkit.getOnlinePlayers()) {
      player.kickPlayer("String_Node_Str");
    }
    databaseConfiguration=new YAMLConfigurationFile(this,"String_Node_Str");
    databaseConfiguration.reloadConfig();
    databaseConfiguration.saveDefaultConfig();
    try {
      provider=(Provider)Class.forName(getConfig().getString("String_Node_Str")).newInstance();
    }
 catch (    Exception e) {
      provider=new DefaultProvider();
    }
    this.playerManager=provider.getNewPlayerManager(this);
    this.networkManager=provider.getNewNetworkManager(this);
    this.permissionsManager=provider.getNewPermissionsManager(this,this.playerManager.getDatabase(),this.playerManager);
    this.netFileManager=provider.getNewNetFileManager(this);
    this.modelManager=provider.getNewModelManager(this.playerManager.getDatabase());
  }
 catch (  Throwable t) {
    t.printStackTrace();
    Bukkit.getPluginManager().disablePlugin(this);
  }
}

Fixed version (ground truth):
@Override public final void onEnable(){
  instance=this;
  try {
    saveDefaultConfig();
    for (    Player player : Bukkit.getOnlinePlayers()) {
      player.kickPlayer("String_Node_Str");
    }
    databaseConfiguration=new YAMLConfigurationFile(this,"String_Node_Str");
    databaseConfiguration.reloadConfig();
    databaseConfiguration.saveDefaultConfig();
    try {
      provider=(Provider)Class.forName(getConfig().getString("String_Node_Str")).newInstance();
    }
 catch (    Exception e) {
      provider=new DefaultProvider();
    }
    this.cDatabase=provider.getNewDatabase(this);
    this.cDatabase.connect();
    this.playerManager=provider.getNewPlayerManager(this);
    this.networkManager=provider.getNewNetworkManager(this);
    this.permissionsManager=provider.getNewPermissionsManager(this,this.playerManager);
    this.netFileManager=provider.getNewNetFileManager(this);
    this.modelManager=provider.getNewModelManager(this);
  }
 catch (  Throwable t) {
    t.printStackTrace();
    Bukkit.getPluginManager().disablePlugin(this);
  }
}