nus-yam/ex-repair huggingface dataset:
Program: 10407
Project: 10407
Buggy source:
/** 
 * To be used with the dBuggers' .report to provide debug output for objects that may have some kind of id or type also associated with the object.
 * @param prefix  name/type/simple description of the object being reported
 * @param id  additional id/type of the object
 * @param value  object being reported will report the value of toString()
 * @return  color coded debug report
 */
public static String debugUniqueObj(String prefix,String id,Object value){
  return "String_Node_Str" + prefix + "String_Node_Str"+ id+ "String_Node_Str"+ value.toString()+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * To be used with the dBuggers' .report to provide debug output for objects that may have some kind of id or type also associated with the object.
 * @param prefix  name/type/simple description of the object being reported
 * @param id  additional id/type of the object
 * @param value  object being reported will report the value of toString()
 * @return  color coded debug report
 */
public static String debugUniqueObj(String prefix,String id,Object value){
  return "String_Node_Str" + prefix + "String_Node_Str"+ id+ "String_Node_Str"+ (value != null ? value.toString() : "String_Node_Str")+ "String_Node_Str";
}
Program: 10409
Project: 10409
Buggy source:
public dPlayer(OfflinePlayer player){
  this.player_name=player.getName();
  players.put(this.player_name,this);
}

Fixed version (ground truth):
public dPlayer(OfflinePlayer player){
  if (player == null)   return;
  this.player_name=player.getName();
  players.put(this.player_name,this);
}
Program: 10411
Project: 10411
Buggy source:
public void registerCoreTags(){
  new PlayerTags(denizen);
  new UtilTags(denizen);
  new FlagTags(denizen);
  new ConstantTags(denizen);
  new ProcedureScriptTag(denizen);
  new NPCTags(denizen);
  new AnchorTags(denizen);
  new ContextTags(denizen);
  new LocationTags(denizen);
  new SpecialCharacterTags(denizen);
  new TextTags(denizen);
  new ForeignCharacterTags(denizen);
}

Fixed version (ground truth):
public void registerCoreTags(){
  new PlayerTags(denizen);
  new UtilTags(denizen);
  new FlagTags(denizen);
  new ConstantTags(denizen);
  new ProcedureScriptTag(denizen);
  new NPCTags(denizen);
  new AnchorTags(denizen);
  new ContextTags(denizen);
  new LocationTags(denizen);
  new SpecialCharacterTags(denizen);
  new TextTags(denizen);
}
Program: 10412
Project: 10412
Buggy source:
/** 
 * This method is used to determine if the player is in a specified WorldGuard region.
 * @param thePlayer The player to check
 * @param region The WorldGuard region to check
 * @return returns a boolean value
 */
public static boolean checkPlayerWGRegion(Player thePlayer,String region){
  if (Depends.worldGuard == null)   return false;
  boolean inRegion=false;
  ApplicableRegionSet currentRegions=Depends.worldGuard.getRegionManager(thePlayer.getWorld()).getApplicableRegions(thePlayer.getLocation());
  for (  ProtectedRegion thisRegion : currentRegions) {
    dB.echoDebug("String_Node_Str" + thisRegion.getId());
    if (thisRegion.getId().contains(region)) {
      inRegion=true;
      dB.echoDebug("String_Node_Str");
    }
  }
  return inRegion;
}

Fixed version (ground truth):
/** 
 * This method is used to determine if the player is in a specified WorldGuard region.
 * @param thePlayer The player to check
 * @param region The WorldGuard region to check
 * @return returns a boolean value
 */
public static boolean checkPlayerWGRegion(Player thePlayer,String region){
  if (Depends.worldGuard == null)   return false;
  boolean inRegion=false;
  ApplicableRegionSet currentRegions=Depends.worldGuard.getRegionManager(thePlayer.getWorld()).getApplicableRegions(thePlayer.getLocation());
  for (  ProtectedRegion thisRegion : currentRegions) {
    dB.echoDebug("String_Node_Str" + thisRegion.getId());
    if (thisRegion.getId().equalsIgnoreCase(region)) {
      inRegion=true;
      dB.echoDebug("String_Node_Str");
    }
  }
  return inRegion;
}
Program: 10413
Project: 10413
Buggy source:
public void die(){
  if (player != null)   ((CraftLivingEntity)npc.getBukkitEntity()).getHandle().killer=(EntityHuman)((CraftLivingEntity)player).getHandle();
  setHealth();
  EntityDeathEvent entityDeath=new EntityDeathEvent(npc.getBukkitEntity(),null);
  NPCDeathEvent npcDeath=new NPCDeathEvent(npc,entityDeath);
  DenizenAPI.getCurrentInstance().getServer().getPluginManager().callEvent(npcDeath);
  DenizenAPI.getCurrentInstance().getServer().getPluginManager().callEvent(entityDeath);
  npc.despawn(DespawnReason.DEATH);
}

Fixed version (ground truth):
public void die(){
  try {
    if (player != null)     ((CraftLivingEntity)npc.getBukkitEntity()).getHandle().killer=(EntityHuman)((CraftLivingEntity)player).getHandle();
  }
 catch (  Exception e) {
    dB.echoError("String_Node_Str");
  }
  setHealth();
  EntityDeathEvent entityDeath=new EntityDeathEvent(npc.getBukkitEntity(),null);
  NPCDeathEvent npcDeath=new NPCDeathEvent(npc,entityDeath);
  DenizenAPI.getCurrentInstance().getServer().getPluginManager().callEvent(npcDeath);
  DenizenAPI.getCurrentInstance().getServer().getPluginManager().callEvent(entityDeath);
  npc.despawn(DespawnReason.DEATH);
}
Program: 10415
Project: 10415
Buggy source:
public void run(){
  if (npc.isSpawned())   return;
  npc.spawn(loc);
}

Fixed version (ground truth):
public void run(){
  if (npc.isSpawned())   return;
 else   npc.spawn(loc);
}
Program: 10417
Project: 10417
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  String outcome="String_Node_Str";
  Boolean passively=false;
  for (  String arg : scriptEntry.getArguments())   if (aH.matchesArg("String_Node_Str",arg))   passively=true;
 else   outcome=aH.getStringFrom(arg);
  scriptEntry.addObject("String_Node_Str",outcome).addObject("String_Node_Str",passively);
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  String outcome="String_Node_Str";
  Boolean passively=false;
  for (  String arg : scriptEntry.getArguments())   if (aH.matchesArg("String_Node_Str",arg))   passively=true;
 else   outcome=arg;
  scriptEntry.addObject("String_Node_Str",outcome).addObject("String_Node_Str",passively);
}
Program: 10418
Project: 10418
Buggy source:
@EventHandler(priority=EventPriority.LOWEST) public void playerChat(AsyncPlayerChatEvent event){
  Map<String,String> context=new HashMap<String,String>();
  context.put("String_Node_Str",event.getMessage());
  String determination=doEvent("String_Node_Str",null,event.getPlayer(),context);
  if (determination.toUpperCase().startsWith("String_Node_Str"))   event.setCancelled(true);
  if (aH.matchesValueArg("String_Node_Str",determination,aH.ArgumentType.String))   event.setMessage(aH.getStringFrom(determination));
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST) public void playerChat(AsyncPlayerChatEvent event){
  Map<String,String> context=new HashMap<String,String>();
  context.put("String_Node_Str",event.getMessage());
  String determination=doEvent("String_Node_Str",null,event.getPlayer(),context);
  dB.echoDebug(determination);
  if (determination.toUpperCase().startsWith("String_Node_Str"))   event.setCancelled(true);
  if (determination.toUpperCase().startsWith("String_Node_Str"))   event.setMessage(aH.getStringFrom(determination));
}
Program: 10421
Project: 10421
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  Duration duration=(Duration)scriptEntry.getObject("String_Node_Str");
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  Action action=(Action)scriptEntry.getObject("String_Node_Str");
  dB.report(getName(),aH.debugObj("String_Node_Str",action.toString()) + item.debug() + (duration != null ? duration.debug() : "String_Node_Str")+ location.debug());
  if (action == Action.PLACE) {
    int ticks=Integer.MAX_VALUE;
    if (duration != null)     ticks=duration.getTicksAsInt();
    if (displayed.containsKey(location.dScriptArgValue())) {
      displayed.get(location.dScriptArgValue()).remove();
      displayed.remove(location.dScriptArgValue());
    }
    displayed.put(location.dScriptArgValue(),location.getWorld().dropItem(location,item));
    displayed.get(location.dScriptArgValue()).setPickupDelay(Integer.MAX_VALUE);
    displayed.get(location.dScriptArgValue()).setTicksLived(ticks);
  }
 else   if (action == Action.REMOVE) {
    if (displayed.containsKey(location.dScriptArgValue())) {
      displayed.get(location.dScriptArgValue()).remove();
      displayed.remove(location.dScriptArgValue());
    }
  }
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  Duration duration=(Duration)scriptEntry.getObject("String_Node_Str");
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  Action action=(Action)scriptEntry.getObject("String_Node_Str");
  dB.report(getName(),aH.debugObj("String_Node_Str",action.toString()) + item.debug() + (duration != null ? duration.debug() : "String_Node_Str")+ location.debug());
  if (action == Action.PLACE) {
    int ticks=Integer.MAX_VALUE;
    if (duration != null)     ticks=duration.getTicksAsInt();
    if (displayed.containsKey(location.dScriptArgValue())) {
      displayed.get(location.dScriptArgValue()).remove();
      displayed.remove(location.dScriptArgValue());
    }
    displayed.put(location.dScriptArgValue(),location.getBlock().getLocation().getWorld().dropItem(location,item.getItemStack()));
    displayed.get(location.dScriptArgValue()).setPickupDelay(Integer.MAX_VALUE);
    displayed.get(location.dScriptArgValue()).setTicksLived(ticks);
  }
 else   if (action == Action.REMOVE) {
    if (displayed.containsKey(location.dScriptArgValue())) {
      displayed.get(location.dScriptArgValue()).remove();
      displayed.remove(location.dScriptArgValue());
    }
  }
}
Program: 10422
Project: 10422
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  Integer qty=(Integer)scriptEntry.getObject("String_Node_Str");
  Boolean exp=(Boolean)scriptEntry.getObject("String_Node_Str");
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  if (qty != null && item != null)   item.setAmount(qty);
 else   qty=1;
  dB.report(getName(),location.debug() + (item != null ? item.debug() : aH.debugObj("String_Node_Str",String.valueOf(qty))));
  if (exp)   ((ExperienceOrb)location.getWorld().spawnEntity(location,EntityType.EXPERIENCE_ORB)).setExperience(qty);
 else   location.getWorld().dropItemNaturally(location,item);
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  Integer qty=(Integer)scriptEntry.getObject("String_Node_Str");
  Boolean exp=(Boolean)scriptEntry.getObject("String_Node_Str");
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  if (qty != null && item != null)   item.getItemStack().setAmount(qty);
 else   qty=1;
  dB.report(getName(),location.debug() + (item != null ? item.debug() : aH.debugObj("String_Node_Str",String.valueOf(qty))));
  if (exp)   ((ExperienceOrb)location.getWorld().spawnEntity(location,EntityType.EXPERIENCE_ORB)).setExperience(qty);
 else   location.getWorld().dropItemNaturally(location,item.getItemStack());
}
Program: 10423
Project: 10423
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  Action action=Action.ADD;
  String target=scriptEntry.getPlayer().getName();
  ItemStack item=scriptEntry.getPlayer().getItemInHand() != null ? scriptEntry.getPlayer().getItemInHand() : null;
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg)) {
      action=Action.valueOf(aH.getStringFrom(arg).toUpperCase());
    }
 else     if (aH.matchesItem(arg)) {
      item=aH.getItemFrom(arg);
    }
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
  }
  if (item == null)   throw new InvalidArgumentsException(Messages.ERROR_MISSING_OTHER,"String_Node_Str");
  if (target == null)   throw new InvalidArgumentsException(Messages.ERROR_NO_PLAYER);
  scriptEntry.addObject("String_Node_Str",action).addObject("String_Node_Str",target).addObject("String_Node_Str",item);
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  Action action=Action.ADD;
  String target=scriptEntry.getPlayer().getName();
  ItemStack item=scriptEntry.getPlayer().getItemInHand() != null ? scriptEntry.getPlayer().getItemInHand() : null;
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg)) {
      action=Action.valueOf(aH.getStringFrom(arg).toUpperCase());
    }
 else     if (aH.matchesItem(arg)) {
      item=aH.getItemFrom(arg).getItemStack();
    }
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
  }
  if (item == null)   throw new InvalidArgumentsException(Messages.ERROR_MISSING_OTHER,"String_Node_Str");
  if (target == null)   throw new InvalidArgumentsException(Messages.ERROR_NO_PLAYER);
  scriptEntry.addObject("String_Node_Str",action).addObject("String_Node_Str",target).addObject("String_Node_Str",item);
}
Program: 10424
Project: 10424
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  EquipType equipType=(EquipType)scriptEntry.getObject("String_Node_Str");
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  NPC npc=scriptEntry.getNPC().getCitizen();
  if (!npc.hasTrait(Equipment.class))   npc.addTrait(Equipment.class);
  Equipment trait=npc.getTrait(Equipment.class);
