nus-yam/ex-repair huggingface dataset:
Program: 32549
Project: 32549
Buggy source:
private void addOptionsHeaders(HTTPRequest req,GcsFileOptions options){
  if (options == null) {
    return;
  }
  if (options.getMimeType() != null) {
    req.setHeader(new HTTPHeader(CONTENT_TYPE,options.getMimeType()));
  }
  if (options.getAcl() != null) {
    req.setHeader(new HTTPHeader(ACL,options.getAcl()));
  }
  if (options.getCacheControl() != null) {
    req.setHeader(new HTTPHeader(CACHE_CONTROL,options.getCacheControl()));
  }
  if (options.getContentDisposition() != null) {
    req.setHeader(new HTTPHeader(CONTENT_DISPOSITION,options.getCacheControl()));
  }
  if (options.getContentEncoding() != null) {
    req.setHeader(new HTTPHeader(CONTENT_ENCODING,options.getContentEncoding()));
  }
  for (  Entry<String,String> entry : options.getUserMetadata().entrySet()) {
    req.setHeader(new HTTPHeader("String_Node_Str" + entry.getKey(),entry.getValue()));
  }
}

Fixed version (ground truth):
private void addOptionsHeaders(HTTPRequest req,GcsFileOptions options){
  if (options == null) {
    return;
  }
  if (options.getMimeType() != null) {
    req.setHeader(new HTTPHeader(CONTENT_TYPE,options.getMimeType()));
  }
  if (options.getAcl() != null) {
    req.setHeader(new HTTPHeader(ACL,options.getAcl()));
  }
  if (options.getCacheControl() != null) {
    req.setHeader(new HTTPHeader(CACHE_CONTROL,options.getCacheControl()));
  }
  if (options.getContentDisposition() != null) {
    req.setHeader(new HTTPHeader(CONTENT_DISPOSITION,options.getContentDisposition()));
  }
  if (options.getContentEncoding() != null) {
    req.setHeader(new HTTPHeader(CONTENT_ENCODING,options.getContentEncoding()));
  }
  for (  Entry<String,String> entry : options.getUserMetadata().entrySet()) {
    req.setHeader(new HTTPHeader("String_Node_Str" + entry.getKey(),entry.getValue()));
  }
}
Program: 32550
Project: 32550
Buggy source:
@Override public int hashCode(){
  int result=previousOutput.hashCode();
  result=31 * result + (int)(sequence ^ (sequence >>> 32));
  result=31 * result + scriptSignature.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=previousOutput == null ? 1 : previousOutput.hashCode();
  result=31 * result + (int)(sequence ^ (sequence >>> 32));
  result=31 * result + scriptSignature.hashCode();
  return result;
}
Program: 32551
Project: 32551
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Input input=(Input)o;
  if (sequence != input.sequence) {
    return false;
  }
  if (previousOutput != input.previousOutput) {
    return false;
  }
  if (previousOutput != null) {
    if (!previousOutput.equals(input.previousOutput)) {
      return false;
    }
  }
  return scriptSignature.equals(input.scriptSignature);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Input input=(Input)o;
  if (sequence != input.sequence) {
    return false;
  }
  if (previousOutput == null) {
    if (input.previousOutput != null) {
      return false;
    }
  }
 else   if (!previousOutput.equals(input.previousOutput)) {
    return false;
  }
  return scriptSignature.equals(input.scriptSignature);
}
Program: 32553
Project: 32553
Buggy source:
public Object getSpawnPacket(){
  Class<?> Entity=Reflections.getNMSClass("String_Node_Str");
  Class<?> EntityLiving=Reflections.getNMSClass("String_Node_Str");
  Class<?> EntityEnderDragon=Reflections.getNMSClass("String_Node_Str");
  try {
    dragon=EntityEnderDragon.getConstructor(Reflections.getNMSClass("String_Node_Str")).newInstance(world);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",double.class,double.class,double.class,float.class,float.class).invoke(dragon,x,y,z,pitch,yaw);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",boolean.class).invoke(dragon,visible);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str").invoke(dragon,name);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",float.class).invoke(dragon,health);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,xvel);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,yvel);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,zvel);
    this.id=(Integer)Reflections.getMethod(EntityEnderDragon,"String_Node_Str").invoke(dragon);
    Class<?> packetClass=Reflections.getNMSClass("String_Node_Str");
    return packetClass.getConstructor(new Class<?>[]{EntityLiving}).newInstance(dragon);
  }
 catch (  Exception e) {
    if (FunnyLogger.exception(e.getCause())) {
      e.printStackTrace();
    }
    return null;
  }
}

