nus-yam/ex-repair huggingface dataset:
Program: 10295
Project: 10295
Buggy source:
@Override public String getAttribute(Attribute attribute){
  if (attribute == null)   return "String_Node_Str";
  if (attribute.startsWith("String_Node_Str")) {
    return new dItem(getPotion().getItem()).getAttribute(attribute.fulfill(2));
  }
  return null;
}

Fixed version (ground truth):
@Override public String getAttribute(Attribute attribute){
  if (attribute == null)   return "String_Node_Str";
  if (attribute.startsWith("String_Node_Str")) {
    return new dItem(getPotion().getItem()).getAttribute(attribute.fulfill(1));
  }
  return null;
}
Program: 10296
Project: 10296
Buggy source:
@Override public String getAttribute(Attribute attribute){
  if (attribute == null)   return "String_Node_Str";
  if (attribute.startsWith("String_Node_Str")) {
    return new Element(item.getMaterial().getData() > 0).getAttribute(attribute.fulfill(1));
  }
  if (item.getMaterial().getData() > 0) {
    if (attribute.startsWith("String_Node_Str")) {
      attribute=attribute.fulfill(1);
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).isSplash()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).hasExtendedDuration()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).getLevel()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).getType().name()).getAttribute(attribute.fulfill(1));
      }
      return new Element(getPropertyString()).getAttribute(attribute);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String getAttribute(Attribute attribute){
  if (attribute == null)   return "String_Node_Str";
  if (attribute.startsWith("String_Node_Str")) {
    return new Element(item.getItemStack().getDurability() > 0).getAttribute(attribute.fulfill(1));
  }
  if (item.getItemStack().getDurability() > 0) {
    if (attribute.startsWith("String_Node_Str")) {
      attribute=attribute.fulfill(1);
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).isSplash()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).hasExtendedDuration()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).getLevel()).getAttribute(attribute.fulfill(1));
      }
      if (attribute.startsWith("String_Node_Str")) {
        return new Element(Potion.fromItemStack(item.getItemStack()).getType().name()).getAttribute(attribute.fulfill(1));
      }
      return new Element(getPropertyString()).getAttribute(attribute);
    }
  }
  return null;
}
Program: 10297
Project: 10297
Buggy source:
@Override public String getPropertyString(){
  if (item.getMaterial().getData() == 0)   return null;
  Potion pot=Potion.fromItemStack(item.getItemStack());
  return pot.getType().name() + "String_Node_Str" + pot.getLevel()+ "String_Node_Str"+ pot.hasExtendedDuration()+ "String_Node_Str"+ pot.isSplash();
}

Fixed version (ground truth):
@Override public String getPropertyString(){
  if (item.getItemStack().getDurability() == 0)   return null;
  Potion pot=Potion.fromItemStack(item.getItemStack());
  return pot.getType().name() + "String_Node_Str" + pot.getLevel()+ "String_Node_Str"+ pot.hasExtendedDuration()+ "String_Node_Str"+ pot.isSplash();
}
Program: 10299
Project: 10299
Buggy source:
@Override public String getPropertyString(){
  StringBuilder output=new StringBuilder();
  BookMeta bookInfo=(BookMeta)item.getItemStack().getItemMeta();
  if (item.getItemStack().getType().equals(Material.WRITTEN_BOOK)) {
    output.append("String_Node_Str").append(EscapeTags.Escape(bookInfo.getAuthor())).append("String_Node_Str").append(EscapeTags.Escape(bookInfo.getTitle())).append("String_Node_Str");
  }
  output.append("String_Node_Str");
  for (  String page : bookInfo.getPages()) {
    output.append(EscapeTags.Escape(page)).append("String_Node_Str");
  }
  if (output.length() == 6)   return null;
 else   return output.substring(0,output.length() - 1);
}

Fixed version (ground truth):
@Override public String getPropertyString(){
  StringBuilder output=new StringBuilder();
  BookMeta bookInfo=(BookMeta)item.getItemStack().getItemMeta();
  if (item.getItemStack().getType().equals(Material.WRITTEN_BOOK) && bookInfo.hasAuthor() && bookInfo.hasTitle()) {
    output.append("String_Node_Str").append(EscapeTags.Escape(bookInfo.getAuthor())).append("String_Node_Str").append(EscapeTags.Escape(bookInfo.getTitle())).append("String_Node_Str");
  }
  output.append("String_Node_Str");
  if (bookInfo.hasPages()) {
    for (    String page : bookInfo.getPages()) {
      output.append(EscapeTags.Escape(page)).append("String_Node_Str");
    }
  }
  if (output.length() <= 6)   return null;
 else   return output.substring(0,output.length() - 1);
}
Program: 10300
Project: 10300
Buggy source:
/** 
 * A quick function to escape book Strings. This is just to prevent tag reading errors.
 * @param input the unescaped data.
 * @return the escaped data.
 */