switch (equipType) {
case BOOTS:
    trait.set(4,item);
  dB.echoDebug("String_Node_Str" + item.getType() + "String_Node_Str");
break;
case CHEST:
trait.set(2,item);
dB.echoDebug("String_Node_Str" + item.getType() + "String_Node_Str");
break;
case HAND:
trait.set(0,item);
dB.echoDebug("String_Node_Str" + item.getType() + "String_Node_Str");
break;
case HEAD:
trait.set(1,item);
dB.echoDebug("String_Node_Str" + item.getType() + "String_Node_Str");
break;
case LEGS:
trait.set(3,item);
dB.echoDebug("String_Node_Str" + item.getType() + "String_Node_Str");
break;
}
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  EquipType equipType=(EquipType)scriptEntry.getObject("String_Node_Str");
  Item item=(Item)scriptEntry.getObject("String_Node_Str");
  NPC npc=scriptEntry.getNPC().getCitizen();
  if (!npc.hasTrait(Equipment.class))   npc.addTrait(Equipment.class);
  Equipment trait=npc.getTrait(Equipment.class);
switch (equipType) {
case BOOTS:
    trait.set(4,item.getItemStack());
  break;
case CHEST:
trait.set(2,item.getItemStack());
break;
case HAND:
trait.set(0,item.getItemStack());
break;
case HEAD:
trait.set(1,item.getItemStack());
break;
case LEGS:
trait.set(3,item.getItemStack());
break;
}
}
Program: 10425
Project: 10425
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dB.echoDebug("String_Node_Str" + scriptEntry.toString() + "String_Node_Str");
  if (giveType != null) {
switch (giveType) {
case MONEY:
      if (Depends.economy != null) {
        double doubleAmount=(double)theAmount;
        dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str");
        Depends.economy.depositPlayer(player.getName(),doubleAmount);
      }
 else {
        dB.echoError("String_Node_Str");
      }
    break;
case EXP:
  player.giveExp(theAmount);
dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str");
break;
case ITEM:
theItem.setAmount(theAmount);
if (engrave) {
dB.echoDebug("String_Node_Str" + theItem + "String_Node_Str");
NBTItem.addCustomNBT(theItem,"String_Node_Str",player.getName());
}
dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str"+ theItem);
HashMap<Integer,ItemStack> leftovers=player.getInventory().addItem(theItem);
if (!leftovers.isEmpty()) {
dB.echoDebug("String_Node_Str");
for (Map.Entry<Integer,ItemStack> leftoverItem : leftovers.entrySet()) {
player.getWorld().dropItem(player.getLocation(),leftoverItem.getValue());
}
}
break;
}
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dB.echoDebug("String_Node_Str" + scriptEntry.toString() + "String_Node_Str");
  if (giveType != null) {
switch (giveType) {
case MONEY:
      if (Depends.economy != null) {
        double doubleAmount=(double)theAmount;
        dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str");
        Depends.economy.depositPlayer(player.getName(),doubleAmount);
      }
 else {
        dB.echoError("String_Node_Str");
      }
    break;
case EXP:
  player.giveExp(theAmount);
dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str");
break;
case ITEM:
theItem.getItemStack().setAmount(theAmount);
if (engrave) {
dB.echoDebug("String_Node_Str" + theItem + "String_Node_Str");
NBTItem.addCustomNBT(theItem.getItemStack(),"String_Node_Str",player.getName());
}
dB.echoDebug("String_Node_Str" + theAmount + "String_Node_Str"+ theItem);
HashMap<Integer,ItemStack> leftovers=player.getInventory().addItem(theItem.getItemStack());
if (!leftovers.isEmpty()) {
dB.echoDebug("String_Node_Str");
for (Map.Entry<Integer,ItemStack> leftoverItem : leftovers.entrySet()) {
player.getWorld().dropItem(player.getLocation(),leftoverItem.getValue());
}
}
break;
}
}
}
Program: 10427
Project: 10427
Buggy source:
/** 
 * Gets a currently saved ItemStack, created with Denizen's NEW command, given a case-insensitive 'id'. Note: These do not persist through a restart and may return null in such a case. This is meant for working with ItemStacks in the short-term, ie. creating an item (with NEW) and applying enchants, lore, etc. directly after.
 * @param id ID specified upon creation
 * @return the saved ItemStack, or null if not found
 */
