nus-yam/ex-repair huggingface dataset:
Program: 141550
Project: 141550
Buggy source:
@Override public CommandElement[] getArguments(){
  return new CommandElement[]{Arguments.builder(new PlayerArgument(Text.of("String_Node_Str"))).optionalWeak().onlyOne().build()};
}

Fixed version (ground truth):
@Override public CommandElement[] getArguments(){
  return new CommandElement[]{Arguments.builder(new PlayerArgument(Text.of("String_Node_Str"))).optional().onlyOne().build()};
}
Program: 141551
Project: 141551
Buggy source:
public void postload(){
  try {
    boolean modified=false;
    if (!node.getNode("String_Node_Str").getComment().isPresent()) {
      node.getNode("String_Node_Str").setComment("String_Node_Str");
    }
    for (    Module mod : UltimateCore.get().getModuleService().getRegisteredModules()) {
      if (mod.getIdentifier().equals("String_Node_Str")) {
        continue;
      }
      CommentedConfigurationNode modnode=node.getNode("String_Node_Str",mod.getIdentifier());
      if (modnode.getNode("String_Node_Str").getValue() == null) {
        modified=true;
        modnode.getNode("String_Node_Str").setValue("String_Node_Str");
      }
    }
    if (modified) {
      loader.save(node);
    }
  }
 catch (  IOException e) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str","String_Node_Str"));
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void postload(){
  try {
    boolean modified=false;
    if (!node.getNode("String_Node_Str").getComment().isPresent()) {
      node.getNode("String_Node_Str").setComment("String_Node_Str");
    }
    for (    Module mod : UltimateCore.get().getModuleService().getRegisteredModules()) {
      if (mod.getIdentifier().equals("String_Node_Str")) {
        continue;
      }
      CommentedConfigurationNode modnode=node.getNode("String_Node_Str",mod.getIdentifier());
      if (modnode.getNode("String_Node_Str").isVirtual()) {
        modified=true;
        modnode.getNode("String_Node_Str").setValue("String_Node_Str");
      }
    }
    if (modified) {
      loader.save(node);
    }
  }
 catch (  IOException e) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str","String_Node_Str"));
    e.printStackTrace();
  }
}
Program: 141552
Project: 141552
Buggy source:
/** 
 * Registers a new module
 * @param module The module to register
 * @return Whether it was successfully registered
 */
@Override public boolean registerModule(Module module){
  ModuleRegisterEvent event=new ModuleRegisterEvent(module,Cause.builder().owner(UltimateCore.get()).build());
  Sponge.getEventManager().post(event);
  String state=UltimateCore.get().getModulesConfig().get().getNode("String_Node_Str",module.getIdentifier(),"String_Node_Str").getString();
  if (event.isCancelled() && !module.getIdentifier().equalsIgnoreCase("String_Node_Str") && !state.equalsIgnoreCase("String_Node_Str")) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",module.getIdentifier()));
    return false;
  }
  if (!module.getIdentifier().equalsIgnoreCase("String_Node_Str") && state.equalsIgnoreCase("String_Node_Str")) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",module.getIdentifier()));
    return false;
  }
  modules.add(module);
  module.onRegister();
  return true;
}

Fixed version (ground truth):
/** 
 * Registers a new module
 * @param module The module to register
 * @return Whether it was successfully registered
 */
@Override public boolean registerModule(Module module){
  try {
    ModuleRegisterEvent event=new ModuleRegisterEvent(module,Cause.builder().owner(UltimateCore.get()).build());
    Sponge.getEventManager().post(event);
    String state=UltimateCore.get().getModulesConfig().get().getNode("String_Node_Str",module.getIdentifier(),"String_Node_Str").getString();
    if (event.isCancelled() && !module.getIdentifier().equalsIgnoreCase("String_Node_Str") && state != null && !state.equalsIgnoreCase("String_Node_Str")) {
      Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",module.getIdentifier()));
      return false;
    }
    if (!module.getIdentifier().equalsIgnoreCase("String_Node_Str") && state != null && state.equalsIgnoreCase("String_Node_Str")) {
      Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",module.getIdentifier()));
      return false;
    }
    modules.add(module);
    module.onRegister();
    return true;
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    Messages.log(Text.of(TextColors.RED,"String_Node_Str" + module.getIdentifier() + "String_Node_Str"));
    return false;
  }
}
Program: 141553
Project: 141553
Buggy source:
@Override public void run(){
  try {
    data.put("String_Node_Str",getCountryCode());
    Webb webb=Webb.create();
    Response<String> response=webb.post("String_Node_Str").params(data).asString();
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",response.getStatusLine()));
    File file=new File(UltimateCore.get().getDataFolder().toFile(),"String_Node_Str");
    if (!file.exists()) {
      file.getParentFile().mkdirs();
      file.createNewFile();
    }
    List<String> lines=new ArrayList<>();
    for (    String key : data.keySet()) {
      lines.add(key + "String_Node_Str" + data.get(key));
    }
    FileUtil.writeLines(file,lines);
  }
 catch (  IOException e) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",e.getMessage()));
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    data.put("String_Node_Str",getCountryCode());
    Webb webb=Webb.create();
    Response<String> response=webb.post("String_Node_Str").params(data).asString();
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",response.getStatusLine()));
    File file=new File(UltimateCore.get().getDataFolder().toFile(),"String_Node_Str");
    if (!file.exists()) {
      file.getParentFile().mkdirs();
      file.createNewFile();
    }
    List<String> lines=new ArrayList<>();
    for (    String key : data.keySet()) {
      lines.add(key + "String_Node_Str" + data.get(key));
    }
    FileUtil.writeLines(file,lines);
  }
 catch (  Exception e) {
    Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",e.getMessage()));
  }
}
Program: 141554
Project: 141554
Buggy source:
public static void send(){
  final HashMap<String,Object> data=collect();
  Sponge.getScheduler().createTaskBuilder().name("String_Node_Str").delayTicks(1L).async().execute(new Runnable(){
    @Override public void run(){
      try {
        data.put("String_Node_Str",getCountryCode());
        Webb webb=Webb.create();
        Response<String> response=webb.post("String_Node_Str").params(data).asString();
        Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",response.getStatusLine()));
        File file=new File(UltimateCore.get().getDataFolder().toFile(),"String_Node_Str");
        if (!file.exists()) {
          file.getParentFile().mkdirs();
          file.createNewFile();
        }
        List<String> lines=new ArrayList<>();
        for (        String key : data.keySet()) {
          lines.add(key + "String_Node_Str" + data.get(key));
        }
        FileUtil.writeLines(file,lines);
      }
 catch (      IOException e) {
        Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",e.getMessage()));
      }
    }
  }
).submit(UltimateCore.get());
}