Fixed version (ground truth):
public Object getSpawnPacket(){
  Class<?> Entity=Reflections.getNMSClass("String_Node_Str");
  Class<?> EntityLiving=Reflections.getNMSClass("String_Node_Str");
  Class<?> EntityEnderDragon=Reflections.getNMSClass("String_Node_Str");
  try {
    dragon=EntityEnderDragon.getConstructor(Reflections.getNMSClass("String_Node_Str")).newInstance(world);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",double.class,double.class,double.class,float.class,float.class).invoke(dragon,x,y,z,pitch,yaw);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",boolean.class).invoke(dragon,visible);
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",Reflections.USE_PRE_13_METHODS ? String.class : Reflections.getNMSClass("String_Node_Str")).invoke(dragon,Reflections.USE_PRE_13_METHODS ? name : NotificationUtil.createBaseComponent(name,false));
    Reflections.getMethod(EntityEnderDragon,"String_Node_Str",float.class).invoke(dragon,health);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,xvel);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,yvel);
    Reflections.getField(Entity,"String_Node_Str").set(dragon,zvel);
    this.id=(Integer)Reflections.getMethod(EntityEnderDragon,"String_Node_Str").invoke(dragon);
    Class<?> packetClass=Reflections.getNMSClass("String_Node_Str");
    return packetClass.getConstructor(new Class<?>[]{EntityLiving}).newInstance(dragon);
  }
 catch (  Exception e) {
    if (FunnyLogger.exception(e.getCause())) {
      e.printStackTrace();
    }
    return null;
  }
}
Program: 32556
Project: 32556
Buggy source:
public static void init(){
  tryInit(PLUGIN_WORLDGUARD,() -> {
    try {
      Class.forName("String_Node_Str");
      Class.forName("String_Node_Str");
      WorldGuardHook.initWorldGuard();
    }
 catch (    final ClassNotFoundException e) {
      FunnyLogger.warning("String_Node_Str");
    }
  }
);
  tryInit(PLUGIN_VAULT,VaultHook::initEconomyHook);
  tryInit(PLUGIN_PLACEHOLDERAPI,PlaceholderAPIHook::initPlaceholderHook);
}