public ItemStack getItem(String id){
  if (itemStacks.containsKey(id.toUpperCase()))   return itemStacks.get(id.toUpperCase());
 else   return null;
}

Fixed version (ground truth):
/** 
 * Gets a currently saved ItemStack, created with Denizen's NEW command, given a case-insensitive 'id'. Note: These do not persist through a restart and may return null in such a case. This is meant for working with ItemStacks in the short-term, ie. creating an item (with NEW) and applying enchants, lore, etc. directly after.
 * @param id ID specified upon creation
 * @return the saved ItemStack, or null if not found
 */
public ItemStack getItem(String id){
  if (itemStacks.containsKey(id.toUpperCase()))   return itemStacks.get(id.toUpperCase()).getItemStack();
 else   return null;
}
Program: 10428
Project: 10428
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  boolean savedItem=false;
  BookAction action=BookAction.NONE;
  Item book=null;
  Player player=scriptEntry.getPlayer();
  String scriptName=null;
  Location location=null;
  dNPC npc=scriptEntry.getNPC();
  if (npc != null)   location=npc.getLocation();
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg))     action=BookAction.valueOf(arg.toUpperCase());
 else     if (aH.matchesScript(arg))     scriptName=aH.getStringFrom(arg);
 else     if (aH.matchesLocation(arg)) {
      location=aH.getLocationFrom(arg);
      action=BookAction.DROP;
    }
 else     if (aH.matchesItem(arg)) {
      book=aH.getItemFrom(arg);
      if (book.getType() == Material.BOOK || book.getType() == Material.WRITTEN_BOOK) {
        savedItem=true;
      }
 else {
        book=null;
      }
    }
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
  }
  if (action == BookAction.NONE && !savedItem)   action=BookAction.GIVE;
  if (scriptName == null)   throw new InvalidArgumentsException("String_Node_Str");
  if (book == null)   book=new Item(387);
  scriptEntry.addObject("String_Node_Str",action);
  scriptEntry.addObject("String_Node_Str",book);
  scriptEntry.addObject("String_Node_Str",scriptName);
  scriptEntry.addObject("String_Node_Str",player);
  scriptEntry.addObject("String_Node_Str",location);
  scriptEntry.addObject("String_Node_Str",npc);
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  boolean savedItem=false;
  BookAction action=BookAction.NONE;
  Item book=null;
  Player player=scriptEntry.getPlayer();
  String scriptName=null;
  Location location=null;
  dNPC npc=scriptEntry.getNPC();
  if (npc != null)   location=npc.getLocation();
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg))     action=BookAction.valueOf(arg.toUpperCase());
 else     if (aH.matchesScript(arg))     scriptName=aH.getStringFrom(arg);
 else     if (aH.matchesLocation(arg)) {
      location=aH.getLocationFrom(arg);
      action=BookAction.DROP;
    }
 else     if (aH.matchesItem(arg)) {
      book=aH.getItemFrom(arg);
      if (book.getItemStack().getType() == Material.BOOK || book.getItemStack().getType() == Material.WRITTEN_BOOK) {
        savedItem=true;
      }
 else {
        book=null;
      }
    }
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
  }
  if (action == BookAction.NONE && !savedItem)   action=BookAction.GIVE;
  if (scriptName == null)   throw new InvalidArgumentsException("String_Node_Str");
  if (book == null)   book=new Item(387);
  scriptEntry.addObject("String_Node_Str",action);
  scriptEntry.addObject("String_Node_Str",book);
  scriptEntry.addObject("String_Node_Str",scriptName);
  scriptEntry.addObject("String_Node_Str",player);
  scriptEntry.addObject("String_Node_Str",location);
  scriptEntry.addObject("String_Node_Str",npc);
}
Program: 10429
Project: 10429
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  BookAction action=(BookAction)scriptEntry.getObject("String_Node_Str");
  Item book=(Item)scriptEntry.getObject("String_Node_Str");
  String scriptName=(String)scriptEntry.getObject("String_Node_Str");
  Player player=(Player)scriptEntry.getObject("String_Node_Str");
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  dNPC npc=(dNPC)scriptEntry.getObject("String_Node_Str");
  BookScriptContainer bookScript=ScriptRegistry.getScriptContainerAs(scriptName,BookScriptContainer.class);
  book=bookScript.writeBookTo(book,player,npc);