public static String Escape(String input){
  return TagManager.CleanOutputFully(input).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * A quick function to escape book Strings. This is just to prevent tag reading errors.
 * @param input the unescaped data.
 * @return the escaped data.
 */
public static String Escape(String input){
  if (input == null)   return null;
  return TagManager.CleanOutputFully(input).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}
Program: 10301
Project: 10301
Buggy source:
/** 
 * A quick function to reverse a book string escaping. This is just to prevent tag reading errors.
 * @param input the escaped data.
 * @return the unescaped data.
 */
public static String unEscape(String input){
  return TagManager.CleanOutputFully(input).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str",String.valueOf((char)0x00A0)).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * A quick function to reverse a book string escaping. This is just to prevent tag reading errors.
 * @param input the escaped data.
 * @return the unescaped data.
 */
public static String unEscape(String input){
  if (input == null)   return null;
  return TagManager.CleanOutputFully(input).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str",String.valueOf((char)0x00A0)).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}
Program: 10310
Project: 10310
Buggy source:
@EventHandler public void savedEntryTags(ReplaceableTagEvent event){
  if (!event.matches("String_Node_Str") || event.getScriptEntry() == null)   return;
  if (event.getScriptEntry().getResidingQueue() != null && event.getScriptEntry().getResidingQueue().getHeldScriptEntry(event.getNameContext()) != null) {
    String id=event.getNameContext();
    Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry());
    ScriptEntry held=event.getScriptEntry().getResidingQueue().getHeldScriptEntry(id);
    if (held == null) {
      dB.echoError("String_Node_Str" + id);
    }
 else {
      if (!held.hasObject(attribute.getAttribute(2)) || held.getdObject(attribute.getAttribute(2)) == null) {
        dB.echoError("String_Node_Str" + attribute.getAttribute(2));
      }
 else {
        event.setReplaced(held.getdObject(attribute.getAttribute(2)).getAttribute(attribute.fulfill(2)));
      }
    }
  }
 else   event.setReplaced("String_Node_Str");
}

Fixed version (ground truth):
@EventHandler public void savedEntryTags(ReplaceableTagEvent event){
  if (!event.matches("String_Node_Str") || event.getScriptEntry() == null || !event.hasNameContext())   return;
  if (event.getScriptEntry().getResidingQueue() != null) {
    String id=event.getNameContext();
    Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry());
    ScriptEntry held=event.getScriptEntry().getResidingQueue().getHeldScriptEntry(id);
    if (held == null) {
      dB.echoError("String_Node_Str" + id);
    }
 else {
      if (!held.hasObject(attribute.getAttribute(2)) || held.getdObject(attribute.getAttribute(2)) == null) {
        dB.echoError("String_Node_Str" + attribute.getAttribute(2));
      }
 else {
        event.setReplaced(held.getdObject(attribute.getAttribute(2)).getAttribute(attribute.fulfill(2)));
      }
    }
  }
 else   event.setReplaced("String_Node_Str");
}
Program: 10311
Project: 10311
Buggy source:
public PropertyParser(){
  properties.clear();
  describes.clear();
  getFrom.clear();
  registerProperty(EntityAge.class,dEntity.class);
  registerProperty(EntityColor.class,dEntity.class);
  registerProperty(EntityFramed.class,dEntity.class);
  registerProperty(EntityInfected.class,dEntity.class);
  registerProperty(EntityProfession.class,dEntity.class);
  registerProperty(InventoryContents.class,dInventory.class);
  registerProperty(InventoryHolder.class,dInventory.class);
  registerProperty(InventorySize.class,dInventory.class);
  registerProperty(InventoryTitle.class,dInventory.class);
  registerProperty(ItemBook.class,dItem.class);
  registerProperty(ItemDisplayname.class,dItem.class);
  registerProperty(ItemDurability.class,dItem.class);
  registerProperty(ItemEnchantments.class,dItem.class);
  registerProperty(ItemLore.class,dItem.class);
  registerProperty(ItemPlantgrowth.class,dItem.class);
  registerProperty(ItemQuantity.class,dItem.class);
  registerProperty(ItemSkullskin.class,dItem.class);
}

Fixed version (ground truth):
public PropertyParser(){
  properties.clear();
  describes.clear();
  getFrom.clear();
  registerProperty(EntityAge.class,dEntity.class);
  registerProperty(EntityColor.class,dEntity.class);
  registerProperty(EntityFramed.class,dEntity.class);
  registerProperty(EntityInfected.class,dEntity.class);
  registerProperty(EntityPowered.class,dEntity.class);
  registerProperty(EntityProfession.class,dEntity.class);
  registerProperty(InventoryContents.class,dInventory.class);
  registerProperty(InventoryHolder.class,dInventory.class);
  registerProperty(InventorySize.class,dInventory.class);
  registerProperty(InventoryTitle.class,dInventory.class);
  registerProperty(ItemBook.class,dItem.class);
  registerProperty(ItemDisplayname.class,dItem.class);
  registerProperty(ItemDurability.class,dItem.class);
  registerProperty(ItemEnchantments.class,dItem.class);
  registerProperty(ItemLore.class,dItem.class);
  registerProperty(ItemPlantgrowth.class,dItem.class);
  registerProperty(ItemQuantity.class,dItem.class);
  registerProperty(ItemSkullskin.class,dItem.class);
}
Program: 10312
Project: 10312
Buggy source:
private String getPowered(){
  if (powered == null)   return null;
  return String.valueOf(((Creeper)(powered.getBukkitEntity())).isPowered());
}

Fixed version (ground truth):
private Boolean getPowered(){
  if (powered == null)   return null;
  return ((Creeper)(powered.getBukkitEntity())).isPowered();
}
Program: 10313
Project: 10313
Buggy source:
@Override public void adjust(Mechanism mechanism){
  if (mechanism.matches("String_Node_Str")) {
    ((Creeper)(powered.getBukkitEntity())).setPowered(mechanism.getValue().asBoolean());
  }
}

Fixed version (ground truth):
@Override public void adjust(Mechanism mechanism){
  if (mechanism.matches("String_Node_Str")) {
    setPowered(mechanism.getValue().asBoolean());
  }
}
Program: 10314
Project: 10314
Buggy source:
@Override public String getPropertyString(){
  return getPowered();
}

Fixed version (ground truth):
@Override public String getPropertyString(){
  if (!getPowered())   return null;
 else   return "String_Node_Str";
}
Program: 10315
Project: 10315
Buggy source:
private Boolean getPowered(){
  if (powered == null)   return null;
  return ((Creeper)(powered.getBukkitEntity())).isPowered();
}

Fixed version (ground truth):
private boolean getPowered(){
  return ((Creeper)(powered.getBukkitEntity())).isPowered();
}
Program: 10316
Project: 10316
Buggy source:
@Override public void adjust(Mechanism mechanism){
  if (mechanism.matches("String_Node_Str")) {
    setPowered(mechanism.getValue().asBoolean());
  }
}

Fixed version (ground truth):
@Override public void adjust(Mechanism mechanism){
  if (mechanism.matches("String_Node_Str") && mechanism.requireBoolean()) {
    setPowered(mechanism.getValue().asBoolean());
  }
}
Program: 10318
Project: 10318
Buggy source:
@EventHandler public void queueTags(ReplaceableTagEvent event){
  if (!event.matches("String_Node_Str"))   return;
  Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry()).fulfill(1);
  if (event.hasNameContext()) {
    if (ScriptQueue._queueExists(event.getNameContext()))     event.setReplaced(Element.NULL.getAttribute(attribute.fulfill(1)));
 else     event.setReplaced(ScriptQueue._getExistingQueue(event.getNameContext()).getAttribute(attribute.fulfill(1)));
    return;
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1))   event.setReplaced(new Element(ScriptQueue._queueExists(attribute.getContext(1))).getAttribute(attribute.fulfill(1)));
  if (attribute.startsWith("String_Node_Str"))   event.setReplaced(new Element(ScriptQueue._getStats()).getAttribute(attribute.fulfill(1)));
  event.setReplaced(event.getScriptEntry().getResidingQueue().getAttribute(attribute.fulfill(1)));
}