Fixed version (ground truth):
public static void init(){
  tryInit(PLUGIN_WORLDGUARD,() -> {
    try {
      Class.forName("String_Node_Str");
      Class.forName("String_Node_Str");
      WorldGuardHook.initWorldGuard();
    }
 catch (    final ClassNotFoundException e) {
      FunnyLogger.warning("String_Node_Str");
    }
  }
);
  tryInit(PLUGIN_VAULT,VaultHook::initEconomyHook);
  tryInit(PLUGIN_PLACEHOLDERAPI,PlaceholderAPIHook::initPlaceholderHook);
  tryInit(PLUGIN_FUNNYTAB,FunnyTabHook::initFunnyDisabler);
}
Program: 32557
Project: 32557
Buggy source:
public static AbstractTablist createTablist(final Map<Integer,String> pattern,final String header,final String footer,final int ping,final Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return tablist;
    }
  }
  if ("String_Node_Str".equals(Reflections.getFixedVersion())) {
    final AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_8_R1.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
  if ("String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion())|| "String_Node_Str".equals(Reflections.getFixedVersion())) {
    final AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_8_R3.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
 else   if ("String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion())) {
    final AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_10_R1.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static AbstractTablist createTablist(Map<Integer,String> pattern,String header,String footer,int ping,Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return tablist;
    }
  }
  if ("String_Node_Str".equals(Reflections.getFixedVersion())) {
    AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_8_R1.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
 else   if ("String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion())|| "String_Node_Str".equals(Reflections.getFixedVersion())) {
    AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_8_R3.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
 else   if ("String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion()) || "String_Node_Str".equals(Reflections.getFixedVersion())) {
    AbstractTablist tablist=new net.dzikoysk.funnyguilds.util.element.tablist.impl.v1_10_R1.TablistImpl(pattern,header,footer,ping,player);
    TABLIST_CACHE.add(tablist);
    return tablist;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 32558
Project: 32558
Buggy source:
public static AbstractTablist getTablist(final Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return tablist;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public static AbstractTablist getTablist(Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return tablist;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 32559
Project: 32559
Buggy source:
protected void sendPackets(final List<Object> packets){
  final Player target=Bukkit.getPlayer(player);
  if (target == null) {
    return;
  }
  PacketSender.sendPacket(target,packets);
}

Fixed version (ground truth):
protected void sendPackets(List<Object> packets){
  Player target=Bukkit.getPlayer(player);
  if (target == null) {
    return;
  }
  PacketSender.sendPacket(target,packets);
}
Program: 32560
Project: 32560
Buggy source:
protected String putVars(String cell){
  String formatted=cell;
  final User user=User.get(player);
  if (user == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  VariableParsingResult result=this.variables.createResultFor(user);
  formatted=result.replaceInString(formatted);
  formatted=StringUtils.colored(formatted);
  String temp=Parser.parseRank(formatted);
  if (temp != null) {
    formatted=temp;
  }
  return formatted;
}

Fixed version (ground truth):
protected String putVars(String cell){
  String formatted=cell;
  User user=User.get(player);
  if (user == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  VariableParsingResult result=this.variables.createResultFor(user);
  formatted=result.replaceInString(formatted);
  formatted=StringUtils.colored(formatted);
  String temp=Parser.parseRank(formatted);
  if (temp != null) {
    formatted=temp;
  }
  return formatted;
}
Program: 32561
Project: 32561
Buggy source:
@Deprecated protected String putHeaderFooterVars(String text){
  String formatted=text;
  final Calendar time=Calendar.getInstance();
  int hour=time.get(Calendar.HOUR_OF_DAY);
  int minute=time.get(Calendar.MINUTE);
  int second=time.get(Calendar.SECOND);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(hour < 10 ? "String_Node_Str" : "String_Node_Str") + hour);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(minute < 10 ? "String_Node_Str" : "String_Node_Str") + minute);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(second < 10 ? "String_Node_Str" : "String_Node_Str") + second);
  formatted=StringUtils.colored(formatted);
  return formatted;
}

Fixed version (ground truth):
@Deprecated protected String putHeaderFooterVars(String text){
  String formatted=text;
  Calendar time=Calendar.getInstance();
  int hour=time.get(Calendar.HOUR_OF_DAY);
  int minute=time.get(Calendar.MINUTE);
  int second=time.get(Calendar.SECOND);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(hour < 10 ? "String_Node_Str" : "String_Node_Str") + hour);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(minute < 10 ? "String_Node_Str" : "String_Node_Str") + minute);
  formatted=StringUtils.replace(formatted,"String_Node_Str",(second < 10 ? "String_Node_Str" : "String_Node_Str") + second);
  formatted=StringUtils.colored(formatted);
  return formatted;
}
Program: 32562
Project: 32562
Buggy source:
public AbstractTablist(final Map<Integer,String> tablistPattern,final String header,final String footer,final int ping,final Player player){
  this.tablistPattern=tablistPattern;
  this.header=header;
  this.footer=footer;
  this.ping=ping;
  this.player=player.getUniqueId();
  DefaultTablistVariables.install(this.variables);
}

Fixed version (ground truth):
public AbstractTablist(Map<Integer,String> tablistPattern,String header,String footer,int ping,Player player){
  this.tablistPattern=tablistPattern;
  this.header=header;
  this.footer=footer;
  this.ping=ping;
  this.player=player.getUniqueId();
  DefaultTablistVariables.install(this.variables);
}
Program: 32563
Project: 32563
Buggy source:
public static void removeTablist(final Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      TABLIST_CACHE.remove(tablist);
      break;
    }
  }
}

Fixed version (ground truth):
public static void removeTablist(Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      TABLIST_CACHE.remove(tablist);
      break;
    }
  }
}
Program: 32564
Project: 32564
Buggy source:
public static boolean hasTablist(final Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean hasTablist(Player player){
  for (  AbstractTablist tablist : TABLIST_CACHE) {
    if (tablist.player.equals(player.getUniqueId())) {
      return true;
    }
  }
  return false;
}
Program: 32565
Project: 32565
Buggy source:
public boolean canBeAttacked(){
  return !(this.getAttacked() != 0 && this.getAttacked() + Settings.getConfig().warWait > System.currentTimeMillis());
}

Fixed version (ground truth):
public boolean canBeAttacked(){
  return this.getProtectionEndTime() < System.currentTimeMillis();
}
Program: 32566
Project: 32566
Buggy source:
public boolean isValid(){
  if (this.validity == this.born) {
    this.validity=System.currentTimeMillis() + Settings.getConfig().validityStart;
    this.changes();
  }
  if (this.validity == 0) {
    this.validity=System.currentTimeMillis() + Settings.getConfig().validityStart;
    this.changes();
  }
  return this.validity >= System.currentTimeMillis();
}

Fixed version (ground truth):
public boolean isValid(){
  if (this.validity == this.born || this.validity == 0) {
    this.validity=System.currentTimeMillis() + Settings.getConfig().validityStart;
    this.changes();
  }
  return this.validity >= System.currentTimeMillis();
}
Program: 32569
Project: 32569
Buggy source:
public OfflineUser getOfflineUser(){
  return new OfflineUser(this.name);
}

Fixed version (ground truth):
public OfflineUser getOfflineUser(){
  return new OfflineUser(name);
}
Program: 32570
Project: 32570
Buggy source:
public static void addGuild(Guild guild){
  if (guild == null || guild.getName() == null) {
    return;
  }
  if (get(guild.getName()) == null) {
    guilds.add(guild);
  }
}

Fixed version (ground truth):
public static void addGuild(Guild guild){
  if (guild == null || guild.getName() == null) {
    return;
  }
  if (getByName(guild.getName()) == null) {
    guilds.add(guild);
  }
}
Program: 32571
Project: 32571
Buggy source:
public static List<Guild> getGuilds(List<String> names){
  if (names == null) {
    return null;
  }
  List<Guild> list=new ArrayList<>();
  for (  String name : names) {
    Guild guild=Guild.get(name);
    if (guild != null) {
      list.add(guild);
    }
  }
  return list;
}

Fixed version (ground truth):
public static List<Guild> getGuilds(List<String> names){
  if (names == null) {
    return null;
  }
  List<Guild> list=new ArrayList<>();
  for (  String name : names) {
    Guild guild=GuildUtils.getByName(name);
    if (guild != null) {
      list.add(guild);
    }
  }
  return list;
}
Program: 32577
Project: 32577
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildDeleteEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild))) {
    return;
  }
  GuildUtils.deleteGuild(guild);
  Player owner=guild.getOwner().getPlayer();
  MessageTranslator translator=new MessageTranslator().register("String_Node_Str",guild.getName()).register("String_Node_Str",guild.getTag()).register("String_Node_Str",sender.getName()).register("String_Node_Str",sender.getName());
  if (owner != null) {
    owner.sendMessage(translator.translate(messages.adminGuildBroken));
  }
  sender.sendMessage(translator.translate(messages.deleteSuccessful));
  Bukkit.getServer().broadcastMessage(translator.translate(messages.broadcastDelete));
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildDeleteEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild))) {
    return;
  }
  GuildUtils.deleteGuild(guild);
  Player owner=guild.getOwner().getPlayer();
  MessageTranslator translator=new MessageTranslator().register("String_Node_Str",guild.getName()).register("String_Node_Str",guild.getTag()).register("String_Node_Str",sender.getName()).register("String_Node_Str",sender.getName());
  if (owner != null) {
    owner.sendMessage(translator.translate(messages.adminGuildBroken));
  }
  sender.sendMessage(translator.translate(messages.deleteSuccessful));
  Bukkit.getServer().broadcastMessage(translator.translate(messages.broadcastDelete));
}
Program: 32579
Project: 32579
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (args.length < 2) {
    sender.sendMessage(messages.generalNoNickGiven);
    return;
  }
  if (!UserUtils.playedBefore(args[1])) {
    sender.sendMessage(messages.generalNotPlayedBefore);
    return;
  }
  User user=User.get(args[1]);
  if (!guild.getMembers().contains(user)) {
    sender.sendMessage(messages.adminUserNotMemberOf);
    return;
  }
  if (guild.getOwner().equals(user)) {
    sender.sendMessage(messages.adminAlreadyLeader);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildMemberLeaderEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,user))) {
    return;
  }
  Player leaderPlayer=user.getPlayer();
  guild.setOwner(user);
  sender.sendMessage(messages.leaderSet);
  if (leaderPlayer != null) {
    leaderPlayer.sendMessage(messages.leaderOwner);
  }
  String message=messages.leaderMembers.replace("String_Node_Str",user.getName());
  for (  User member : guild.getOnlineMembers()) {
    member.getPlayer().sendMessage(message);
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (args.length < 2) {
    sender.sendMessage(messages.generalNoNickGiven);
    return;
  }
  if (!UserUtils.playedBefore(args[1])) {
    sender.sendMessage(messages.generalNotPlayedBefore);
    return;
  }
  User user=User.get(args[1]);
  if (!guild.getMembers().contains(user)) {
    sender.sendMessage(messages.adminUserNotMemberOf);
    return;
  }
  if (guild.getOwner().equals(user)) {
    sender.sendMessage(messages.adminAlreadyLeader);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildMemberLeaderEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,user))) {
    return;
  }
  Player leaderPlayer=user.getPlayer();
  guild.setOwner(user);
  sender.sendMessage(messages.leaderSet);
  if (leaderPlayer != null) {
    leaderPlayer.sendMessage(messages.leaderOwner);
  }
  String message=messages.leaderMembers.replace("String_Node_Str",user.getName());
  for (  User member : guild.getOnlineMembers()) {
    member.getPlayer().sendMessage(message);
  }
}
Program: 32580
Project: 32580
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  if (args.length < 2) {
    sender.sendMessage(messages.adminNoLivesGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  int lives;
  try {
    lives=Integer.valueOf(args[1]);
  }
 catch (  NumberFormatException e) {
    sender.sendMessage(messages.adminErrorInNumber.replace("String_Node_Str",args[1]));
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildLivesChangeEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,lives))) {
    return;
  }
  guild.setLives(lives);
  sender.sendMessage(messages.adminLivesChanged.replace("String_Node_Str",guild.getTag()).replace("String_Node_Str",Integer.toString(lives)));
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  if (args.length < 2) {
    sender.sendMessage(messages.adminNoLivesGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  int lives;
  try {
    lives=Integer.valueOf(args[1]);
  }
 catch (  NumberFormatException e) {
    sender.sendMessage(messages.adminErrorInNumber.replace("String_Node_Str",args[1]));
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildLivesChangeEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,lives))) {
    return;
  }
  guild.setLives(lives);
  sender.sendMessage(messages.adminLivesChanged.replace("String_Node_Str",guild.getTag()).replace("String_Node_Str",Integer.toString(lives)));
}
Program: 32582
Project: 32582
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
 else   if (args.length < 2) {
    sender.sendMessage(messages.adminNoNewNameGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (GuildUtils.nameExists(args[1])) {
    sender.sendMessage(messages.createNameExists);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildRenameEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,args[1]))) {
    return;
  }
  Manager.getInstance().stop();
  PluginConfig.DataType dataType=Settings.getConfig().dataType;
  Region region=RegionUtils.get(guild.getRegion());
  if (dataType.flat) {
    Flat.getGuildFile(guild).delete();
    Flat.getRegionFile(region).delete();
  }
  if (dataType.mysql) {
    new DatabaseGuild(guild).delete();
    new DatabaseRegion(region).delete();
  }
  guild.setName(args[1]);
  region.setName(args[1]);
  Manager.getInstance().start();
  sender.sendMessage(messages.adminNameChanged.replace("String_Node_Str",guild.getName()));
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
 else   if (args.length < 2) {
    sender.sendMessage(messages.adminNoNewNameGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (GuildUtils.nameExists(args[1])) {
    sender.sendMessage(messages.createNameExists);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildRenameEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,args[1]))) {
    return;
  }
  Manager.getInstance().stop();
  PluginConfig.DataType dataType=Settings.getConfig().dataType;
  Region region=RegionUtils.get(guild.getRegion());
  if (dataType.flat) {
    Flat.getGuildFile(guild).delete();
    Flat.getRegionFile(region).delete();
  }
  if (dataType.mysql) {
    new DatabaseGuild(guild).delete();
    new DatabaseRegion(region).delete();
  }
  guild.setName(args[1]);
  region.setName(args[1]);
  Manager.getInstance().start();
  sender.sendMessage(messages.adminNameChanged.replace("String_Node_Str",guild.getName()));
}
Program: 32583
Project: 32583
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  Player player=(Player)sender;
  if (args.length < 1) {
    player.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    player.sendMessage(messages.generalNoGuildFound);
    return;
  }
  Region region=RegionUtils.get(guild.getRegion());
  if (region == null || region.getCenter() == null) {
    player.sendMessage(messages.adminNoRegionFound);
    return;
  }
  player.sendMessage(messages.baseTeleport);
  player.teleport(region.getCenter());
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  Player player=(Player)sender;
  if (args.length < 1) {
    player.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    player.sendMessage(messages.generalNoGuildFound);
    return;
  }
  Region region=RegionUtils.get(guild.getRegion());
  if (region == null || region.getCenter() == null) {
    player.sendMessage(messages.adminNoRegionFound);
    return;
  }
  player.sendMessage(messages.baseTeleport);
  player.teleport(region.getCenter());
}
Program: 32584
Project: 32584
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (!guild.isBanned()) {
    sender.sendMessage(messages.adminGuildNotBanned);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildUnbanEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild))) {
    return;
  }
  BanUtils.unban(guild);
  MessageTranslator translator=new MessageTranslator().register("String_Node_Str",guild.getName()).register("String_Node_Str",guild.getName()).register("String_Node_Str",sender.getName());
  sender.sendMessage(translator.translate(messages.adminGuildUnban));
  Bukkit.broadcastMessage(translator.translate(messages.broadcastUnban));
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (!guild.isBanned()) {
    sender.sendMessage(messages.adminGuildNotBanned);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildUnbanEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild))) {
    return;
  }
  BanUtils.unban(guild);
  MessageTranslator translator=new MessageTranslator().register("String_Node_Str",guild.getName()).register("String_Node_Str",guild.getName()).register("String_Node_Str",sender.getName());
  sender.sendMessage(translator.translate(messages.adminGuildUnban));
  Bukkit.broadcastMessage(translator.translate(messages.broadcastUnban));
}
Program: 32585
Project: 32585
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  PluginConfig config=Settings.getConfig();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
 else   if (args.length < 2) {
    sender.sendMessage(messages.adminNoValidityTimeGiven);
    return;
  }
  Guild guild=GuildUtils.byTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (guild.isBanned()) {
    sender.sendMessage(messages.adminGuildBanned);
    return;
  }
  long time=Parser.parseTime(args[1]);
  if (time < 1) {
    sender.sendMessage(messages.adminTimeError);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildExtendValidityEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,time))) {
    return;
  }
  long validity=guild.getValidity();
  if (validity == 0) {
    validity=System.currentTimeMillis();
  }
  validity+=time;
  guild.setValidity(validity);
  String date=config.dateFormat.format(new Date(validity));
  sender.sendMessage(messages.adminNewValidity.replace("String_Node_Str",guild.getName()).replace("String_Node_Str",date));
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  MessagesConfig messages=Messages.getInstance();
  PluginConfig config=Settings.getConfig();
  if (args.length < 1) {
    sender.sendMessage(messages.generalNoTagGiven);
    return;
  }
 else   if (args.length < 2) {
    sender.sendMessage(messages.adminNoValidityTimeGiven);
    return;
  }
  Guild guild=GuildUtils.getByTag(args[0]);
  if (guild == null) {
    sender.sendMessage(messages.generalNoGuildFound);
    return;
  }
  if (guild.isBanned()) {
    sender.sendMessage(messages.adminGuildBanned);
    return;
  }
  long time=Parser.parseTime(args[1]);
  if (time < 1) {
    sender.sendMessage(messages.adminTimeError);
    return;
  }
  User admin=(sender instanceof Player) ? User.get(sender.getName()) : null;
  if (!SimpleEventHandler.handle(new GuildExtendValidityEvent(admin == null ? EventCause.CONSOLE : EventCause.ADMIN,admin,guild,time))) {
    return;
  }
  long validity=guild.getValidity();
  if (validity == 0) {
    validity=System.currentTimeMillis();
  }
  validity+=time;
  guild.setValidity(validity);
  String date=config.dateFormat.format(new Date(validity));
  sender.sendMessage(messages.adminNewValidity.replace("String_Node_Str",guild.getName()).replace("String_Node_Str",date));
}
Program: 32588
Project: 32588
Buggy source:
@SuppressWarnings("String_Node_Str") public static Guild deserializeGuild(Object[] values){
  if (values == null) {
    FunnyGuilds.error("String_Node_Str");
    return null;
  }
  Guild guild=Guild.get((String)values[1]);
  guild.setUUID((UUID)values[0]);
  guild.setTag(Settings.getConfig().guildTagUppercase ? ((String)values[2]).toUpperCase() : ((String)values[2]).toLowerCase());
  guild.setOwner((User)values[3]);
  guild.setHome((Location)values[4]);
  guild.setRegion((String)values[5]);
  guild.setMembers((List<User>)values[6]);
  guild.setRegions((List<String>)values[7]);
  guild.setAllies((List<Guild>)values[8]);
  guild.setEnemies((List<Guild>)values[9]);
  guild.setBorn((long)values[10]);
  guild.setValidity((long)values[11]);
  guild.setAttacked((long)values[12]);
  guild.setLives((int)values[13]);
  guild.setBan((long)values[14]);
  guild.setDeputy((User)values[15]);
  guild.deserializationUpdate();
  return guild;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static Guild deserializeGuild(Object[] values){
  if (values == null) {
    FunnyGuilds.error("String_Node_Str");
    return null;
  }
  Guild guild=Guild.getOrCreate((String)values[1]);
  guild.setUUID((UUID)values[0]);
  guild.setTag(Settings.getConfig().guildTagUppercase ? ((String)values[2]).toUpperCase() : ((String)values[2]).toLowerCase());
  guild.setOwner((User)values[3]);
  guild.setHome((Location)values[4]);
  guild.setRegion((String)values[5]);
  guild.setMembers((List<User>)values[6]);
  guild.setRegions((List<String>)values[7]);
  guild.setAllies((List<Guild>)values[8]);
  guild.setEnemies((List<Guild>)values[9]);
  guild.setBorn((long)values[10]);
  guild.setValidity((long)values[11]);
  guild.setAttacked((long)values[12]);
  guild.setLives((int)values[13]);
  guild.setBan((long)values[14]);
  guild.setDeputy((User)values[15]);
  guild.deserializationUpdate();
  return guild;
}
Program: 32589
Project: 32589
Buggy source:
@EventHandler public void onInteract(PlayerInteractEntityEvent event){
  Entity entity=event.getRightClicked();
  if (entity instanceof Player) {
    final PluginConfig config=Settings.getConfig();
    Player clicked=(Player)entity;
    if (!config.infoPlayerEnabled || (config.infoPlayerSneaking && !event.getPlayer().isSneaking()) || playerInfoCooldown.cooldown(event.getPlayer(),TimeUnit.SECONDS,config.infoPlayerCooldown)) {
      return;
    }
    new ExcPlayer().execute(event.getPlayer(),new String[]{clicked.getName()});
  }
 else   if (entity instanceof EnderCrystal) {
    EnderCrystal ec=(EnderCrystal)entity;
    Region region=RegionUtils.getAt(ec.getLocation());
    if (region == null) {
      return;
    }
    event.setCancelled(true);
    if (region.getCenter().getBlock().getRelative(BlockFace.UP).getLocation().toVector().equals(ec.getLocation().getBlock().getLocation().toVector())) {
      Guild guild=region.getGuild();
      if (guild == null) {
        return;
      }
      new ExcInfo().execute(event.getPlayer(),new String[]{guild.getTag()});
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onInteract(PlayerInteractEntityEvent event){
  PluginConfig config=Settings.getConfig();
  Player eventCaller=event.getPlayer();
  Entity clickedEntity=event.getRightClicked();
  if (clickedEntity instanceof Player) {
    Player clickedPlayer=(Player)clickedEntity;
    if (!config.infoPlayerEnabled || (config.infoPlayerSneaking && !eventCaller.isSneaking()) || informationMessageCooldowns.cooldown(eventCaller,TimeUnit.SECONDS,config.infoPlayerCooldown)) {
      return;
    }
    new ExcPlayer().execute(eventCaller,new String[]{clickedPlayer.getName()});
  }
}
Program: 32590
Project: 32590
Buggy source:
private static void call(Player player,int id,String action){
  for (  final Map.Entry<Guild,Integer> entry : EntityUtil.getEntitesMap().entrySet()) {
    if (!entry.getValue().equals(id)) {
      continue;
    }
    Guild guild=entry.getKey();
    if (SecuritySystem.getSecurity().checkPlayer(player,guild)) {
      return;
    }
    if (action.equalsIgnoreCase("String_Node_Str")) {
      WarSystem.getInstance().attack(player,entry.getKey());
    }
 else {
      ExcInfo excInfo=new ExcInfo();
      String[] parameters=new String[]{entry.getKey().getTag()};
      excInfo.execute(player,parameters);
    }
  }
}

Fixed version (ground truth):
private static void call(Player player,int id,String action,String hand){
  for (  final Map.Entry<Guild,Integer> entry : EntityUtil.getEntitesMap().entrySet()) {
    if (!entry.getValue().equals(id)) {
      continue;
    }
    Guild guild=entry.getKey();
    if (SecuritySystem.getSecurity().checkPlayer(player,guild)) {
      return;
    }
    if ("String_Node_Str".equalsIgnoreCase(action)) {
      WarSystem.getInstance().attack(player,entry.getKey());
    }
 else     if ("String_Node_Str".equalsIgnoreCase(action)) {
      if (informationMessageCooldowns.cooldown(player,TimeUnit.SECONDS,Settings.getConfig().infoPlayerCooldown)) {
        return;
      }
      if (!hand.isEmpty() && !"String_Node_Str".equalsIgnoreCase(hand)) {
        return;
      }
      ExcInfo excInfo=new ExcInfo();
      String[] parameters=new String[]{entry.getKey().getTag()};
      excInfo.execute(player,parameters);
    }
  }
}
Program: 32591
Project: 32591
Buggy source:
public static void use(Player player,Object packet){
  try {
    if (packet == null) {
      return;
    }
    if (!packet.getClass().equals(USE_ENTITY_CLASS)) {
      return;
    }
    if (PACKET_ACTION_FIELD == null) {
      return;
    }
    int id=PACKET_ID_FIELD.getInt(packet);
    Object actionEnum=PACKET_ACTION_FIELD.get(packet);
    if (actionEnum == null) {
      return;
    }
    call(player,id,actionEnum.toString());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void use(Player player,Object packet){
  try {
    if (packet == null) {
      return;
    }
    if (!packet.getClass().equals(USE_ENTITY_CLASS)) {
      return;
    }
    if (PACKET_ACTION_FIELD == null) {
      return;
    }
    int id=PACKET_ID_FIELD.getInt(packet);
    Object actionEnum=PACKET_ACTION_FIELD.get(packet);
    Object enumHand="String_Node_Str";
    if (ENUM_HAND_FIELD != null) {
      enumHand=ENUM_HAND_FIELD.get(packet);
    }
    if (actionEnum == null) {
      return;
    }
    call(player,id,actionEnum.toString(),enumHand.toString());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 32592
Project: 32592
Buggy source:
public static List<Region> getRegions(){
  return new ArrayList<>(regions);
}

Fixed version (ground truth):
public static List<Region> getRegions(){
  return new ArrayList<>(REGION_LIST);
}
Program: 32593
Project: 32593
Buggy source:
public static Region getAt(Location loc){
  for (  Region region : regions) {
    if (region.isIn(loc)) {
      return region;
    }
  }
  return null;
}

Fixed version (ground truth):
public static Region getAt(Location loc){
  for (  Region region : REGION_LIST) {
    if (region.isIn(loc)) {
      return region;
    }
  }
  return null;
}
Program: 32594
Project: 32594
Buggy source:
public static boolean isNear(Location center){
  if (center == null) {
    return false;
  }
  PluginConfig s=Settings.getConfig();
  int i=s.regionSize;
  if (s.enlargeItems != null) {
    i+=(s.enlargeItems.size() * s.enlargeSize);
  }
  int requiredDistance=(2 * i) + s.regionMinDistance;
  for (  Region region : regions) {
    if (region.getCenter() == null) {
      continue;
    }
    if (region.getCenter().equals(center)) {
      continue;
    }
    if (!center.getWorld().equals(region.getCenter().getWorld())) {
      continue;
    }
    if (center.distance(region.getCenter()) < requiredDistance) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isNear(Location center){
  if (center == null) {
    return false;
  }
  PluginConfig s=Settings.getConfig();
  int i=s.regionSize;
  if (s.enlargeItems != null) {
    i+=(s.enlargeItems.size() * s.enlargeSize);
  }
  int requiredDistance=(2 * i) + s.regionMinDistance;
  for (  Region region : REGION_LIST) {
    if (region.getCenter() == null) {
      continue;
    }
    if (region.getCenter().equals(center)) {
      continue;
    }
    if (!center.getWorld().equals(region.getCenter().getWorld())) {
      continue;
    }
    if (center.distance(region.getCenter()) < requiredDistance) {
      return true;
    }
  }
  return false;
}
Program: 32595
Project: 32595
Buggy source:
public static Region get(String name){
  if (name == null) {
    return null;
  }
  for (  Region region : regions) {
    if (region != null && region.getName() != null && region.getName().equalsIgnoreCase(name)) {
      return region;
    }
  }
  return null;
}

Fixed version (ground truth):
public static Region get(String name){
  if (name == null) {
    return null;
  }
  for (  Region region : REGION_LIST) {
    if (region != null && region.getName() != null && region.getName().equalsIgnoreCase(name)) {
      return region;
    }
  }
  return null;
}
Program: 32596
Project: 32596
Buggy source:
public static void addRegion(Region region){
  regions.add(region);
}

Fixed version (ground truth):
public static void addRegion(Region region){
  REGION_LIST.add(region);
}
Program: 32597
Project: 32597
Buggy source:
public static void removeRegion(Region region){
  regions.remove(region);
}

Fixed version (ground truth):
public static void removeRegion(Region region){
  REGION_LIST.remove(region);
}
Program: 32598
Project: 32598
Buggy source:
public static boolean isIn(Location loc){
  for (  Region region : regions) {
    if (region.isIn(loc)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isIn(Location loc){
  for (  Region region : REGION_LIST) {
    if (region.isIn(loc)) {
      return true;
    }
  }
  return false;
}
Program: 32599
Project: 32599
Buggy source:
private static boolean checkBlock(Block block){
  if (PluginHook.isPresent(PluginHook.PLUGIN_WORLDGUARD)) {
    if (WorldGuardHook.isOnRegion(block.getLocation())) {
      return false;
    }
  }
switch (block.getType()) {
case CHEST:
case ENCHANTMENT_TABLE:
case FURNACE:
case ENDER_CHEST:
case WORKBENCH:
case ANVIL:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
private static boolean checkBlock(Block block){
  Region region=RegionUtils.getAt(block.getLocation());
  if (region == null) {
    return false;
  }
switch (block.getType()) {
case CHEST:
case ENCHANTMENT_TABLE:
case FURNACE:
case ENDER_CHEST:
case WORKBENCH:
case ANVIL:
case HOPPER:
    return true;
default :
  return false;
}
}
Program: 32600
Project: 32600
Buggy source:
private static boolean checkBlock(Block block){
switch (block.getType()) {
case CHEST:
case ENCHANTMENT_TABLE:
case FURNACE:
case ENDER_CHEST:
case WORKBENCH:
case ANVIL:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
private static boolean checkBlock(Block block){
  if (WorldGuardHook.isOnRegion(block.getLocation())) {
    return false;
  }
switch (block.getType()) {
case CHEST:
case ENCHANTMENT_TABLE:
case FURNACE:
case ENDER_CHEST:
case WORKBENCH:
case ANVIL:
    return true;
default :
  return false;
}
}
Program: 32601
Project: 32601
Buggy source:
public static Map<Guild,Integer> getEntitesMap(){
  return entitesMap;
}

Fixed version (ground truth):
public static Map<Guild,Integer> getEntitesMap(){
  return ENTITY_MAP;
}
Program: 32602
Project: 32602
Buggy source:
private static Object despawnPacket(int id) throws Exception {
  return despawnEntityConstructor.newInstance(new int[]{id});
}

Fixed version (ground truth):
private static Object despawnPacket(int id) throws Exception {
  return DESPAWN_ENTITY_CONSTRUCTOR.newInstance(new int[]{id});
}
Program: 32603
Project: 32603
Buggy source:
public static void spawn(Guild guild,Player... players){
  try {
    Object o=null;
    if (!entitesMap.containsKey(guild)) {
      Location center=Region.get(guild.getRegion()).getCenter();
      if (center == null) {
        return;
      }
      Location loc=new Location(center.getWorld(),center.getX() + 0.5D,center.getY() - 1.0D,center.getZ() + 0.5D);
      int id=spawnPacket(loc);
      o=ids.get(id);
      entitesMap.put(guild,id);
    }
 else {
      o=ids.get(entitesMap.get(guild));
    }
    PacketSender.sendPacket(players,o);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void spawn(Guild guild,Player... players){
  try {
    Object o=null;
    if (!ENTITY_MAP.containsKey(guild)) {
      Location center=Region.get(guild.getRegion()).getCenter();
      if (center == null) {
        return;
      }
      Location loc=new Location(center.getWorld(),center.getX() + 0.5D,center.getY() - 1.0D,center.getZ() + 0.5D);
      int id=spawnPacket(loc);
      o=ID_MAP.get(id);
      ENTITY_MAP.put(guild,id);
    }
 else {
      o=ID_MAP.get(ENTITY_MAP.get(guild));
    }
    PacketSender.sendPacket(players,o);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 32604
Project: 32604
Buggy source:
public static void despawn(){
  for (  Guild guild : GuildUtils.getGuilds()) {
    try {
      int id=entitesMap.get(guild);
      ids.remove(id);
      entitesMap.remove(guild);
      Object o=despawnPacket(id);
      PacketSender.sendPacket(Bukkit.getOnlinePlayers(),o);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void despawn(){
  for (  Guild guild : GuildUtils.getGuilds()) {
    try {
      int id=ENTITY_MAP.get(guild);
      ID_MAP.remove(id);
      ENTITY_MAP.remove(guild);
      Object o=despawnPacket(id);
      PacketSender.sendPacket(Bukkit.getOnlinePlayers(),o);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 32605
Project: 32605
Buggy source:
private static int spawnPacket(Location loc) throws Exception {
  Object world=Reflections.getHandle(loc.getWorld());
  Object crystal=enderCrystalConstructor.newInstance(world);
  setLocation.invoke(crystal,loc.getX(),loc.getY(),loc.getZ(),0,0);
  Object packet=spawnEntityConstructor.newInstance(crystal,51);
  int id=(int)getId.invoke(crystal);
  ids.put(id,packet);
  return id;
}

Fixed version (ground truth):
private static int spawnPacket(Location loc) throws Exception {
  Object world=Reflections.getHandle(loc.getWorld());
  Object crystal=ENDER_CRYSTAL_CONSTRUCTOR.newInstance(world);
  SET_LOCATION.invoke(crystal,loc.getX(),loc.getY(),loc.getZ(),0,0);
  Object packet=SPAWN_ENTITY_CONSTRUCTOR.newInstance(crystal,51);
  int id=(int)GET_ID.invoke(crystal);
  ID_MAP.put(id,packet);
  return id;
}