switch (action) {
case DROP:
    dropBook(location,book);
  break;
case GIVE:
giveBook(player,book);
break;
case EQUIP:
equipBook(player,book);
break;
case NONE:
break;
}
player.updateInventory();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  BookAction action=(BookAction)scriptEntry.getObject("String_Node_Str");
  Item book=(Item)scriptEntry.getObject("String_Node_Str");
  String scriptName=(String)scriptEntry.getObject("String_Node_Str");
  Player player=(Player)scriptEntry.getObject("String_Node_Str");
  Location location=(Location)scriptEntry.getObject("String_Node_Str");
  dNPC npc=(dNPC)scriptEntry.getObject("String_Node_Str");
  BookScriptContainer bookScript=ScriptRegistry.getScriptContainerAs(scriptName,BookScriptContainer.class);
  book=bookScript.writeBookTo(book,player,npc);
switch (action) {
case DROP:
    dropBook(location,book.getItemStack());
  break;
case GIVE:
giveBook(player,book.getItemStack());
break;
case EQUIP:
equipBook(player,book.getItemStack());
break;
case NONE:
break;
}
player.updateInventory();
}
Program: 10430
Project: 10430
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  TakeType takeType=null;
  double quantity=1;
  ItemStack item=null;
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg)) {
      takeType=TakeType.MONEY;
      dB.echoDebug("String_Node_Str");
    }
 else     if (aH.matchesArg("String_Node_Str",arg)) {
      takeType=TakeType.ITEMINHAND;
      dB.echoDebug("String_Node_Str");
    }
 else     if (aH.matchesQuantity(arg)) {
      quantity=aH.getDoubleFrom(arg);
      dB.echoDebug("String_Node_Str" + quantity);
    }
 else     if (aH.matchesItem(arg) || aH.matchesItem("String_Node_Str" + arg)) {
      takeType=TakeType.ITEM;
      item=aH.getItemFrom(arg);
      dB.echoDebug("String_Node_Str" + item.getType());
    }
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
    scriptEntry.addObject("String_Node_Str",item);
    scriptEntry.addObject("String_Node_Str",takeType);
    scriptEntry.addObject("String_Node_Str",quantity);
  }
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  TakeType takeType=null;
  double quantity=1;
  ItemStack item=null;
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg))     takeType=TakeType.MONEY;
 else     if (aH.matchesArg("String_Node_Str",arg))     takeType=TakeType.ITEMINHAND;
 else     if (aH.matchesQuantity(arg))     quantity=aH.getDoubleFrom(arg);
 else     if (aH.matchesItem(arg) || aH.matchesItem("String_Node_Str" + arg))     takeType=TakeType.ITEM;
 else     throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT,arg);
  }
  scriptEntry.addObject("String_Node_Str",item);
  scriptEntry.addObject("String_Node_Str",takeType);
  scriptEntry.addObject("String_Node_Str",quantity);
}
Program: 10432
Project: 10432
Buggy source:
public Item writeBookTo(Item book,Player player,dNPC npc){
  BookMeta bookInfo=(BookMeta)book.getItemMeta();
  if (contains("String_Node_Str")) {
    String title=getString("String_Node_Str");
    title=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,title,false);
    bookInfo.setTitle(title);
  }
  if (contains("String_Node_Str")) {
    String author=getString("String_Node_Str");
    author=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,author,false);
    bookInfo.setAuthor(author);
  }
  if (contains("String_Node_Str")) {
    List<String> pages=getStringList("String_Node_Str");
    for (    String page : pages) {
      page=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,page,false);
      bookInfo.addPage(page);
    }
  }
  book.setItemMeta(bookInfo);
  return book;
}