Fixed version (ground truth):
public static void send(){
  final HashMap<String,Object> data=collect();
  Sponge.getScheduler().createTaskBuilder().name("String_Node_Str").delayTicks(1L).async().execute(new Runnable(){
    @Override public void run(){
      try {
        data.put("String_Node_Str",getCountryCode());
        Webb webb=Webb.create();
        Response<String> response=webb.post("String_Node_Str").params(data).asString();
        Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",response.getStatusLine()));
        File file=new File(UltimateCore.get().getDataFolder().toFile(),"String_Node_Str");
        if (!file.exists()) {
          file.getParentFile().mkdirs();
          file.createNewFile();
        }
        List<String> lines=new ArrayList<>();
        for (        String key : data.keySet()) {
          lines.add(key + "String_Node_Str" + data.get(key));
        }
        FileUtil.writeLines(file,lines);
      }
 catch (      Exception e) {
        Messages.log(Messages.getFormatted("String_Node_Str","String_Node_Str",e.getMessage()));
      }
    }
  }
).submit(UltimateCore.get());
}
Program: 141555
Project: 141555
Buggy source:
/** 
 * Add the   {@link UltimateUser} to the cache. This will overwrite other users with the same UUID.
 * @param user The user to add to the cache
 * @return Whether the user was added to the cache successfully
 */