Fixed version (ground truth):
@EventHandler public void queueTags(ReplaceableTagEvent event){
  if (!event.matches("String_Node_Str"))   return;
  Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry()).fulfill(1);
  if (event.hasNameContext()) {
    if (ScriptQueue._queueExists(event.getNameContext()))     event.setReplaced(Element.NULL.getAttribute(attribute.fulfill(1)));
 else     event.setReplaced(ScriptQueue._getExistingQueue(event.getNameContext()).getAttribute(attribute.fulfill(1)));
    return;
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1))   event.setReplaced(new Element(ScriptQueue._queueExists(attribute.getContext(1))).getAttribute(attribute.fulfill(1)));
  if (attribute.startsWith("String_Node_Str"))   event.setReplaced(new Element(ScriptQueue._getStats()).getAttribute(attribute.fulfill(1)));
  event.setReplaced(event.getScriptEntry().getResidingQueue().getAttribute(attribute));
}
Program: 10322
Project: 10322
Buggy source:
public void start(){
  if (is_started)   return;
  is_started=true;
  boolean is_delayed=delay_time > System.currentTimeMillis();
  if (is_delayed) {
    Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(),new Runnable(){
      @Override public void run(){
        onStart();
      }
    }
,(delay_time - System.currentTimeMillis()) / 1000 * 20);
  }
 else   onStart();
  Class<? extends ScriptQueue> clazz=getClass();
  String name=classNameCache.get(clazz);
  if (name == null)   classNameCache.put(clazz,name=clazz.getSimpleName());
  if (is_delayed) {
    dB.echoDebug(this,"String_Node_Str" + name + "String_Node_Str"+ id+ "String_Node_Str"+ "String_Node_Str"+ new Duration((delay_time - System.currentTimeMillis()) / 1000 * 20).identify()+ "String_Node_Str");
  }
 else   dB.echoDebug(this,"String_Node_Str" + name + "String_Node_Str"+ id+ "String_Node_Str");
}

Fixed version (ground truth):
public void start(){
  if (is_started)   return;
  is_started=true;
  boolean is_delayed=delay_time > System.currentTimeMillis();
  Class<? extends ScriptQueue> clazz=getClass();
  String name=classNameCache.get(clazz);
  if (name == null)   classNameCache.put(clazz,name=clazz.getSimpleName());
  if (is_delayed) {
    dB.echoDebug(this,"String_Node_Str" + name + "String_Node_Str"+ id+ "String_Node_Str"+ "String_Node_Str"+ new Duration((delay_time - System.currentTimeMillis()) / 1000 * 20).identify()+ "String_Node_Str");
  }
 else   dB.echoDebug(this,"String_Node_Str" + name + "String_Node_Str"+ id+ "String_Node_Str");
  if (is_delayed) {
    Bukkit.getScheduler().scheduleSyncDelayedTask(DenizenAPI.getCurrentInstance(),new Runnable(){
      @Override public void run(){
        onStart();
      }
    }
,(delay_time - System.currentTimeMillis()) / 1000 * 20);
  }
 else   onStart();
}
Program: 10324
Project: 10324
Buggy source:
public boolean matchesMaterialData(MaterialData data){
  if (hasData())   return (material == data.getItemType() && data.getData() == data.getData());
 else   return material == data.getItemType();
}

Fixed version (ground truth):
public boolean matchesMaterialData(MaterialData data){
  if (hasData())   return (material == data.getItemType() && this.data == data.getData());
 else   return material == data.getItemType();
}
Program: 10325
Project: 10325
Buggy source:
public String getContext(int attribute){
  if (hasContext(attribute)) {
    dB.log(getAttribute(attribute));
    String text=getAttribute(attribute);
    Matcher contextMatcher=Pattern.compile("String_Node_Str").matcher(text);
    if (contextMatcher.find()) {
      return text.substring(contextMatcher.start() + 1,contextMatcher.end() - 1);
    }
  }
  return null;
}