Fixed version (ground truth):
public Item writeBookTo(Item book,Player player,dNPC npc){
  BookMeta bookInfo=(BookMeta)book.getItemStack().getItemMeta();
  if (contains("String_Node_Str")) {
    String title=getString("String_Node_Str");
    title=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,title,false);
    bookInfo.setTitle(title);
  }
  if (contains("String_Node_Str")) {
    String author=getString("String_Node_Str");
    author=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,author,false);
    bookInfo.setAuthor(author);
  }
  if (contains("String_Node_Str")) {
    List<String> pages=getStringList("String_Node_Str");
    for (    String page : pages) {
      page=DenizenAPI.getCurrentInstance().tagManager().tag(player,npc,page,false);
      bookInfo.addPage(page);
    }
  }
  book.getItemStack().setItemMeta(bookInfo);
  return book;
}
Program: 10434
Project: 10434
Buggy source:
@Override public boolean check(RequirementsContext context,List<String> args) throws RequirementCheckException {
  boolean outcome=false;
  boolean exact=false;
  int quantity=1;
  ItemStack itemToCheck=null;
  for (  String thisArg : args) {
    if (aH.matchesQuantity(thisArg)) {
      quantity=aH.getIntegerFrom(thisArg);
      dB.echoDebug("String_Node_Str" + quantity);
    }
 else     if (aH.matchesArg("String_Node_Str",thisArg)) {
      exact=true;
      dB.echoDebug("String_Node_Str");
    }
 else {
      itemToCheck=new ItemStack(aH.getItemFrom(thisArg));
      dB.echoDebug("String_Node_Str" + itemToCheck);
    }
  }
  if (itemToCheck != null) {
    itemToCheck.setAmount(quantity);
  }
  if (exact)   outcome=context.getPlayer().getItemInHand().equals(itemToCheck);
 else   outcome=context.getPlayer().getItemInHand().isSimilar(itemToCheck);
  if (outcome)   dB.echoDebug("String_Node_Str");
  return outcome;
}