@Override public boolean addToCache(UltimateUser user){
  if (removeFromCache(user.getIdentifier())) {
    Messages.log("String_Node_Str");
    return users.add(user);
  }
 else {
    Messages.log("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Add the   {@link UltimateUser} to the cache. This will overwrite other users with the same UUID.
 * @param user The user to add to the cache
 * @return Whether the user was added to the cache successfully
 */
@Override public boolean addToCache(UltimateUser user){
  if (removeFromCache(user.getIdentifier())) {
    return users.add(user);
  }
 else {
    return false;
  }
}
Program: 141556
Project: 141556
Buggy source:
/** 
 * Remove all users from the cache. <p> <p>Warning: This will reset all   {@link bammerbom.ultimatecore.sponge.api.user.Key.Online}s! (So afk players will no longer be afk, etc)</p>
 * @return Whether the reset was successful
 */
@Override public boolean clearcache(){
  users.clear();
  return true;
}

Fixed version (ground truth):
/** 
 * Remove all users from the cache. <p> <p>Warning: This will reset all   {@link bammerbom.ultimatecore.sponge.api.user.Key.User.Online}s! (So afk players will no longer be afk, etc)</p>
 * @return Whether the reset was successful
 */
@Override public boolean clearcache(){
  users.clear();
  return true;
}
Program: 141557
Project: 141557
Buggy source:
/** 
 * Remove the specified user from the cache. <p> <p>Warning: This will reset all   {@link bammerbom.ultimatecore.sponge.api.user.Key.Online}s of the user! (So afk player will no longer be afk, etc)</p>
 * @param uuid The user's uuid to remove from the cache
 * @return Whether the reset was successful
 */
@Override public boolean removeFromCache(UUID uuid){
  List<UltimateUser> rusers=new ArrayList<>();
  users.stream().filter(user -> user.getIdentifier().equals(uuid)).forEach(user -> {
    rusers.add(user);
  }
);
  Messages.log(rusers.isEmpty());
  return !rusers.isEmpty() && users.remove(rusers);
}

Fixed version (ground truth):
/** 
 * Remove the specified user from the cache. <p> <p>Warning: This will reset all   {@link bammerbom.ultimatecore.sponge.api.user.Key.User.Online}s of the user! (So afk player will no longer be afk, etc)</p>
 * @param uuid The user's uuid to remove from the cache
 * @return Whether the reset was successful
 */
@Override public boolean removeFromCache(UUID uuid){
  List<UltimateUser> rusers=new ArrayList<>();
  users.stream().filter(user -> user.getIdentifier().equals(uuid)).forEach(user -> {
    rusers.add(user);
  }
);
  return !rusers.isEmpty() && users.removeAll(rusers);
}
Program: 141558
Project: 141558
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onJoin(PlayerJoinEvent e){
  try {
    if (spawnOnJoin) {
      LocationUtil.teleportUnsafe(e.getPlayer(),UC.getPlayer(e.getPlayer()).getSpawn(false),TeleportCause.PLUGIN,false);
    }
    UC.getPlayer(e.getPlayer()).updateLastInventory();
    if (UC.getPlayer(e.getPlayer()).isJailed()) {
      e.getPlayer().teleport(UC.getServer().getJail(UC.getPlayer(e.getPlayer()).getJail()));
    }
    UC.getPlayer(e.getPlayer()).updateLastConnectMillis();
    UC.getPlayer(e.getPlayer()).setLastIp(e.getPlayer().getAddress().toString().split("String_Node_Str")[1].split("String_Node_Str")[0]);
    UC.getPlayer(e.getPlayer()).setLastHostname(e.getPlayer().getAddress().getHostName());
    for (    Player p : UC.getServer().getVanishOnlinePlayers()) {
      e.getPlayer().hidePlayer(p);
    }
    if (UC.getPlayer(e.getPlayer()).getPlayerConfig().contains("String_Node_Str")) {
      JsonConfig conf=UC.getPlayer(e.getPlayer()).getPlayerConfig();
      r.sendMes(e.getPlayer(),"String_Node_Str","String_Node_Str",conf.getString("String_Node_Str"),"String_Node_Str",e.getPlayer().getName());
      conf.set("String_Node_Str",null);
      conf.save();
    }
  }
 catch (  Exception ex) {
    ErrorLogger.log(ex,"String_Node_Str");
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW) public void onJoin(PlayerJoinEvent e){
  try {
    if (spawnOnJoin && UC.getPlayer(e.getPlayer()).getSpawn(false) != null) {
      LocationUtil.teleportUnsafe(e.getPlayer(),UC.getPlayer(e.getPlayer()).getSpawn(false),TeleportCause.PLUGIN,false);
    }
    UC.getPlayer(e.getPlayer()).updateLastInventory();
    if (UC.getPlayer(e.getPlayer()).isJailed()) {
      e.getPlayer().teleport(UC.getServer().getJail(UC.getPlayer(e.getPlayer()).getJail()));
    }
    UC.getPlayer(e.getPlayer()).updateLastConnectMillis();
    UC.getPlayer(e.getPlayer()).setLastIp(e.getPlayer().getAddress().toString().split("String_Node_Str")[1].split("String_Node_Str")[0]);
    UC.getPlayer(e.getPlayer()).setLastHostname(e.getPlayer().getAddress().getHostName());
    for (    Player p : UC.getServer().getVanishOnlinePlayers()) {
      e.getPlayer().hidePlayer(p);
    }
    if (UC.getPlayer(e.getPlayer()).getPlayerConfig().contains("String_Node_Str")) {
      JsonConfig conf=UC.getPlayer(e.getPlayer()).getPlayerConfig();
      r.sendMes(e.getPlayer(),"String_Node_Str","String_Node_Str",conf.getString("String_Node_Str"),"String_Node_Str",e.getPlayer().getName());
      conf.set("String_Node_Str",null);
      conf.save();
    }
  }
 catch (  Exception ex) {
    ErrorLogger.log(ex,"String_Node_Str");
  }
}
Program: 141559
Project: 141559
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  Player p=(Player)cs;
  ItemStack InHandItem=p.getItemInHand();
  if (p.getInventory().getHelmet() == null || p.getInventory().getHelmet().getType().equals(Material.AIR)) {
    p.getInventory().setHelmet(InHandItem);
    p.getInventory().remove(InHandItem);
  }
 else {
    ItemStack tohand=p.getInventory().getHelmet();
    p.getInventory().setHelmet(InHandItem);
    p.getInventory().remove(InHandItem);
    p.getInventory().setItemInHand(tohand);
  }
  r.sendMes(p,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  Player p=(Player)cs;
  ItemStack InHandItem=p.getItemInHand();
  if (p.getInventory().getHelmet() == null || p.getInventory().getHelmet().getType().equals(Material.AIR)) {
    p.getInventory().setHelmet(InHandItem);
    p.getInventory().setItemInHand(null);
  }
 else {
    ItemStack tohand=p.getInventory().getHelmet();
    p.getInventory().setHelmet(InHandItem);
    p.getInventory().setItemInHand(tohand);
  }
  r.sendMes(p,"String_Node_Str");
}
Program: 141561
Project: 141561
Buggy source:
public UltimateCore(){
  instance=this;
  try {
    r.prestart();
    r.log("String_Node_Str");
  }
 catch (  Exception ex) {
    ErrorLogger.log(ex,"String_Node_Str");
  }
}

Fixed version (ground truth):
public UltimateCore(){
  instance=this;
  try {
    r.prestart();
    r.log("String_Node_Str");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 141564
Project: 141564
Buggy source:
public static UPlayer getPlayer(String n){
  for (  UPlayer pl : uplayers) {
    if (pl.name.equals(n)) {
      return pl;
    }
  }
  UPlayer pl=new UPlayer(r.searchOfflinePlayer(n));
  uplayers.add(pl);
  return pl;
}

Fixed version (ground truth):
public static UPlayer getPlayer(String n){
  for (  UPlayer pl : uplayers) {
    if (pl.name == null) {
      continue;
    }
    if (pl.name.equals(n)) {
      return pl;
    }
  }
  UPlayer pl=new UPlayer(r.searchOfflinePlayer(n));
  uplayers.add(pl);
  return pl;
}
Program: 141565
Project: 141565
Buggy source:
public static bammerbom.ultimatecore.spongeapi.api.UPlayer getPlayer(String n){
  for (  bammerbom.ultimatecore.spongeapi.api.UPlayer pl : uplayers) {
    if (pl.name.equals(n)) {
      return pl;
    }
  }
  bammerbom.ultimatecore.spongeapi.api.UPlayer pl=new bammerbom.ultimatecore.spongeapi.api.UPlayer(r.searchOfflinePlayer(n));
  uplayers.add(pl);
  return pl;
}

Fixed version (ground truth):
public static bammerbom.ultimatecore.spongeapi.api.UPlayer getPlayer(String n){
  for (  bammerbom.ultimatecore.spongeapi.api.UPlayer pl : uplayers) {
    if (pl.name == null) {
      continue;
    }
    if (pl.name.equals(n)) {
      return pl;
    }
  }
  bammerbom.ultimatecore.spongeapi.api.UPlayer pl=new bammerbom.ultimatecore.spongeapi.api.UPlayer(r.searchOfflinePlayer(n));
  uplayers.add(pl);
  return pl;
}
Program: 141566
Project: 141566
Buggy source:
/** 
 * Deposit an amount to a player - DO NOT USE NEGATIVE AMOUNTS IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    to deposit to
 * @param worldName name of the world
 * @param amount    Amount to deposit
 * @return Detailed response of transaction
 */
@Override public EconomyResponse depositPlayer(OfflinePlayer player,String worldName,double amount){
  return depositPlayer(UuidUtil.requestUuid(player).toString(),amount);
}

Fixed version (ground truth):
/** 
 * Deposit an amount to a player - DO NOT USE NEGATIVE AMOUNTS IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    to deposit to
 * @param worldName name of the world
 * @param amount    Amount to deposit
 * @return Detailed response of transaction
 */
@Override public EconomyResponse depositPlayer(OfflinePlayer player,String worldName,double amount){
  return depositPlayer(player.getUniqueId().toString(),amount);
}
Program: 141567
Project: 141567
Buggy source:
/** 
 * Withdraw an amount from a player on a given world - DO NOT USE NEGATIVE AMOUNTS IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    to withdraw from
 * @param worldName - name of the world
 * @param amount    Amount to withdraw
 * @return Detailed response of transaction
 */
@Override public EconomyResponse withdrawPlayer(OfflinePlayer player,String worldName,double amount){
  return withdrawPlayer(UuidUtil.requestUuid(player).toString(),amount);
}

Fixed version (ground truth):
/** 
 * Withdraw an amount from a player on a given world - DO NOT USE NEGATIVE AMOUNTS IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    to withdraw from
 * @param worldName - name of the world
 * @param amount    Amount to withdraw
 * @return Detailed response of transaction
 */
@Override public EconomyResponse withdrawPlayer(OfflinePlayer player,String worldName,double amount){
  return withdrawPlayer(player.getUniqueId().toString(),amount);
}
Program: 141568
Project: 141568
Buggy source:
/** 
 * Attempts to create a player account for the given player on the specified world IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    OfflinePlayer
 * @param worldName String name of the world
 * @return if the account creation was successful
 */
@Override public boolean createPlayerAccount(OfflinePlayer player,String worldName){
  return createPlayerAccount(UuidUtil.requestUuid(player).toString());
}

Fixed version (ground truth):
/** 
 * Attempts to create a player account for the given player on the specified world IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player    OfflinePlayer
 * @param worldName String name of the world
 * @return if the account creation was successful
 */
@Override public boolean createPlayerAccount(OfflinePlayer player,String worldName){
  return createPlayerAccount(player.getUniqueId().toString());
}
Program: 141569
Project: 141569
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String message=r.getFinalArg(args,0);
  message=format.replace("String_Node_Str",message);
  for (  Player pl : r.getOnlinePlayers()) {
    pl.sendMessage(ChatColor.translateAlternateColorCodes('&',message.replace("String_Node_Str",r.positive + "String_Node_Str").replace("String_Node_Str",r.neutral + "String_Node_Str").replace("String_Node_Str",r.negative + "String_Node_Str").replace("String_Node_Str","String_Node_Str")));
    Bukkit.getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&',message).replace("String_Node_Str",r.positive + "String_Node_Str").replace("String_Node_Str",r.neutral + "String_Node_Str").replace("String_Node_Str",r.negative + "String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String message=r.getFinalArg(args,0);
  message=format.replace("String_Node_Str",message);
  Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&',message).replace("String_Node_Str",r.positive + "String_Node_Str").replace("String_Node_Str",r.neutral + "String_Node_Str").replace("String_Node_Str",r.negative + "String_Node_Str").replace("String_Node_Str","String_Node_Str"));
}
Program: 141571
Project: 141571
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onInventoryClose(InventoryCloseEvent e){
  try {
    if (UC.getPlayer((OfflinePlayer)e.getPlayer()).isInCommandEnchantingtable()) {
      UC.getPlayer((OfflinePlayer)e.getPlayer()).setInCommandEnchantingtable(false);
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInOfflineInventory()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInOfflineInventory(false);
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInOnlineInventory()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInOnlineInventory(false);
    }
    if (UC.getPlayer((OfflinePlayer)e.getPlayer()).isInRecipeView()) {
      UC.getPlayer((OfflinePlayer)e.getPlayer()).isInRecipeView();
      e.getInventory().clear();
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInTeleportMenu()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInTeleportMenu(false);
    }
  }
 catch (  Exception ex) {
    ErrorLogger.log(ex,"String_Node_Str");
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW) public void onInventoryClose(InventoryCloseEvent e){
  try {
    if (UC.getPlayer((OfflinePlayer)e.getPlayer()).isInCommandEnchantingtable()) {
      UC.getPlayer((OfflinePlayer)e.getPlayer()).setInCommandEnchantingtable(false);
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInOfflineInventory()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInOfflineInventory(false);
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInOnlineInventory()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInOnlineInventory(false);
    }
    if (UC.getPlayer((OfflinePlayer)e.getPlayer()).isInRecipeView()) {
      UC.getPlayer((OfflinePlayer)e.getPlayer()).setInRecipeView(false);
      e.getInventory().clear();
    }
    if (UC.getPlayer(e.getPlayer().getUniqueId()).isInTeleportMenu()) {
      UC.getPlayer(e.getPlayer().getUniqueId()).setInTeleportMenu(false);
    }
  }
 catch (  Exception ex) {
    ErrorLogger.log(ex,"String_Node_Str");
  }
}
Program: 141572
Project: 141572
Buggy source:
public static Location convertStringToLocation(String s){
  if (s == null) {
    return null;
  }
  if (s.contains("String_Node_Str")) {
    String[] split=s.split("String_Node_Str");
    return new Location(Bukkit.getWorld(split[0]),Double.parseDouble(split[1]),Double.parseDouble(split[2]),Double.parseDouble(split[3]),Float.parseFloat(split[4]),Float.parseFloat(split[5]));
  }
  String[] split=s.split("String_Node_Str");
  return new Location(Bukkit.getWorld(split[0]),Double.parseDouble(split[1]),Double.parseDouble(split[2]),Double.parseDouble(split[3]),Float.parseFloat(split[4]),Float.parseFloat(split[5]));
}

Fixed version (ground truth):
public static Location convertStringToLocation(String s){
  if (s == null) {
    return null;
  }
  if (s.contains("String_Node_Str")) {
    String[] split=s.split("String_Node_Str");
    return new Location(Bukkit.getWorld(split[0]),Double.parseDouble(split[1]),Double.parseDouble(split[2]),Double.parseDouble(split[3]),Float.parseFloat(split[5]),Float.parseFloat(split[4]));
  }
  String[] split=s.split("String_Node_Str");
  return new Location(Bukkit.getWorld(split[0]),Double.parseDouble(split[1]),Double.parseDouble(split[2]),Double.parseDouble(split[3]),Float.parseFloat(split[5]),Float.parseFloat(split[4]));
}
Program: 141573
Project: 141573
Buggy source:
@Override public List<String> onTabComplete(CommandSender sender,Command cmd,String label,String[] args){
  if (Overrider.checkOverridden(sender,cmd,label,args)) {
    return null;
  }
  List<String> rtrn=null;
  if (label.startsWith("String_Node_Str")) {
    label=label.replaceFirst("String_Node_Str","String_Node_Str");
  }
  for (  UltimateCommand cmdr : cmds) {
    if (cmdr.getName().equals(label) || cmdr.getAliases().contains(label)) {
      try {
        rtrn=cmdr.onTabComplete(sender,cmd,label,args,args[args.length - 1],args.length - 1);
      }
 catch (      Exception ex) {
        ErrorLogger.log(ex,"String_Node_Str" + label);
      }
      break;
    }
  }
  if (rtrn == null) {
    rtrn=new ArrayList<>();
    for (    Player p : r.getOnlinePlayers()) {
      rtrn.add(p.getName());
    }
  }
  if (!StringUtil.nullOrEmpty(args[args.length - 1])) {
    List<String> remv=new ArrayList<>();
    for (    String s : rtrn) {
      if (!StringUtils.startsWithIgnoreCase(s,args[args.length - 1])) {
        remv.add(s);
      }
    }
    rtrn.removeAll(remv);
  }
  return rtrn;
}

Fixed version (ground truth):
@Override public List<String> onTabComplete(CommandSender sender,Command cmd,String label,String[] args){
  if (Overrider.checkOverridden(sender,cmd,label,args)) {
    return null;
  }
  List<String> rtrn=null;
  if (label.startsWith("String_Node_Str")) {
    label=label.replaceFirst("String_Node_Str","String_Node_Str");
  }
  for (  UltimateCommand cmdr : cmds) {
    if (cmdr.getName().equals(label) || cmdr.getAliases().contains(label)) {
      try {
        rtrn=cmdr.onTabComplete(sender,cmd,label,args,args[args.length - 1],args.length - 1);
      }
 catch (      Exception ex) {
        ErrorLogger.log(ex,"String_Node_Str" + label);
      }
      break;
    }
  }
  if (rtrn == null) {
    rtrn=new ArrayList<>();
    for (    Player p : r.getOnlinePlayers()) {
      rtrn.add(p.getName());
    }
  }
  ArrayList<String> rtrn2=new ArrayList<>();
  rtrn2.addAll(rtrn);
  rtrn=rtrn2;
  if (!StringUtil.nullOrEmpty(args[args.length - 1])) {
    List<String> remv=new ArrayList<>();
    for (    String s : rtrn) {
      if (!StringUtils.startsWithIgnoreCase(s,args[args.length - 1])) {
        remv.add(s);
      }
    }
    rtrn.removeAll(remv);
  }
  return rtrn;
}
Program: 141574
Project: 141574
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",true,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  Player p=(Player)cs;
  StringBuilder builder=new StringBuilder("String_Node_Str");
  Boolean a=true;
  Integer range=250;
  if (r.checkArgs(args,0)) {
    if (!r.isInt(args[0])) {
      r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
      return;
    }
    range=r.normalize(Integer.parseInt(args[0]),1,5000);
  }
  for (  Entity e : r.getNearbyEntities(p,range.doubleValue())) {
    if (e instanceof Player) {
      Player t=(Player)e;
      if (!a) {
        builder.append("String_Node_Str");
      }
      builder.append(t.getName());
      builder.append("String_Node_Str" + Double.valueOf(t.getLocation().distance(p.getLocation())).intValue() + "String_Node_Str");
      a=false;
    }
  }
  if (a) {
    builder.append(r.mes("String_Node_Str"));
  }
  r.sendMes(cs,"String_Node_Str","String_Node_Str",range,"String_Node_Str",builder.toString());
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",true,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  Player p=(Player)cs;
  StringBuilder builder=new StringBuilder("String_Node_Str");
  Boolean a=true;
  Integer range=250;
  if (r.checkArgs(args,0)) {
    if (!r.isInt(args[0])) {
      r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
      return;
    }
    range=r.normalize(Integer.parseInt(args[0]),1,5000);
  }
  for (  Entity e : r.getNearbyPlayers(p,range.doubleValue())) {
    Player t=(Player)e;
    if (!a) {
      builder.append("String_Node_Str");
    }
    builder.append(t.getName());
    builder.append("String_Node_Str" + Double.valueOf(t.getLocation().distance(p.getLocation())).intValue() + "String_Node_Str");
    a=false;
  }
  if (a) {
    builder.append(r.mes("String_Node_Str"));
  }
  r.sendMes(cs,"String_Node_Str","String_Node_Str",range,"String_Node_Str",builder.toString());
}
Program: 141576
Project: 141576
Buggy source:
public static void startWorldLoading(){
  Config conf=new Config(UltimateFileLoader.DFworlds);
  for (  String str : conf.getKeys(false)) {
    try {
      WorldCreator w=new WorldCreator(str);
      w.environment(Environment.valueOf(conf.getString(str + "String_Node_Str")));
      Bukkit.createWorld(w);
    }
 catch (    Exception ex) {
      r.log("String_Node_Str" + str);
      ErrorLogger.log(ex,"String_Node_Str" + str);
    }
  }
}

Fixed version (ground truth):
public static void startWorldLoading(){
  Config conf=new Config(UltimateFileLoader.DFworlds);
  for (  String str : conf.getKeys(false)) {
    try {
      WorldCreator w=new WorldCreator(str);
      if (conf.contains(str + "String_Node_Str")) {
        w.environment(Environment.valueOf(conf.getString(str + "String_Node_Str")));
        Bukkit.createWorld(w);
      }
    }
 catch (    Exception ex) {
      r.log("String_Node_Str" + str);
      ErrorLogger.log(ex,"String_Node_Str" + str);
    }
  }
}
Program: 141577
Project: 141577
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  if (!r.isFloat(args[0])) {
    if (r.isFloat(args[1])) {
      run(cs,label,new String[]{args[1],args[0]});
      return;
    }
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Float d=Float.parseFloat(args[0]);
  if (d > 10 || d < 0) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  if (r.checkArgs(args,1) == false) {
    p.setFlySpeed(getSpeed(d,true));
    p.setWalkSpeed(getSpeed(d,false));
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
  }
 else {
    Player t=r.searchPlayer(args[1]);
    if (t == null) {
      r.sendMes(cs,"String_Node_Str","String_Node_Str",args[1]);
      return;
    }
    if (!r.perm(cs,"String_Node_Str",false,true)) {
      return;
    }
    t.setFlySpeed(getSpeed(d,true));
    t.setWalkSpeed(getSpeed(d,false));
    r.sendMes(cs,"String_Node_Str","String_Node_Str",t.getName(),"String_Node_Str",args[0]);
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
  }
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  if (!r.isFloat(args[0])) {
    if (r.checkArgs(args,1) && r.isFloat(args[1])) {
      run(cs,label,new String[]{args[1],args[0]});
      return;
    }
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Float d=Float.parseFloat(args[0]);
  if (d > 10 || d < 0) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  if (r.checkArgs(args,1) == false) {
    p.setFlySpeed(getSpeed(d,true));
    p.setWalkSpeed(getSpeed(d,false));
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
  }
 else {
    Player t=r.searchPlayer(args[1]);
    if (t == null) {
      r.sendMes(cs,"String_Node_Str","String_Node_Str",args[1]);
      return;
    }
    if (!r.perm(cs,"String_Node_Str",false,true)) {
      return;
    }
    t.setFlySpeed(getSpeed(d,true));
    t.setWalkSpeed(getSpeed(d,false));
    r.sendMes(cs,"String_Node_Str","String_Node_Str",t.getName(),"String_Node_Str",args[0]);
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
  }
}
Program: 141578
Project: 141578
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Enchantment ench=EnchantmentDatabase.getByName(args[0]);
  if (ench == null) {
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
    return;
  }
  ItemStack stack=p.getItemInHand();
  if (stack == null || stack.getType() == null || stack.getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String name=ench.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  Integer level=1;
  if (r.checkArgs(args,1) == true && r.isInt(args[1])) {
    level=Integer.parseInt(args[1]);
  }
  if (level < 0) {
    level=0;
  }
  if (level == 0) {
    stack.removeEnchantment(ench);
  }
 else {
    MetaItemStack stack2=new MetaItemStack(stack);
    stack2.addEnchantment(r.perm(cs,"String_Node_Str",false,false),ench,level);
    p.setItemInHand(stack2.getItemStack());
  }
  r.sendMes(cs,"String_Node_Str","String_Node_Str",name,"String_Node_Str",level,"String_Node_Str",ItemUtil.getName(stack).toLowerCase());
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Enchantment ench=EnchantmentDatabase.getByName(args[0]);
  if (ench == null) {
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
    return;
  }
  ItemStack stack=p.getItemInHand();
  if (stack == null || stack.getType() == null || stack.getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String name=ench.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  Integer level=1;
  if (r.checkArgs(args,1) == true && r.isInt(args[1])) {
    level=Integer.parseInt(args[1]);
  }
  if (level < 0) {
    level=0;
  }
  if (level == 0) {
    stack.removeEnchantment(ench);
  }
 else {
    MetaItemStack stack2=new MetaItemStack(stack);
    stack2.addEnchantment(cs,r.perm(cs,"String_Node_Str",false,false),ench,level);
    p.setItemInHand(stack2.getItemStack());
  }
  r.sendMes(cs,"String_Node_Str","String_Node_Str",name,"String_Node_Str",level,"String_Node_Str",ItemUtil.getName(stack).toLowerCase());
}
Program: 141579
Project: 141579
Buggy source:
private void parseEnchantmentStrings(boolean allowUnsafe,String[] split) throws Exception {
  Enchantment enchantment=EnchantmentDatabase.getByName(split[0]);
  if ((enchantment == null)) {
    return;
  }
  int level=-1;
  if (split.length > 1) {
    try {
      level=Integer.parseInt(split[1]);
    }
 catch (    NumberFormatException ex) {
      level=-1;
    }
  }
  if ((level < 0) || ((!allowUnsafe) && (level > enchantment.getMaxLevel()))) {
    level=enchantment.getMaxLevel();
  }
  addEnchantment(allowUnsafe,enchantment,level);
}

Fixed version (ground truth):
private void parseEnchantmentStrings(CommandSender cs,boolean allowUnsafe,String[] split) throws Exception {
  Enchantment enchantment=EnchantmentDatabase.getByName(split[0]);
  if ((enchantment == null)) {
    return;
  }
  int level=-1;
  if (split.length > 1) {
    try {
      level=Integer.parseInt(split[1]);
    }
 catch (    NumberFormatException ex) {
      level=-1;
    }
  }
  if ((level < 0) || ((!allowUnsafe) && (level > enchantment.getMaxLevel()))) {
    level=enchantment.getMaxLevel();
  }
  addEnchantment(cs,allowUnsafe,enchantment,level);
}
Program: 141580
Project: 141580
Buggy source:
public void addEnchantment(boolean allowUnsafe,Enchantment enchantment,int level){
  if (enchantment == null) {
    return;
  }
  try {
    if (this.stack.getType().equals(Material.ENCHANTED_BOOK)) {
      EnchantmentStorageMeta meta=(EnchantmentStorageMeta)this.stack.getItemMeta();
      if (level == 0) {
        meta.removeStoredEnchant(enchantment);
      }
 else {
        meta.addStoredEnchant(enchantment,level,allowUnsafe);
      }
      this.stack.setItemMeta(meta);
    }
 else     if (level == 0) {
      this.stack.removeEnchantment(enchantment);
    }
 else     if (allowUnsafe) {
      this.stack.addUnsafeEnchantment(enchantment,level);
    }
 else {
      this.stack.addEnchantment(enchantment,level);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void addEnchantment(CommandSender cs,boolean allowUnsafe,Enchantment enchantment,int level){
  if (enchantment == null) {
    return;
  }
  if (this.stack.getType().equals(Material.ENCHANTED_BOOK)) {
    EnchantmentStorageMeta meta=(EnchantmentStorageMeta)this.stack.getItemMeta();
    if (level == 0) {
      meta.removeStoredEnchant(enchantment);
    }
 else {
      meta.addStoredEnchant(enchantment,level,allowUnsafe);
    }
    this.stack.setItemMeta(meta);
  }
 else   if (level == 0) {
    this.stack.removeEnchantment(enchantment);
  }
 else   if (allowUnsafe) {
    this.stack.addUnsafeEnchantment(enchantment,level);
  }
 else {
    try {
      this.stack.addEnchantment(enchantment,level);
    }
 catch (    IllegalArgumentException e) {
      if (cs != null) {
        r.sendMes(cs,"String_Node_Str");
      }
    }
  }
}
Program: 141581
Project: 141581
Buggy source:
public Enchantment getEnchantment(Player user,String name) throws Exception {
  Enchantment enchantment=EnchantmentDatabase.getByName(name);
  return enchantment;
}

Fixed version (ground truth):
public Enchantment getEnchantment(String name) throws Exception {
  Enchantment enchantment=EnchantmentDatabase.getByName(name);
  return enchantment;
}
Program: 141583
Project: 141583
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  Player p=(Player)cs;
  if (p.getItemInHand() == null || p.getItemInHand().getType() == null || p.getItemInHand().getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
  }
  p.getItemInHand().setAmount(64);
  r.sendMes(cs,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  Player p=(Player)cs;
  if (p.getItemInHand() == null || p.getItemInHand().getType() == null || p.getItemInHand().getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  p.getItemInHand().setAmount(64);
  r.sendMes(cs,"String_Node_Str");
}
Program: 141588
Project: 141588
Buggy source:
@Override public List<String> onTabComplete(CommandSender sender,Command cmd,String label,String[] args){
  if (Overrider.checkOverridden(sender,cmd,label,args)) {
    return null;
  }
  List<String> rtrn=null;
  if (label.startsWith("String_Node_Str")) {
    label=label.replaceFirst("String_Node_Str","String_Node_Str");
  }
  for (  UltimateCommand cmdr : cmds) {
    if (cmdr.getName().equals(label) || cmdr.getAliases().contains(label)) {
      try {
        rtrn=cmdr.onTabComplete(sender,cmd,label,args,args[args.length - 1],args.length - 1);
      }
 catch (      Exception ex) {
        ErrorLogger.log(ex,"String_Node_Str" + label);
      }
      break;
    }
  }
  if (rtrn == null) {
    rtrn=new ArrayList<>();
    for (    Player p : r.getOnlinePlayers()) {
      rtrn.add(p.getName());
    }
  }
  if (!StringUtil.nullOrEmpty(args[args.length - 1])) {
    Iterator<String> i=rtrn.iterator();
    while (i.hasNext()) {
      String s=i.next();
      if (!s.startsWith(args[args.length - 1])) {
        i.remove();
      }
    }
  }
  return rtrn;
}

Fixed version (ground truth):
@Override public List<String> onTabComplete(CommandSender sender,Command cmd,String label,String[] args){
  if (Overrider.checkOverridden(sender,cmd,label,args)) {
    return null;
  }
  List<String> rtrn=null;
  if (label.startsWith("String_Node_Str")) {
    label=label.replaceFirst("String_Node_Str","String_Node_Str");
  }
  for (  UltimateCommand cmdr : cmds) {
    if (cmdr.getName().equals(label) || cmdr.getAliases().contains(label)) {
      try {
        rtrn=cmdr.onTabComplete(sender,cmd,label,args,args[args.length - 1],args.length - 1);
      }
 catch (      Exception ex) {
        ErrorLogger.log(ex,"String_Node_Str" + label);
      }
      break;
    }
  }
  if (rtrn == null) {
    rtrn=new ArrayList<>();
    for (    Player p : r.getOnlinePlayers()) {
      rtrn.add(p.getName());
    }
  }
  if (!StringUtil.nullOrEmpty(args[args.length - 1])) {
    Iterator<String> i=(new ArrayList<>(rtrn)).iterator();
    while (i.hasNext()) {
      String s=i.next();
      if (!s.startsWith(args[args.length - 1])) {
        i.remove();
      }
    }
  }
  return rtrn;
}
Program: 141589
Project: 141589
Buggy source:
public void setNick(String str){
  nickname=str == null ? null : str + ChatColor.RESET;
  save();
  if (str != null) {
    if (getPlayer().isOnline()) {
      getPlayer().getPlayer().setDisplayName(nickname.replace("String_Node_Str","String_Node_Str"));
    }
  }
  Config data=getPlayerConfig();
  data.set("String_Node_Str",str);
  data.save(UltimateFileLoader.getPlayerFile(getPlayer()));
}

Fixed version (ground truth):
public void setNick(String str){
  nickname=str == null ? null : str + ChatColor.RESET;
  save();
  if (str != null) {
    if (getPlayer().isOnline()) {
      getPlayer().getPlayer().setDisplayName(nickname.replace("String_Node_Str","String_Node_Str"));
    }
  }
 else {
    if (getPlayer().isOnline()) {
      getPlayer().getPlayer().setDisplayName(getPlayer().getPlayer().getName());
    }
  }
  Config data=getPlayerConfig();
  data.set("String_Node_Str",str);
  data.save(UltimateFileLoader.getPlayerFile(getPlayer()));
}
Program: 141591
Project: 141591
Buggy source:
/** 
 * Gets an ItemStack from the given node
 * @param item Node representing an ItemStack
 * @return ItemStack of null
 */
private ItemStack getItemStack(final Map<String,Object> item){
  final ItemStack is=ItemUtil.searchItem((String)item.get("String_Node_Str"));
  if (is == null) {
    return null;
  }
  if (item.containsKey("String_Node_Str")) {
    is.setAmount((int)item.get("String_Node_Str"));
  }
  if (item.containsKey("String_Node_Str")) {
    is.setDurability(((Number)item.get("String_Node_Str")).shortValue());
  }
  MetaItemStack ism=new MetaItemStack(is);
  for (  String s : item.keySet()) {
    if (s.equalsIgnoreCase("String_Node_Str") || s.equalsIgnoreCase("String_Node_Str") || s.equalsIgnoreCase("String_Node_Str")) {
      continue;
    }
    ism.addStringMeta(null,true,s + "String_Node_Str" + item.get(s).toString().replaceAll("String_Node_Str","String_Node_Str"));
  }
  return ism.getItemStack();
}

Fixed version (ground truth):
/** 
 * Gets an ItemStack from the given node
 * @param item Node representing an ItemStack
 * @return ItemStack of null
 */
private ItemStack getItemStack(final Map<String,Object> item){
  final ItemStack is=ItemUtil.searchItem((String)item.get("String_Node_Str"));
  if (is == null) {
    return null;
  }
  if (item.containsKey("String_Node_Str")) {
    is.setAmount((int)item.get("String_Node_Str"));
  }
  if (item.containsKey("String_Node_Str")) {
    is.setDurability(((Number)item.get("String_Node_Str")).shortValue());
  }
  MetaItemStack ism=new MetaItemStack(is);
  for (  String s : item.keySet()) {
    if (s.equalsIgnoreCase("String_Node_Str") || s.equalsIgnoreCase("String_Node_Str") || s.equalsIgnoreCase("String_Node_Str")) {
      continue;
    }
    try {
      ism.addStringMeta(null,true,s + "String_Node_Str" + item.get(s).toString().replaceAll("String_Node_Str","String_Node_Str"));
    }
 catch (    Exception ex) {
      continue;
    }
  }
  return ism.getItemStack();
}
Program: 141592
Project: 141592
Buggy source:
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Enchantment ench=EnchantmentDatabase.getByName(args[0]);
  if (ench == null) {
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
    return;
  }
  ItemStack stack=p.getItemInHand();
  if (stack == null || stack.getType() == null || stack.getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String name=ench.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  Integer level=1;
  if (r.checkArgs(args,1) == true && r.isInt(args[1])) {
    level=Integer.parseInt(args[1]);
  }
  if (level < 0) {
    level=0;
  }
  if (level == 0) {
    stack.removeEnchantment(ench);
  }
 else {
    MetaItemStack stack2=new MetaItemStack(stack);
    stack2.addEnchantment(cs,r.perm(cs,"String_Node_Str",false,false),ench,level);
    p.setItemInHand(stack2.getItemStack());
  }
  r.sendMes(cs,"String_Node_Str","String_Node_Str",name,"String_Node_Str",level,"String_Node_Str",ItemUtil.getName(stack).toLowerCase());
}

Fixed version (ground truth):
@Override public void run(final CommandSender cs,String label,String[] args){
  if (!r.perm(cs,"String_Node_Str",false,true)) {
    return;
  }
  if (!r.isPlayer(cs)) {
    return;
  }
  if (!r.checkArgs(args,0)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  Player p=(Player)cs;
  Enchantment ench=EnchantmentDatabase.getByName(args[0]);
  if (ench == null) {
    r.sendMes(cs,"String_Node_Str","String_Node_Str",args[0]);
    return;
  }
  ItemStack stack=p.getItemInHand();
  if (stack == null || stack.getType() == null || stack.getType().equals(Material.AIR)) {
    r.sendMes(cs,"String_Node_Str");
    return;
  }
  String name=ench.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  Integer level=1;
  if (r.checkArgs(args,1) == true && r.isInt(args[1])) {
    level=Integer.parseInt(args[1]);
  }
  if (level < 0) {
    level=0;
  }
  if (level == 0) {
    stack.removeEnchantment(ench);
    r.sendMes(cs,"String_Node_Str","String_Node_Str",name,"String_Node_Str",level,"String_Node_Str",ItemUtil.getName(stack).toLowerCase());
  }
 else {
    try {
      MetaItemStack stack2=new MetaItemStack(stack);
      stack2.addEnchantment(cs,r.perm(cs,"String_Node_Str",false,false),ench,level);
      p.setItemInHand(stack2.getItemStack());
      r.sendMes(cs,"String_Node_Str","String_Node_Str",name,"String_Node_Str",level,"String_Node_Str",ItemUtil.getName(stack).toLowerCase());
    }
 catch (    IllegalArgumentException ex) {
      if (ex.getMessage() != null && ex.getMessage().contains("String_Node_Str")) {
        r.sendMes(cs,"String_Node_Str");
        return;
      }
      return;
    }
  }
}