Fixed version (ground truth):
public String getContext(int attribute){
  if (hasContext(attribute)) {
    String text=getAttribute(attribute);
    Matcher contextMatcher=Pattern.compile("String_Node_Str").matcher(text);
    if (contextMatcher.find()) {
      return text.substring(contextMatcher.start() + 1,contextMatcher.end() - 1);
    }
  }
  return null;
}
Program: 10327
Project: 10327
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dLocation location=(dLocation)scriptEntry.getObject("String_Node_Str");
  Effect effect=(Effect)scriptEntry.getObject("String_Node_Str");
  ParticleEffect particleEffect=(ParticleEffect)scriptEntry.getObject("String_Node_Str");
  int iconcrack=scriptEntry.getElement("String_Node_Str").asInt();
  double visibility=scriptEntry.getElement("String_Node_Str").asDouble();
  float data=scriptEntry.getElement("String_Node_Str").asFloat();
  int qty=scriptEntry.getElement("String_Node_Str").asInt();
  float offset=scriptEntry.getElement("String_Node_Str").asFloat();
  location.add(0,1,0);
  dB.report(scriptEntry,getName(),(effect != null ? aH.debugObj("String_Node_Str",effect.name()) : particleEffect != null ? aH.debugObj("String_Node_Str",particleEffect.name()) : aH.debugObj("String_Node_Str",iconcrack)) + aH.debugObj("String_Node_Str",location.toString()) + aH.debugObj("String_Node_Str",visibility)+ aH.debugObj("String_Node_Str",data)+ aH.debugObj("String_Node_Str",qty)+ (effect != null ? "String_Node_Str" : aH.debugObj("String_Node_Str",offset)));
  if (effect != null) {
    for (int n=0; n < qty; n++) {
      location.getWorld().playEffect(location,effect,(int)data,(int)visibility);
    }
  }
 else   if (particleEffect != null) {
    particleEffect.display(location,visibility,offset,offset,offset,data,qty);
  }
 else {
    ParticleEffect.displayIconCrack(location,visibility,iconcrack,offset,offset,offset,data,qty);
  }
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dLocation location=(dLocation)scriptEntry.getObject("String_Node_Str");
  Effect effect=(Effect)scriptEntry.getObject("String_Node_Str");
  ParticleEffect particleEffect=(ParticleEffect)scriptEntry.getObject("String_Node_Str");
  Element iconcrack=scriptEntry.getElement("String_Node_Str");
  Element radius=scriptEntry.getElement("String_Node_Str");
  Element data=scriptEntry.getElement("String_Node_Str");
  Element qty=scriptEntry.getElement("String_Node_Str");
  Element offset=scriptEntry.getElement("String_Node_Str");
  location.add(0,1,0);
  dB.report(scriptEntry,getName(),(effect != null ? aH.debugObj("String_Node_Str",effect.name()) : particleEffect != null ? aH.debugObj("String_Node_Str",particleEffect.name()) : iconcrack.debug()) + location.debug() + radius.debug()+ data.debug()+ qty.debug()+ (effect != null ? "String_Node_Str" : offset.debug()));
  if (effect != null) {
    for (int n=0; n < qty.asInt(); n++) {
      location.getWorld().playEffect(location,effect,data.asInt(),radius.asInt());
    }
  }
 else   if (particleEffect != null) {
    float os=offset.asFloat();
    particleEffect.display(location,radius.asDouble(),os,os,os,data.asFloat(),qty.asInt());
  }
 else {
    float os=offset.asFloat();
    ParticleEffect.displayIconCrack(location,radius.asDouble(),iconcrack.asInt(),os,os,os,data.asFloat(),qty.asInt());
  }
}
Program: 10330
Project: 10330
Buggy source:
@Override public void execute(final ScriptEntry scriptEntry) throws CommandExecutionException {
  Element name=(Element)scriptEntry.getObject("String_Node_Str");
  dB.report(scriptEntry,getName(),name.debug());
  NPC npc=scriptEntry.getNPC().getCitizen();
  Location prev=npc.isSpawned() ? npc.getEntity().getLocation() : null;
  npc.despawn(DespawnReason.PENDING_RESPAWN);
  npc.setName(name.asString());
  if (prev != null)   npc.spawn(prev);
}

Fixed version (ground truth):
@Override public void execute(final ScriptEntry scriptEntry) throws CommandExecutionException {
  Element name=(Element)scriptEntry.getObject("String_Node_Str");
  dB.report(scriptEntry,getName(),name.debug());
  NPC npc=scriptEntry.getNPC().getCitizen();
  Location prev=npc.isSpawned() ? npc.getEntity().getLocation() : null;
  npc.despawn(DespawnReason.PENDING_RESPAWN);
  npc.setName(name.asString().length() > 16 ? name.asString().substring(0,16) : name.asString());
  if (prev != null)   npc.spawn(prev);
}
Program: 10332
Project: 10332
Buggy source:
@EventHandler public void inventoryCloseEvent(InventoryCloseEvent event){
  Map<String,dObject> context=new HashMap<String,dObject>();
  Player player=(Player)event.getPlayer();
  String type=event.getInventory().getType().name();
  context.put("String_Node_Str",dInventory.mirrorBukkitInventory(event.getInventory()));
  if (event.getInventory().getHolder() instanceof Player) {
    PlayerInventory inv=(PlayerInventory)event.getInventory();
    ItemStack[] armor_contents=inv.getArmorContents();
    for (int s=0; s < 4; s++) {
      if (armor_contents[0].getType() != Material.AIR)       playerEquipsArmorEvent((Player)inv.getHolder(),armor_contents[s],inv.firstEmpty());
    }
  }
  EventManager.doEvents(Arrays.asList("String_Node_Str","String_Node_Str" + type),null,player,context);
}