Fixed version (ground truth):
@Override public boolean check(RequirementsContext context,List<String> args) throws RequirementCheckException {
  boolean outcome=false;
  boolean exact=false;
  int quantity=1;
  Item itemToCheck=null;
  for (  String thisArg : args) {
    if (aH.matchesQuantity(thisArg))     quantity=aH.getIntegerFrom(thisArg);
 else     if (aH.matchesArg("String_Node_Str",thisArg)) {
      exact=true;
    }
 else     itemToCheck=aH.getItemFrom(thisArg);
  }
  if (itemToCheck != null)   itemToCheck.getItemStack().setAmount(quantity);
  if (exact)   outcome=context.getPlayer().getItemInHand().equals(itemToCheck);
 else   outcome=context.getPlayer().getItemInHand().isSimilar(itemToCheck.getItemStack());
  dB.report("String_Node_Str",(outcome) ? (exact) ? "String_Node_Str" : "String_Node_Str" : "String_Node_Str");
  return outcome;
}
Program: 10435
Project: 10435
Buggy source:
@Override public boolean check(RequirementsContext context,List<String> args) throws RequirementCheckException {
  for (  String arg : args) {
    if (aH.matchesQuantity(arg)) {
      quantity=aH.getIntegerFrom(arg);
      dB.echoDebug("String_Node_Str" + quantity);
      continue;
    }
 else     if (aH.matchesItem(arg)) {
      if (ScriptRegistry.getScriptContainerAs(aH.getStringFrom(arg),ItemScriptContainer.class) != null) {
        item=ScriptRegistry.getScriptContainerAs(aH.getStringFrom(arg),ItemScriptContainer.class).getItemFrom(context.getPlayer(),context.getNPC());
        dB.echoDebug("String_Node_Str");
        continue;
      }
 else {
        item=aH.getItemFrom(arg);
        dB.echoDebug("String_Node_Str");
        continue;
      }
    }
 else     if (aH.matchesItem("String_Node_Str" + arg)) {
      item=aH.getItemFrom("String_Node_Str" + arg);
      dB.echoDebug("String_Node_Str");
      continue;
    }
 else     throw new RequirementCheckException("String_Node_Str");
  }
  if (context.getPlayer().getInventory().containsAtLeast(item,quantity)) {
    dB.echoDebug("String_Node_Str");
    return true;
  }
 else {
    dB.echoDebug("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean check(RequirementsContext context,List<String> args) throws RequirementCheckException {
  for (  String arg : args) {
    if (aH.matchesQuantity(arg)) {
      quantity=aH.getIntegerFrom(arg);
      dB.echoDebug("String_Node_Str" + quantity);
      continue;
    }
 else     if (aH.matchesItem(arg)) {
      if (ScriptRegistry.getScriptContainerAs(aH.getStringFrom(arg),ItemScriptContainer.class) != null) {
        item=ScriptRegistry.getScriptContainerAs(aH.getStringFrom(arg),ItemScriptContainer.class).getItemFrom(context.getPlayer(),context.getNPC()).getItemStack();
        dB.echoDebug("String_Node_Str");
        continue;
      }
 else {
        item=aH.getItemFrom(arg).getItemStack();
        dB.echoDebug("String_Node_Str");
        continue;
      }
    }
 else     if (aH.matchesItem("String_Node_Str" + arg)) {
      item=aH.getItemFrom("String_Node_Str" + arg).getItemStack();
      dB.echoDebug("String_Node_Str");
      continue;
    }
 else     throw new RequirementCheckException("String_Node_Str");
  }
  if (context.getPlayer().getInventory().containsAtLeast(item,quantity)) {
    dB.echoDebug("String_Node_Str");
    return true;
  }
 else {
    dB.echoDebug("String_Node_Str");
    return false;
  }
}
Program: 10436
Project: 10436
Buggy source:
@EventHandler public void clickTrigger(NPCRightClickEvent event){
  if (!event.getNPC().hasTrait(TriggerTrait.class))   return;
  dNPC npc=DenizenAPI.getDenizenNPC(event.getNPC());
  if (!npc.getTriggerTrait().isEnabled(name))   return;
  if (!npc.getTriggerTrait().trigger(this,event.getClicker()))   return;
  Player player=event.getClicker();
  InteractScriptContainer script=npc.getInteractScript(player,getClass());
  String id=null;
  if (script != null) {
    Map<String,String> idMap=script.getIdMapFor(this.getClass(),player);
    if (!idMap.isEmpty())     for (    Map.Entry<String,String> entry : idMap.entrySet()) {
      String entry_value=TagManager.tag(player,npc,entry.getValue());
      if (Item.valueOf(entry_value).matches(player.getItemInHand()) && script.checkSpecificTriggerScriptRequirementsFor(this.getClass(),player,npc,entry.getKey()))       id=entry.getKey();
    }
  }
  if (!parse(npc,player,script,id))   npc.action("String_Node_Str",player);
}

Fixed version (ground truth):
@EventHandler public void clickTrigger(NPCRightClickEvent event){
  if (!event.getNPC().hasTrait(TriggerTrait.class))   return;
  dNPC npc=DenizenAPI.getDenizenNPC(event.getNPC());
  if (!npc.getTriggerTrait().isEnabled(name))   return;
  if (!npc.getTriggerTrait().trigger(this,event.getClicker()))   return;
  Player player=event.getClicker();
  InteractScriptContainer script=npc.getInteractScript(player,getClass());
  String id=null;
  if (script != null) {
    Map<String,String> idMap=script.getIdMapFor(this.getClass(),player);
    if (!idMap.isEmpty())     for (    Map.Entry<String,String> entry : idMap.entrySet()) {
      String entry_value=TagManager.tag(player,npc,entry.getValue());
      if (Item.valueOf(entry_value).comparesTo(player.getItemInHand()) >= 0 && script.checkSpecificTriggerScriptRequirementsFor(this.getClass(),player,npc,entry.getKey()))       id=entry.getKey();
    }
  }
  if (!parse(npc,player,script,id))   npc.action("String_Node_Str",player);
}
Program: 10437
Project: 10437
Buggy source:
@EventHandler public void damageTrigger(EntityDamageByEntityEvent event){
  Player player=null;
  if (event.getDamager() instanceof Player)   player=(Player)event.getDamager();
 else   if (event.getDamager() instanceof Projectile && ((Projectile)event.getDamager()).getShooter() instanceof Player)   player=(Player)((Projectile)event.getDamager()).getShooter();
  if (CitizensAPI.getNPCRegistry().isNPC(event.getEntity()) && player != null) {
    dNPC npc=DenizenAPI.getDenizenNPC(CitizensAPI.getNPCRegistry().getNPC(event.getEntity()));
    if (!npc.getCitizen().hasTrait(TriggerTrait.class))     return;
    if (!npc.getTriggerTrait().isEnabled(name))     return;
    if (!npc.getTriggerTrait().trigger(this,player))     return;
    InteractScriptContainer script=InteractScriptHelper.getInteractScript(npc,player,getClass());
    String id=null;
    if (script != null) {
      Map<String,String> idMap=script.getIdMapFor(this.getClass(),player);
      if (!idMap.isEmpty())       for (      Map.Entry<String,String> entry : idMap.entrySet()) {
        String entry_value=TagManager.tag(player,npc,entry.getValue());
        if (Item.valueOf(entry_value).matches(player.getItemInHand()) && script.checkSpecificTriggerScriptRequirementsFor(this.getClass(),player,npc,entry.getKey()))         id=entry.getKey();
      }
    }
    if (!parse(npc,player,script,id))     npc.action("String_Node_Str",player);
  }
}

Fixed version (ground truth):
@EventHandler public void damageTrigger(EntityDamageByEntityEvent event){
  Player player=null;
  if (event.getDamager() instanceof Player)   player=(Player)event.getDamager();
 else   if (event.getDamager() instanceof Projectile && ((Projectile)event.getDamager()).getShooter() instanceof Player)   player=(Player)((Projectile)event.getDamager()).getShooter();
  if (CitizensAPI.getNPCRegistry().isNPC(event.getEntity()) && player != null) {
    dNPC npc=DenizenAPI.getDenizenNPC(CitizensAPI.getNPCRegistry().getNPC(event.getEntity()));
    if (!npc.getCitizen().hasTrait(TriggerTrait.class))     return;
    if (!npc.getTriggerTrait().isEnabled(name))     return;
    if (!npc.getTriggerTrait().trigger(this,player))     return;
    InteractScriptContainer script=InteractScriptHelper.getInteractScript(npc,player,getClass());
    String id=null;
    if (script != null) {
      Map<String,String> idMap=script.getIdMapFor(this.getClass(),player);
      if (!idMap.isEmpty())       for (      Map.Entry<String,String> entry : idMap.entrySet()) {
        String entry_value=TagManager.tag(player,npc,entry.getValue());
        if (Item.valueOf(entry_value).comparesTo(player.getItemInHand()) >= 0 && script.checkSpecificTriggerScriptRequirementsFor(this.getClass(),player,npc,entry.getKey()))         id=entry.getKey();
      }
    }
    if (!parse(npc,player,script,id))     npc.action("String_Node_Str",player);
  }
}
Program: 10440
Project: 10440
Buggy source:
/** 
 * This method will be called every time a player moves in the game.  It's used to determine if a player has satisfied a certain travel goal.
 * @param event	The player movement event.
 */
@EventHandler public void walking(PlayerMoveEvent event){
  if (!(event.getPlayer() == player))   return;
  if (type == TravelType.DISTANCE) {
    if (!event.getTo().getBlock().equals(event.getFrom().getBlock())) {
      blocksWalked++;
      dB.echoDebug("String_Node_Str");
      check();
    }
  }
 else   if (type == TravelType.TOLOCATION) {
    if (player.getLocation().distance(endPoint) <= radius) {
      dB.echoDebug("String_Node_Str");
      finish();
    }
  }
 else   if (type == TravelType.TONPC) {
    if (player.getLocation().distance(target.getBukkitEntity().getLocation()) <= radius) {
      dB.echoDebug("String_Node_Str");
      finish();
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will be called every time a player moves in the game.  It's used to determine if a player has satisfied a certain travel goal.
 * @param event	The player movement event.
 */
@EventHandler public void walking(PlayerMoveEvent event){
  if (!(event.getPlayer() == player))   return;
  if (player.getLocation().getWorld().equals(endPoint.getWorld()))   return;
  if (type == TravelType.DISTANCE) {
    if (!event.getTo().getBlock().equals(event.getFrom().getBlock())) {
      blocksWalked++;
      dB.echoDebug("String_Node_Str");
      check();
    }
  }
 else   if (type == TravelType.TOLOCATION) {
    if (player.getLocation().distance(endPoint) <= radius) {
      dB.echoDebug("String_Node_Str");
      finish();
    }
  }
 else   if (type == TravelType.TONPC) {
    if (player.getLocation().distance(target.getBukkitEntity().getLocation()) <= radius) {
      dB.echoDebug("String_Node_Str");
      finish();
    }
  }
}
Program: 10441
Project: 10441
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  ScriptQueue queue=scriptEntry.getResidingQueue();
  Action action=null;
  Duration delay=null;
  List<ScriptQueue> queues=new ArrayList<ScriptQueue>();
  queues.add(scriptEntry.getResidingQueue());
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg))     action=Action.valueOf(aH.getStringFrom(arg).toUpperCase());
 else     if (aH.matchesValueArg("String_Node_Str",arg,aH.ArgumentType.Duration)) {
      action=Action.DELAY;
      delay=aH.getDurationFrom(arg);
    }
 else {
      queues.clear();
      for (      String queueName : aH.getListFrom(arg)) {
        try {
          queues.add(aH.getQueueFrom(queueName));
        }
 catch (        Exception e) {
        }
      }
    }
  }
  if (queues.isEmpty())   queues.add(scriptEntry.getResidingQueue());
  if (action == null)   throw new InvalidArgumentsException("String_Node_Str");
  if (action == Action.DELAY && delay == null)   throw new InvalidArgumentsException("String_Node_Str");
  scriptEntry.addObject("String_Node_Str",queue).addObject("String_Node_Str",action).addObject("String_Node_Str",delay);
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  Action action=null;
  Duration delay=null;
  List<ScriptQueue> queues=new ArrayList<ScriptQueue>();
  queues.add(scriptEntry.getResidingQueue());
  for (  String arg : scriptEntry.getArguments()) {
    if (aH.matchesArg("String_Node_Str",arg))     action=Action.valueOf(aH.getStringFrom(arg).toUpperCase());
 else     if (aH.matchesValueArg("String_Node_Str",arg,aH.ArgumentType.Duration)) {
      action=Action.DELAY;
      delay=aH.getDurationFrom(arg);
    }
 else {
      queues.clear();
      for (      String queueName : aH.getListFrom(arg)) {
        try {
          queues.add(aH.getQueueFrom(queueName));
        }
 catch (        Exception e) {
        }
      }
    }
  }
  if (queues.isEmpty())   queues.add(scriptEntry.getResidingQueue());
  if (action == null)   throw new InvalidArgumentsException("String_Node_Str");
  if (action == Action.DELAY && delay == null)   throw new InvalidArgumentsException("String_Node_Str");
  scriptEntry.addObject("String_Node_Str",queues).addObject("String_Node_Str",action).addObject("String_Node_Str",delay);
}
Program: 10444
Project: 10444
Buggy source:
public boolean doEvent(String eventName,dNPC npc,Player player,Map<String,String> context){
  boolean cancelled=false;
  for (  WorldScriptContainer script : world_scripts.values()) {
    if (script == null)     continue;
    if (!script.contains("String_Node_Str" + eventName.toUpperCase()))     continue;
    dB.report("String_Node_Str",aH.debugObj("String_Node_Str","String_Node_Str" + eventName) + script.getAsScriptArg().debug() + (npc != null ? aH.debugObj("String_Node_Str",npc.toString()) : "String_Node_Str")+ (player != null ? aH.debugObj("String_Node_Str",player.getName()) : "String_Node_Str")+ (context != null ? aH.debugObj("String_Node_Str",context.toString()) : "String_Node_Str"));
    List<ScriptEntry> entries=script.getEntries(player,npc,"String_Node_Str" + eventName);
    if (entries.isEmpty())     continue;
    dB.echoDebug(dB.DebugElement.Header,"String_Node_Str" + eventName.toUpperCase() + "String_Node_Str"+ script.getName());
    if (context != null)     for (    Map.Entry<String,String> entry : context.entrySet())     ScriptBuilder.addObjectToEntries(entries,entry.getKey(),entry.getValue());
    long id=DetermineCommand.getNewId();
    ScriptBuilder.addObjectToEntries(entries,"String_Node_Str",id);
    ScriptQueue._getInstantQueue(ScriptQueue._getNextId()).addEntries(entries).start();
    if (DetermineCommand.outcomes.containsKey(id) && DetermineCommand.outcomes.get(id).equalsIgnoreCase("String_Node_Str")) {
      dB.echoDebug("String_Node_Str");
      cancelled=true;
    }
  }
  return cancelled;
}

Fixed version (ground truth):
public boolean doEvent(String eventName,dNPC npc,Player player,Map<String,String> context){
  boolean cancelled=false;
  for (  WorldScriptContainer script : world_scripts.values()) {
    if (script == null)     continue;
    if (!script.contains("String_Node_Str" + eventName.toUpperCase()))     continue;
    dB.report("String_Node_Str",aH.debugObj("String_Node_Str","String_Node_Str" + eventName) + script.getAsScriptArg().debug() + (npc != null ? aH.debugObj("String_Node_Str",npc.toString()) : "String_Node_Str")+ (player != null ? aH.debugObj("String_Node_Str",player.getName()) : "String_Node_Str")+ (context != null ? aH.debugObj("String_Node_Str",context.toString()) : "String_Node_Str"));
    List<ScriptEntry> entries=script.getEntries(player,npc,"String_Node_Str" + eventName);
    if (entries.isEmpty())     continue;
    dB.echoDebug(dB.DebugElement.Header,"String_Node_Str" + eventName.toUpperCase() + "String_Node_Str"+ script.getName());
    if (context != null)     for (    Map.Entry<String,String> entry : context.entrySet())     ScriptBuilder.addObjectToEntries(entries,entry.getKey(),entry.getValue());
    long id=DetermineCommand.getNewId();
    ScriptBuilder.addObjectToEntries(entries,"String_Node_Str",id);
    ScriptQueue._getInstantQueue(ScriptQueue._getNextId()).addEntries(entries).start();
    if (DetermineCommand.outcomes.containsKey(id) && DetermineCommand.outcomes.get(id).equalsIgnoreCase("String_Node_Str")) {
      cancelled=true;
    }
  }
  return cancelled;
}
Program: 10445
Project: 10445
Buggy source:
@Override public String getAttribute(String attribute){
  if (attribute == null)   return as_dScriptArg();
  attribute=attribute.toLowerCase();
  if (attribute.startsWith("String_Node_Str")) {
    return String.valueOf(Double.valueOf(seconds).intValue());
  }
  if (attribute.startsWith("String_Node_Str")) {
    return String.valueOf(seconds);
  }
  return as_dScriptArg();
}

Fixed version (ground truth):
@Override public String getAttribute(String attribute){
  if (attribute == null)   return as_dScriptArg();
  attribute=attribute.toLowerCase();
  if (attribute.startsWith("String_Node_Str"))   return String.valueOf(Double.valueOf(seconds).intValue());
  if (attribute.startsWith("String_Node_Str"))   return String.valueOf(Double.valueOf(seconds));
  if (attribute.startsWith("String_Node_Str"))   return String.valueOf(getTicksAsInt());
  if (attribute.startsWith("String_Node_Str")) {
    if (seconds % 43200 == 0)     return seconds / 86400 + "String_Node_Str";
 else     if (seconds % 1800 == 0)     return seconds / 3600 + "String_Node_Str";
 else     if (seconds % 30 == 0)     return seconds / 60 + "String_Node_Str";
 else     return seconds + "String_Node_Str";
  }
  return null;
}
Program: 10446
Project: 10446
Buggy source:
@Override public String debug(){
  return null;
}

Fixed version (ground truth):
@Override public String debug(){
  return "String_Node_Str" + prefix + "String_Node_Str"+ id+ "String_Node_Str";
}
Program: 10447
Project: 10447
Buggy source:
@Override public String as_dScriptArg(){
  return null;
}

Fixed version (ground truth):
@Override public String as_dScriptArg(){
  return prefix + "String_Node_Str" + id;
}
Program: 10448
Project: 10448
Buggy source:
@Override public String getAttribute(String attribute){
  return null;
}

Fixed version (ground truth):
@Override public String getAttribute(String attribute){
  if (attribute == null)   return as_dScriptArg();
  attribute=attribute.toLowerCase();
  return null;
}
Program: 10449
Project: 10449
Buggy source:
@Override public void run(){
  revolve();
}

Fixed version (ground truth):
@Override public void run(){
  while (isStarted)   revolve();
}
Program: 10450
Project: 10450
Buggy source:
public void start(){
  if (isStarted)   return;
  dB.log("String_Node_Str" + id + "String_Node_Str"+ ticks+ "String_Node_Str");
  isStarted=true;
  if (ticks > 0)   taskId=Bukkit.getScheduler().scheduleSyncRepeatingTask(DenizenAPI.getCurrentInstance(),new Runnable(){
    @Override public void run(){
      revolve();
    }
  }
,ticks,ticks);
 else   revolve();
}

Fixed version (ground truth):
public void start(){
  if (isStarted)   return;
  dB.log("String_Node_Str" + id + "String_Node_Str"+ ticks+ "String_Node_Str");
  isStarted=true;
  if (ticks > 0)   taskId=Bukkit.getScheduler().scheduleSyncRepeatingTask(DenizenAPI.getCurrentInstance(),new Runnable(){
    @Override public void run(){
      revolve();
    }
  }
,ticks,ticks);
 else {
    if (delay > System.currentTimeMillis()) {
      Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(),new Runnable(){
        @Override public void run(){
          while (isStarted)           revolve();
        }
      }
,delay);
    }
 else     while (isStarted)     revolve();
  }
}
Program: 10451
Project: 10451
Buggy source:
private void revolve(){
  if (scriptEntries.isEmpty())   stop();
  if (paused)   return;
  if (delay > System.currentTimeMillis()) {
    if (ticks == 0)     Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(),new Runnable(){
      @Override public void run(){
        revolve();
      }
    }
,Settings.InteractDelayInTicks());
    return;
  }
  DenizenAPI.getCurrentInstance().getScriptEngine().revolve(this);
}

Fixed version (ground truth):
private void revolve(){
  if (scriptEntries.isEmpty()) {
    stop();
    isStarted=false;
    return;
  }
  if (paused)   return;
  DenizenAPI.getCurrentInstance().getScriptEngine().revolve(this);
}