Fixed version (ground truth):
@EventHandler public void inventoryCloseEvent(InventoryCloseEvent event){
  Map<String,dObject> context=new HashMap<String,dObject>();
  Player player=(Player)event.getPlayer();
  String type=event.getInventory().getType().name();
  context.put("String_Node_Str",dInventory.mirrorBukkitInventory(event.getInventory()));
  if (event.getInventory().getHolder() instanceof Player) {
    PlayerInventory inv=(PlayerInventory)event.getInventory().getHolder().getInventory();
    ItemStack[] armor_contents=inv.getArmorContents();
    for (int s=0; s < 4; s++) {
      if (armor_contents[0].getType() != Material.AIR)       playerEquipsArmorEvent((Player)inv.getHolder(),armor_contents[s],inv.firstEmpty());
    }
  }
  EventManager.doEvents(Arrays.asList("String_Node_Str","String_Node_Str" + type),null,player,context);
}
Program: 10334
Project: 10334
Buggy source:
@Override public void onBuild(List<aH.Argument> args){
  for (  aH.Argument arg : args) {
    if (type == null && arg.matchesEnum(TravelType.values()))     type=TravelType.valueOf(arg.getValue().toUpperCase());
 else     if (arg.matchesArgumentType(dCuboid.class))     end_cuboid=arg.asType(dCuboid.class);
 else     if (arg.matchesArgumentType(dLocation.class))     end_point=arg.asType(dLocation.class);
 else     if (arg.matchesArgumentType(dNPC.class))     target=arg.asType(dNPC.class);
 else     if (arg.matchesPrefix("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     distance_required=aH.getIntegerFrom(arg.getValue());
 else     if (arg.matchesPrefix("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     radius=aH.getIntegerFrom(arg.getValue());
  }
  if (type == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
}

Fixed version (ground truth):
@Override public void onBuild(List<aH.Argument> args){
  for (  aH.Argument arg : args) {
    if (type == null && arg.matchesEnum(TravelType.values()))     type=TravelType.valueOf(arg.getValue().toUpperCase());
 else     if (arg.matchesPrefix("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     distance_required=aH.getIntegerFrom(arg.getValue());
 else     if (arg.matchesPrefix("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     radius=aH.getIntegerFrom(arg.getValue());
 else     if (arg.matchesArgumentType(dCuboid.class))     end_cuboid=arg.asType(dCuboid.class);
 else     if (arg.matchesArgumentType(dLocation.class))     end_point=arg.asType(dLocation.class);
 else     if (arg.matchesArgumentType(dNPC.class))     target=arg.asType(dNPC.class);
  }
  if (type == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
  if (type == TravelType.DISTANCE && distance_required == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
  if (type == TravelType.TOCUBOID && end_cuboid == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
  if (type == TravelType.TOLOCATION && end_point == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
  if (type == TravelType.TONPC && target == null) {
    dB.echoError("String_Node_Str");
    cancel();
  }
}
Program: 10335
Project: 10335
Buggy source:
public static boolean matches(String string){
  string=string.toUpperCase().replace("String_Node_Str","String_Node_Str");
  NPC npc;
  if (aH.matchesInteger(string)) {
    npc=CitizensAPI.getNPCRegistry().getById(aH.getIntegerFrom(string));
    if (npc != null)     return true;
  }
 else {
    for (    NPC test : CitizensAPI.getNPCRegistry()) {
      if (test.getName().equalsIgnoreCase(string)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean matches(String string){
  if (string.toLowerCase().startsWith("String_Node_Str"))   return true;
  string=string.toUpperCase().replace("String_Node_Str","String_Node_Str");
  NPC npc;
  if (aH.matchesInteger(string)) {
    npc=CitizensAPI.getNPCRegistry().getById(aH.getIntegerFrom(string));
    if (npc != null)     return true;
  }
 else {
    for (    NPC test : CitizensAPI.getNPCRegistry()) {
      if (test.getName().equalsIgnoreCase(string)) {
        return true;
      }
    }
  }
  return false;
}
Program: 10336
Project: 10336
Buggy source:
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  for (  aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
    if (!scriptEntry.hasObject("String_Node_Str") && arg.matches("String_Node_Str")) {
      if (!scriptEntry.hasPlayer())       throw new InvalidArgumentsException("String_Node_Str");
      scriptEntry.addObject("String_Node_Str",Arrays.asList(scriptEntry.getPlayer()));
    }
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     scriptEntry.addObject("String_Node_Str",arg.asElement());
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesArgumentList(dEntity.class))     scriptEntry.addObject("String_Node_Str",arg.asType(dList.class).filter(dEntity.class,scriptEntry));
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesPrefix("String_Node_Str"))     scriptEntry.addObject("String_Node_Str",arg.asElement());
 else     arg.reportUnhandled();
  }
  if (!scriptEntry.hasObject("String_Node_Str") && !scriptEntry.hasObject("String_Node_Str"))   throw new InvalidArgumentsException("String_Node_Str");
  if (!scriptEntry.hasObject("String_Node_Str")) {
    if (!scriptEntry.hasNPC())     throw new InvalidArgumentsException("String_Node_Str");
    scriptEntry.addObject("String_Node_Str",Arrays.asList(scriptEntry.getNPC()));
  }
}

Fixed version (ground truth):
@Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
  for (  aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
    if (!scriptEntry.hasObject("String_Node_Str") && arg.matches("String_Node_Str")) {
      if (!scriptEntry.hasPlayer())       throw new InvalidArgumentsException("String_Node_Str");
      scriptEntry.addObject("String_Node_Str",Arrays.asList(scriptEntry.getPlayer().getDenizenEntity()));
    }
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesPrimitive(aH.PrimitiveType.Integer))     scriptEntry.addObject("String_Node_Str",arg.asElement());
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesArgumentList(dEntity.class))     scriptEntry.addObject("String_Node_Str",arg.asType(dList.class).filter(dEntity.class,scriptEntry));
 else     if (!scriptEntry.hasObject("String_Node_Str") && arg.matchesPrefix("String_Node_Str"))     scriptEntry.addObject("String_Node_Str",arg.asElement());
 else     arg.reportUnhandled();
  }
  if (!scriptEntry.hasObject("String_Node_Str") && !scriptEntry.hasObject("String_Node_Str"))   throw new InvalidArgumentsException("String_Node_Str");
  if (!scriptEntry.hasObject("String_Node_Str")) {
    if (!scriptEntry.hasNPC())     throw new InvalidArgumentsException("String_Node_Str");
    scriptEntry.addObject("String_Node_Str",Arrays.asList(scriptEntry.getNPC().getDenizenEntity()));
  }
}
Program: 10337
Project: 10337
Buggy source:
public static List<String> trimEvents(List<String> event){
  List<String> parsed=new ArrayList<String>();
  if (dB.showEventsTrimming)   dB.echoApproval("String_Node_Str" + event.toString() + '\'');
  for (int i=0; i < event.size(); i++) {
    for (int x=0; x < event.size(); x++) {
      if (i != x && event.get(i).equalsIgnoreCase(event.get(x))) {
        event.remove(i);
        i--;
        break;
      }
    }
  }
  for (  String e : event)   if (events.containsKey("String_Node_Str" + e.toUpperCase()))   parsed.add(e);
  return parsed;
}

Fixed version (ground truth):
public static List<String> trimEvents(List<String> original){
  List<String> event=new ArrayList<String>();
  event.addAll(original);
  List<String> parsed=new ArrayList<String>();
  if (dB.showEventsTrimming)   dB.echoApproval("String_Node_Str" + event.toString() + '\'');
  for (int i=0; i < event.size(); i++) {
    for (int x=0; x < event.size(); x++) {
      if (i != x && event.get(i).equalsIgnoreCase(event.get(x))) {
        event.remove(i);
        i--;
        break;
      }
    }
  }
  for (  String e : event)   if (events.containsKey("String_Node_Str" + e.toUpperCase()))   parsed.add(e);
  return parsed;
}
Program: 10339
Project: 10339
Buggy source:
public List<dObject> filter(Class<? extends dObject> dClass,ScriptEntry entry){
  List<dObject> results=new ArrayList<dObject>();
  for (  String element : this) {
    try {
      if (ObjectFetcher.checkMatch(dClass,element)) {
        dObject object=ObjectFetcher.getObjectFrom(dClass,element,entry.getPlayer(),entry.getNPC());
        if (object != null) {
          results.add(object);
        }
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
    }
  }
  if (results.size() > 0)   return results;
 else   return null;
}

Fixed version (ground truth):
public List<dObject> filter(Class<? extends dObject> dClass,ScriptEntry entry){
  List<dObject> results=new ArrayList<dObject>();
  for (  String element : this) {
    try {
      if (ObjectFetcher.checkMatch(dClass,element)) {
        dObject object=ObjectFetcher.getObjectFrom(dClass,element,(entry != null ? entry.getPlayer() : null),(entry != null ? entry.getNPC() : null));
        if (object != null) {
          results.add(object);
        }
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
    }
  }
  if (results.size() > 0)   return results;
 else   return null;
}
Program: 10340
Project: 10340
Buggy source:
public static String CleanOutput(String input){
  return input.replace((char)0x01,'<').replace((char)0x02,'>').replace(dList.internal_escape_char,'|');
}

Fixed version (ground truth):
/** 
 * Cleans escaped symbols generated within Tag Manager so that they can be parsed now.
 * @param input the potentially escaped input string.
 * @return the cleaned output string.
 */
public static String CleanOutput(String input){
  return input.replace((char)0x01,'<').replace((char)0x02,'>').replace(dList.internal_escape_char,'|');
}
Program: 10341
Project: 10341
Buggy source:
public static String CleanOutputFully(String input){
  return input.replace((char)0x01,'<').replace((char)0x02,'>').replace((char)0x2011,';').replace(dList.internal_escape_char,'|');
}

Fixed version (ground truth):
/** 
 * Cleans any potential internal escape characters (secret characters used to hold the place of symbols that might get parsed weirdly like > or | ) back into their proper form. Use this function when outputting information that is going to be read by a person.
 * @param input the potentially escaped input string.
 * @return the cleaned output string.
 */
public static String CleanOutputFully(String input){
  return input.replace((char)0x01,'<').replace((char)0x02,'>').replace((char)0x2011,';').replace(dList.internal_escape_char,'|');
}
Program: 10342
Project: 10342
Buggy source:
public dLocation(World world,double x,double y,double z,float yaw,float pitch){
  super(world,x,y,z,pitch,yaw);
}

Fixed version (ground truth):
public dLocation(World world,double x,double y,double z,float yaw,float pitch){
  super(world,x,y,z,yaw,pitch);
}
Program: 10343
Project: 10343
Buggy source:
public dLocation(World world,double x,double y,double z,float yaw,float pitch){
  super(world,x,y,z,yaw,pitch);
}

Fixed version (ground truth):
public dLocation(World world,double x,double y,double z,float yaw,float pitch){
  super(world,x,y,z,pitch,yaw);
}
Program: 10344
Project: 10344
Buggy source:
@EventHandler public void fetchObject(ReplaceableTagEvent event){
  if (!event.getName().contains("String_Node_Str"))   return;
  String object_type=event.getName().split("String_Node_Str")[0].toLowerCase();
  Class object_class=ObjectFetcher.getObjectClass(object_type);
  if (object_class == null) {
    dB.echoError("String_Node_Str" + object_type + "String_Node_Str");
    event.setReplaced("String_Node_Str");
    return;
  }
  dObject arg;
  try {
    if (!ObjectFetcher.checkMatch(object_class,event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName())) {
      dB.echoDebug(event.getScriptEntry(),"String_Node_Str" + event.getName() + "String_Node_Str"+ object_class.getSimpleName()+ "String_Node_Str");
      event.setReplaced("String_Node_Str");
      return;
    }
    arg=ObjectFetcher.getObjectFrom(object_class,event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName());
    if (arg == null) {
      dB.echoError((event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName() + "String_Node_Str"));
      return;
    }
    Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry());
    event.setReplaced(arg.getAttribute(attribute.fulfill(1)));
  }
 catch (  Exception e) {
    dB.echoError("String_Node_Str");
    dB.echoError(e);
  }
}

Fixed version (ground truth):
@EventHandler public void fetchObject(ReplaceableTagEvent event){
  if (!event.getName().contains("String_Node_Str"))   return;
  String object_type=event.getName().split("String_Node_Str")[0].toLowerCase();
  Class object_class=ObjectFetcher.getObjectClass(object_type);
  if (object_class == null) {
    dB.echoError("String_Node_Str" + object_type + "String_Node_Str");
    event.setReplaced("String_Node_Str");
    return;
  }
  dObject arg;
  try {
    if (!ObjectFetcher.checkMatch(object_class,event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName())) {
      dB.echoDebug(event.getScriptEntry(),"String_Node_Str" + event.getName() + "String_Node_Str"+ object_class.getSimpleName()+ "String_Node_Str");
      event.setReplaced("String_Node_Str");
      return;
    }
    arg=ObjectFetcher.getObjectFrom(object_class,event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName());
    if (arg == null) {
      dB.echoError(((event.hasNameContext() ? event.getName() + '[' + event.getNameContext()+ ']' : event.getName()) + "String_Node_Str"));
      return;
    }
    Attribute attribute=new Attribute(event.raw_tag,event.getScriptEntry());
    event.setReplaced(arg.getAttribute(attribute.fulfill(1)));
  }
 catch (  Exception e) {
    dB.echoError("String_Node_Str");
    dB.echoError(e);
  }
}
Program: 10348
Project: 10348
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Boolean player=(Boolean)scriptEntry.getObject("String_Node_Str");
  ChatColor color=(ChatColor)scriptEntry.getObject("String_Node_Str");
  String text=(String)scriptEntry.getObject("String_Node_Str");
  if (text != null) {
    if (text.equalsIgnoreCase("String_Node_Str")) {
      scriptEntry.getNPC().getEntity().setCustomNameVisible(false);
      dB.echoDebug(scriptEntry,"String_Node_Str");
    }
 else {
      scriptEntry.getNPC().getEntity().setCustomNameVisible(true);
      scriptEntry.getNPC().getEntity().setCustomName(text);
      dB.echoDebug(scriptEntry,text);
    }
    if (scriptEntry.getNPC().getEntity() instanceof Player)     ((Player)scriptEntry.getNPC().getEntity()).setDisplayName(text);
  }
  if (color != null) {
    if (!scriptEntry.getNPC().getCitizen().hasTrait(NameplateTrait.class))     scriptEntry.getNPC().getCitizen().addTrait(NameplateTrait.class);
    NameplateTrait trait=scriptEntry.getNPC().getCitizen().getTrait(NameplateTrait.class);
    if (player)     trait.setColor(color,scriptEntry.getPlayer().getName());
 else     trait.setColor(color);
  }
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Boolean player=(Boolean)scriptEntry.getObject("String_Node_Str");
  ChatColor color=(ChatColor)scriptEntry.getObject("String_Node_Str");
  String text=(String)scriptEntry.getObject("String_Node_Str");
  if (text != null) {
    if (text.equalsIgnoreCase("String_Node_Str")) {
      scriptEntry.getNPC().getLivingEntity().setCustomNameVisible(false);
      dB.echoDebug(scriptEntry,"String_Node_Str");
    }
 else {
      scriptEntry.getNPC().getLivingEntity().setCustomNameVisible(true);
      scriptEntry.getNPC().getLivingEntity().setCustomName(text);
      dB.echoDebug(scriptEntry,text);
    }
    if (scriptEntry.getNPC().getEntity() instanceof Player)     ((Player)scriptEntry.getNPC().getEntity()).setDisplayName(text);
  }
  if (color != null) {
    if (!scriptEntry.getNPC().getCitizen().hasTrait(NameplateTrait.class))     scriptEntry.getNPC().getCitizen().addTrait(NameplateTrait.class);
    NameplateTrait trait=scriptEntry.getNPC().getCitizen().getTrait(NameplateTrait.class);
    if (player)     trait.setColor(color,scriptEntry.getPlayer().getName());
 else     trait.setColor(color);
  }
}
Program: 10349
Project: 10349
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dList talkers=(dList)scriptEntry.getdObject("String_Node_Str");
  dObject targets=scriptEntry.getdObject("String_Node_Str");
  Element message=scriptEntry.getElement("String_Node_Str");
  dB.report(scriptEntry,getName(),talkers.debug() + targets.debug() + message.debug());
  SpeechContext context=new SpeechContext(message.asString());
  if (targets != Element.FALSE) {
    if (targets instanceof dPlayer) {
      dPlayer player=(dPlayer)targets;
      if (player.isOnline())       context.addRecipient(player.getPlayerEntity());
    }
 else {
      dList target_list=(dList)targets;
      for (      dObject obj : target_list.filter(dEntity.class)) {
        dEntity ent=(dEntity)obj;
        if (ent.isLivingEntity())         context.addRecipient(ent.getLivingEntity());
      }
    }
  }
  for (  String talker : talkers) {
    if (dNPC.matches(talker)) {
      dNPC npc=dNPC.valueOf(talker);
      context.setTalker(npc.getEntity());
      npc.getCitizen().getDefaultSpeechController().speak(context,"String_Node_Str");
    }
 else     if (dPlayer.matches(talker)) {
    }
  }
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  dList talkers=(dList)scriptEntry.getdObject("String_Node_Str");
  dObject targets=scriptEntry.getdObject("String_Node_Str");
  Element message=scriptEntry.getElement("String_Node_Str");
  dB.report(scriptEntry,getName(),talkers.debug() + targets.debug() + message.debug());
  SpeechContext context=new SpeechContext(message.asString());
  if (!targets.equals(Element.FALSE)) {
    if (targets instanceof dPlayer) {
      dPlayer player=(dPlayer)targets;
      if (player.isOnline())       context.addRecipient(player.getPlayerEntity());
    }
 else {
      dList target_list=(dList)targets;
      for (      dObject obj : target_list.filter(dEntity.class)) {
        dEntity ent=(dEntity)obj;
        if (ent.isLivingEntity())         context.addRecipient(ent.getLivingEntity());
      }
    }
  }
  for (  String talker : talkers) {
    if (dNPC.matches(talker)) {
      dNPC npc=dNPC.valueOf(talker);
      context.setTalker(npc.getEntity());
      npc.getCitizen().getDefaultSpeechController().speak(context,"String_Node_Str");
    }
 else     if (dPlayer.matches(talker)) {
    }
  }
}
Program: 10350
Project: 10350
Buggy source:
public void revolve(ScriptQueue scriptQueue){
  if (scriptQueue.getLastEntryExecuted() != null && scriptQueue.getLastEntryExecuted().shouldWaitFor())   if (!scriptQueue.getLastEntryExecuted().isDone())   return;
  ScriptEntry scriptEntry=scriptQueue.getNext();
  while (scriptEntry != null) {
    scriptEntry.setSendingQueue(scriptQueue);
    try {
      getScriptExecuter().execute(scriptEntry);
    }
 catch (    Throwable e) {
      dB.echoError("String_Node_Str");
      if (!dB.showStackTraces)       dB.echoError("String_Node_Str");
 else       e.printStackTrace();
    }
    scriptQueue.setLastEntryExecuted(scriptEntry);
    if (scriptQueue instanceof Delayable) {
      if (((Delayable)scriptQueue).isDelayed())       break;
    }
    if (scriptEntry.isInstant()) {
      scriptEntry=scriptQueue.getNext();
    }
 else     break;
  }
}

Fixed version (ground truth):
public void revolve(ScriptQueue scriptQueue){
  if (scriptQueue.getLastEntryExecuted() != null && scriptQueue.getLastEntryExecuted().shouldWaitFor())   return;
  ScriptEntry scriptEntry=scriptQueue.getNext();
  while (scriptEntry != null) {
    scriptEntry.setSendingQueue(scriptQueue);
    try {
      getScriptExecuter().execute(scriptEntry);
    }
 catch (    Throwable e) {
      dB.echoError("String_Node_Str");
      if (!dB.showStackTraces)       dB.echoError("String_Node_Str");
 else       e.printStackTrace();
    }
    scriptQueue.setLastEntryExecuted(scriptEntry);
    if (scriptQueue instanceof Delayable) {
      if (((Delayable)scriptQueue).isDelayed())       break;
    }
    if (scriptEntry.isInstant()) {
      scriptEntry=scriptQueue.getNext();
    }
 else     break;
  }
}
Program: 10351
Project: 10351
Buggy source:
public boolean startsWith(String string,int attribute){
  string=string.toLowerCase();
  if (attributes.isEmpty())   return false;
  if (attributes.size() < attribute)   return false;
  return raw_tag.split("String_Node_Str",attribute)[attribute - 1].toLowerCase().startsWith(string);
}

Fixed version (ground truth):
public boolean startsWith(String string,int attribute){
  if (attributes.isEmpty())   return false;
  if (attributes.size() < attribute)   return false;
  return getAttribute(attribute).startsWith(string);
}
Program: 10352
Project: 10352
Buggy source:
/** 
 * Checks if c is in between a and b.
 * @param a
 * @param b
 * @param c
 * @return  true if c is in between.
 */
public static boolean isBetween(double a,double b,double c){
  return b > a ? c > a && c < b : c > b && c < a;
}

Fixed version (ground truth):
/** 
 * Checks if c is in between a and b, or equal to a or b.
 * @param a first number
 * @param b second number
 * @param c number to check if between
 * @return  true if c is in between.
 */
public static boolean isBetween(double a,double b,double c){
  return a == c || b == c || (b > a ? c > a && c < b : c > b && c < a);
}