nus-yam/ex-repair huggingface dataset:
Program: 20632
Project: 20632
Buggy source:
private void scheduleWeeknightTask(){
  Calendar firstTime=Calendar.getInstance();
  Calendar now=Calendar.getInstance();
  firstTime.set(Calendar.HOUR_OF_DAY,23);
  firstTime.set(Calendar.MINUTE,0);
  firstTime.set(Calendar.SECOND,0);
  if (firstTime.before(now)) {
    firstTime.roll(Calendar.DATE,true);
  }
  long period=ONE_DAY;
  timer.scheduleAtFixedRate(new WeeknightTask(sarariman,directory,emailDispatcher),firstTime.getTime(),period);
}

Fixed version (ground truth):
private void scheduleWeeknightTask(){
  Calendar firstTime=Calendar.getInstance();
  Calendar now=Calendar.getInstance();
  firstTime.set(Calendar.HOUR_OF_DAY,23);
  firstTime.set(Calendar.MINUTE,0);
  firstTime.set(Calendar.SECOND,0);
  if (firstTime.before(now)) {
    firstTime.add(Calendar.DATE,1);
  }
  long period=ONE_DAY;
  timer.scheduleAtFixedRate(new WeeknightTask(sarariman,directory,emailDispatcher),firstTime.getTime(),period);
}
Program: 20633
Project: 20633
Buggy source:
public void run(){
  Calendar today=Calendar.getInstance();
  int dayOfWeek=today.get(Calendar.DAY_OF_WEEK);
  if (dayOfWeek == Calendar.SATURDAY && dayOfWeek == Calendar.SUNDAY) {
    return;
  }
  java.util.Date todayDate=today.getTime();
  Date week=new Date(DateUtils.weekStart(todayDate).getTime());
  for (  Employee employee : directory.getByUserName().values()) {
    Timesheet timesheet=new Timesheet(sarariman,employee.getNumber(),week);
    try {
      if (!timesheet.isSubmitted()) {
        if (dayOfWeek == Calendar.FRIDAY) {
          emailDispatcher.send(employee.getEmail(),EmailDispatcher.addresses(sarariman.getApprovers()),"String_Node_Str","String_Node_Str" + week + "String_Node_Str");
        }
 else {
          double hoursRecorded=timesheet.getHours(new Date(todayDate.getTime()));
          if (hoursRecorded == 0.0 && employee.isFulltime()) {
            emailDispatcher.send(employee.getEmail(),EmailDispatcher.addresses(sarariman.getApprovers()),"String_Node_Str","String_Node_Str");
          }
        }
      }
    }
 catch (    SQLException se) {
      logger.log(Level.SEVERE,"String_Node_Str" + today,se);
    }
  }
}

Fixed version (ground truth):
public void run(){
  Calendar today=Calendar.getInstance();
  int dayOfWeek=today.get(Calendar.DAY_OF_WEEK);
  if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
    return;
  }
  java.util.Date todayDate=today.getTime();
  Date week=new Date(DateUtils.weekStart(todayDate).getTime());
  for (  Employee employee : directory.getByUserName().values()) {
    Timesheet timesheet=new Timesheet(sarariman,employee.getNumber(),week);
    try {
      if (!timesheet.isSubmitted()) {
        if (dayOfWeek == Calendar.FRIDAY) {
          emailDispatcher.send(employee.getEmail(),EmailDispatcher.addresses(sarariman.getApprovers()),"String_Node_Str","String_Node_Str" + week + "String_Node_Str");
        }
 else {
          double hoursRecorded=timesheet.getHours(new Date(todayDate.getTime()));
          if (hoursRecorded == 0.0 && employee.isFulltime()) {
            emailDispatcher.send(employee.getEmail(),EmailDispatcher.addresses(sarariman.getApprovers()),"String_Node_Str","String_Node_Str");
          }
        }
      }
    }
 catch (    SQLException se) {
      logger.log(Level.SEVERE,"String_Node_Str" + today,se);
    }
  }
}
Program: 20635
Project: 20635
Buggy source:
/** 
 * @param compare the comparison LoadRuleDateMap
 * @return true if this LoadRuleDateMap has a date before compare date, for a specific load rule  
 */
public boolean isBefore(LoadRuleDateMap compare){
  for (  Map.Entry<String,Date> entry : map.entrySet()) {
    Date compareDate=compare.getBuiltTime(entry.getKey());
    if (compareDate != null && entry.getValue().before(compareDate)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param compare the comparison LoadRuleDateMap
 * @return true if this LoadRuleDateMap has a date before compare date, for a specific load rule  
 */
public boolean isBefore(LoadRuleDateMap compare){
  for (  Map.Entry<String,Date> entry : map.entrySet()) {
    Date compareDate=compare.getBuiltTime(entry.getKey());
    if (entry.getValue() == null && compareDate != null) {
      return true;
    }
    if (compareDate != null && entry.getValue().before(compareDate)) {
      return true;
    }
  }
  return false;
}
Program: 20637
Project: 20637
Buggy source:
@Override public boolean checkout(AbstractBuild<?,?> build,Launcher launcher,FilePath workspace,BuildListener listener,File changelogFile) throws IOException, InterruptedException {
  DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT);
  ClearTool ct=new ClearTool(launcher,listener,workspace,viewname);
  LoadRuleDateMap changelogSetCommits=null;
  if (build.getPreviousBuild() != null && build.getPreviousBuild().getChangeSet().isEmptySet() == false) {
    SimpleClearCaseChangeLogSet previousChangeLogSet=(SimpleClearCaseChangeLogSet)build.getPreviousBuild().getChangeSet();
    changelogSetCommits=previousChangeLogSet.getLatestCommitDates(getLoadRulesAsList());
    DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT,changelogSetCommits);
  }
 else {
    DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT);
  }
  List<SimpleClearCaseChangeLogEntry> entries=ct.lshistory(getLoadRulesAsList(),changelogSetCommits);
  Collections.sort(entries,new SimpleClearCaseChangeLogEntryDateComparator(SimpleClearCaseSCM.CHANGELOGSET_ORDER));
  SimpleClearCaseChangeLogSet set=new SimpleClearCaseChangeLogSet(build,entries);
  return ((SimpleClearCaseChangeLogParser)createChangeLogParser()).writeChangeLog(changelogFile,set,listener);
}

Fixed version (ground truth):
@Override public boolean checkout(AbstractBuild<?,?> build,Launcher launcher,FilePath workspace,BuildListener listener,File changelogFile) throws IOException, InterruptedException {
  DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT);
  ClearTool ct=new ClearTool(launcher,listener,workspace,viewname);
  LoadRuleDateMap changelogSetCommits=null;
  if (build.getPreviousBuild() != null && build.getPreviousBuild().getChangeSet().isEmptySet() == false) {
    SimpleClearCaseChangeLogSet previousChangeLogSet=(SimpleClearCaseChangeLogSet)build.getPreviousBuild().getChangeSet();
    changelogSetCommits=previousChangeLogSet.getLatestCommitDates(getLoadRulesAsList());
    DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT,changelogSetCommits);
    build.addAction(new SimpleClearCaseSCMTagAction(build,changelogSetCommits));
    DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT,changelogSetCommits);
  }
 else {
    DebugHelper.info(listener,"String_Node_Str",LOG_CHECKOUT);
  }
  List<SimpleClearCaseChangeLogEntry> entries=ct.lshistory(getLoadRulesAsList(),changelogSetCommits);
  Collections.sort(entries,new SimpleClearCaseChangeLogEntryDateComparator(SimpleClearCaseSCM.CHANGELOGSET_ORDER));
  SimpleClearCaseChangeLogSet set=new SimpleClearCaseChangeLogSet(build,entries);
  return ((SimpleClearCaseChangeLogParser)createChangeLogParser()).writeChangeLog(changelogFile,set,listener);
}
Program: 20638
Project: 20638
Buggy source:
private static void addFilePathsToEntry(NodeList items,SimpleClearCaseChangeLogEntry entry){
  for (int i=0; i < items.getLength(); i++) {
    Element elemItem=(Element)items.item(i);
    entry.addPath(elemItem.getTextContent());
  }
}

Fixed version (ground truth):
private static void addFilePathsToEntry(NodeList items,SimpleClearCaseChangeLogEntry entry){
  for (int i=0; i < items.getLength(); i++) {
    Element elemItem=(Element)items.item(i);
    entry.addPath(elemItem.getTextContent().trim());
  }
}
Program: 20639
Project: 20639
Buggy source:
public static List<SimpleClearCaseChangeLogEntry> readChangeLog(File file) throws IOException, ParserConfigurationException, SAXException {
  List<SimpleClearCaseChangeLogEntry> ret=new ArrayList<SimpleClearCaseChangeLogEntry>();
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  DocumentBuilder builder=factory.newDocumentBuilder();
  Document doc=builder.parse(file);
  Element changelog=(Element)doc.getElementsByTagName(CHANGELOG).item(0);
  NodeList entries=changelog.getElementsByTagName(ENTRY);
  for (int i=0; i < entries.getLength(); i++) {
    Element elemEntry=(Element)entries.item(i);
    String date=elemEntry.getElementsByTagName(DATE).item(0).getTextContent();
    String user=elemEntry.getElementsByTagName(USER).item(0).getTextContent();
    String version=elemEntry.getElementsByTagName(VERSION).item(0).getTextContent();
    String operation=elemEntry.getElementsByTagName(OPERATION).item(0).getTextContent();
    String eventDescription=elemEntry.getElementsByTagName(EVENT_DESCRIPTION).item(0).getTextContent();
    String comment=elemEntry.getElementsByTagName(COMMENT).item(0).getTextContent();
    SimpleClearCaseChangeLogEntry entry=new SimpleClearCaseChangeLogEntry(DateUtil.parseDate(date),user,version,eventDescription,operation,comment);
    addFilePathsToEntry(elemEntry.getElementsByTagName(ITEMS),entry);
    ret.add(entry);
  }
  return ret;
}

Fixed version (ground truth):
public static List<SimpleClearCaseChangeLogEntry> readChangeLog(File file) throws IOException, ParserConfigurationException, SAXException {
  List<SimpleClearCaseChangeLogEntry> ret=new ArrayList<SimpleClearCaseChangeLogEntry>();
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  DocumentBuilder builder=factory.newDocumentBuilder();
  Document doc=builder.parse(file);
  Element changelog=(Element)doc.getElementsByTagName(CHANGELOG).item(0);
  NodeList entries=changelog.getElementsByTagName(ENTRY);
  for (int i=0; i < entries.getLength(); i++) {
    Element elemEntry=(Element)entries.item(i);
    String date=elemEntry.getElementsByTagName(DATE).item(0).getTextContent().trim();
    String user=elemEntry.getElementsByTagName(USER).item(0).getTextContent().trim();
    String version=elemEntry.getElementsByTagName(VERSION).item(0).getTextContent().trim();
    String operation=elemEntry.getElementsByTagName(OPERATION).item(0).getTextContent().trim();
    String eventDescription=elemEntry.getElementsByTagName(EVENT_DESCRIPTION).item(0).getTextContent().trim();
    String comment=elemEntry.getElementsByTagName(COMMENT).item(0).getTextContent().trim();
    SimpleClearCaseChangeLogEntry entry=new SimpleClearCaseChangeLogEntry(DateUtil.parseDate(date),user,version,eventDescription,operation,comment);
    addFilePathsToEntry(elemEntry.getElementsByTagName(ITEM),entry);
    ret.add(entry);
  }
  return ret;
}
Program: 20641
Project: 20641
Buggy source:
@Override public void run(){
  try {
    while (isAlive) {
      processRequest((Operation)inputStream.readObject());
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    IOUtils.closeSilently(this);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (isAlive) {
      processRequest((Operation)inputStream.readObject());
    }
  }
 catch (  SocketException se) {
    System.out.println("String_Node_Str");
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    IOUtils.closeSilently(this);
  }
}
Program: 20642
Project: 20642
Buggy source:
private void respondWith(String result){
  System.out.println("String_Node_Str" + result);
  try {
    outputStream.writeObject(result);
  }
 catch (  IOException e) {
    e.printStackTrace(System.err);
  }
}

Fixed version (ground truth):
private void respondWith(String result){
  System.out.println("String_Node_Str" + result);
  try {
    outputStream.writeObject(result);
    outputStream.flush();
  }
 catch (  IOException e) {
    e.printStackTrace(System.err);
  }
}
Program: 20643
Project: 20643
Buggy source:
private void processRequest(Operation operation){
  System.out.println("String_Node_Str" + operation);
  if (operation instanceof Add) {
    respondWith(delegate.add(operation.getLeftOperand(),operation.getLeftOperand()));
  }
 else   if (operation instanceof Subtract) {
    respondWith(delegate.subtract(operation.getLeftOperand(),operation.getLeftOperand()));
  }
 else   if (operation instanceof Compare) {
    respondWith(delegate.compare(operation.getLeftOperand(),operation.getLeftOperand()));
  }
 else {
    respondWith("String_Node_Str");
  }
}

Fixed version (ground truth):
private void processRequest(Operation operation){
  System.out.println("String_Node_Str" + operation);
  if (operation instanceof Add) {
    respondWith(delegate.add(operation.getLeftOperand(),operation.getRightOperand()));
  }
 else   if (operation instanceof Subtract) {
    respondWith(delegate.subtract(operation.getLeftOperand(),operation.getRightOperand()));
  }
 else   if (operation instanceof Compare) {
    respondWith(delegate.compare(operation.getLeftOperand(),operation.getRightOperand()));
  }
 else {
    respondWith("String_Node_Str");
  }
}
Program: 20644
Project: 20644
Buggy source:
@Test public void testToBinary() throws Exception {
  Packet packet=Packet.newRequest(peers,0,123,new Payload(){
    @Override public int getCommandId(){
      return 42;
    }
    @Override public byte[] toBinary(){
      return new byte[]{64,65,66,67};
    }
  }
);
  byte[] actual=packet.toBinary();
  byte[] expected=new byte[]{0,0,36,0,0,0,9,8,7,6,5,4,33,3,1,2,3,4,5,6,(byte)128,0,42,0,4,0,4,0,0,0,0,0,0,0,123,0,0,0,64,65,66,67};
  Assert.assertArrayEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testToBinary() throws Exception {
  Packet packet=Packet.newRequest(peers,0,123,new Payload(){
    @Override public int getCommandId(){
      return 42;
    }
    @Override public byte[] toBinary(){
      return new byte[]{64,65,66,67};
    }
  }
);
  byte[] actual=packet.toBinary();
  byte[] expected=new byte[]{0,0,36,0,0,0,(byte)128,(byte)129,(byte)130,(byte)131,(byte)132,(byte)133,33,3,1,2,3,4,5,6,(byte)128,0,42,0,4,0,4,0,0,0,0,0,0,0,123,0,0,0,64,65,66,67};
  Assert.assertArrayEquals(expected,actual);
}
Program: 20645
Project: 20645
Buggy source:
@Test public void testToString() throws Exception {
  Packet packet=Packet.newRequest(peers,0,123,new ReadWriteRequest(1000,2000,new byte[]{1,2,3,4,5},123));
  String expected="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  String actual=packet.toString();
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testToString() throws Exception {
  Packet packet=Packet.newRequest(peers,0,123,new ReadWriteRequest(1000,2000,new byte[]{1,2,3,4,5},123));
  String expected="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String actual=packet.toString();
  Assert.assertEquals(expected,actual);
}
Program: 20646
Project: 20646
Buggy source:
private NetId(final int b1,final int b2,final int b3,final int b4,final int b5,final int b6){
  ensureValueFitsByteSize(b1);
  ensureValueFitsByteSize(b2);
  ensureValueFitsByteSize(b3);
  ensureValueFitsByteSize(b4);
  ensureValueFitsByteSize(b5);
  ensureValueFitsByteSize(b6);
  data=new byte[]{(byte)b1,(byte)b2,(byte)b3,(byte)b4,(byte)b5,(byte)b6};
}

Fixed version (ground truth):
private NetId(final int b1,final int b2,final int b3,final int b4,final int b5,final int b6){
  ensureValueFitsByteSize(b1);
  ensureValueFitsByteSize(b2);
  ensureValueFitsByteSize(b3);
  ensureValueFitsByteSize(b4);
  ensureValueFitsByteSize(b5);
  ensureValueFitsByteSize(b6);
  data=new int[]{b1,b2,b3,b4,b5,b6};
}
Program: 20647
Project: 20647
Buggy source:
public static NetId valueOf(final byte[] data){
  if (data.length != 6)   throw new IllegalArgumentException("String_Node_Str");
  final byte b1=data[0];
  final byte b2=data[1];
  final byte b3=data[2];
  final byte b4=data[3];
  final byte b5=data[4];
  final byte b6=data[5];
  return valueOf(b1,b2,b3,b4,b5,b6);
}

Fixed version (ground truth):
public static NetId valueOf(final byte[] data){
  if (data.length != 6)   throw new IllegalArgumentException("String_Node_Str");
  final int[] values=new int[6];
  for (int i=0; i < 6; ++i)   values[i]=Toolbox.toUnsigned(data[i]);
  return valueOf(values[0],values[1],values[2],values[3],values[4],values[5]);
}
Program: 20648
Project: 20648
Buggy source:
public byte[] toBinary(){
  return data.clone();
}

Fixed version (ground truth):
public byte[] toBinary(){
  byte[] ret=new byte[6];
  for (int i=0; i < 6; ++i)   ret[i]=(byte)data[i];
  return ret;
}
Program: 20649
Project: 20649
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player p=(Player)sender;
    Hero pHero=plugin.getHeroManager().getHero(p);
    if (pHero.getInvites().containsKey(args[0])) {
      pHero.setParty(pHero.getInvites().get(args[0]));
      pHero.getInvites().remove(args[0]);
    }
 else {
      sender.sendMessage("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player p=(Player)sender;
    Player argPlayer=plugin.getServer().getPlayer(args[0]);
    Hero pHero=plugin.getHeroManager().getHero(p);
    if (pHero.getInvites().containsKey(argPlayer)) {
      pHero.setParty(pHero.getInvites().get(argPlayer));
      pHero.getInvites().remove(argPlayer);
    }
 else {
      sender.sendMessage("String_Node_Str");
    }
  }
}
Program: 20650
Project: 20650
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player p=(Player)sender;
    Hero pHero=plugin.getHeroManager().getHero(p);
    if (pHero.getParty() == null) {
      Messaging.send(sender,"String_Node_Str",(String)null);
      return;
    }
    if (pHero.getParty().getLeader() != p) {
      Messaging.send(sender,"String_Node_Str",(String)null);
      return;
    }
    if (plugin.getServer().getPlayer(args[0]) != null) {
      Player invitee=plugin.getServer().getPlayer(args[0]);
      Hero inviteeHero=plugin.getHeroManager().getHero(invitee);
      inviteeHero.getInvites().put(p,pHero.getParty());
      sender.sendMessage("String_Node_Str");
      invitee.sendMessage("String_Node_Str" + p.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player p=(Player)sender;
    Hero pHero=plugin.getHeroManager().getHero(p);
    if (pHero.getParty() == null) {
      Messaging.send(sender,"String_Node_Str",(String)null);
      return;
    }
    if (pHero.getParty().getLeader() != p) {
      Messaging.send(sender,"String_Node_Str",(String)null);
      return;
    }
    if (plugin.getServer().getPlayer(args[0]) != null) {
      Player invitee=plugin.getServer().getPlayer(args[0]);
      Hero inviteeHero=plugin.getHeroManager().getHero(invitee);
      inviteeHero.getInvites().put(p,pHero.getParty());
      sender.sendMessage("String_Node_Str");
      invitee.sendMessage("String_Node_Str" + p.getName() + "String_Node_Str"+ p.getName());
    }
  }
}
Program: 20651
Project: 20651
Buggy source:
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",3000);
      EntityDamageEvent damageEvent=new EntityDamageEvent(hero.getPlayer(),DamageCause.ENTITY_ATTACK,0);
      Bukkit.getServer().getPluginManager().callEvent(damageEvent);
      if (damageEvent.isCancelled()) {
        return false;
      }
      pN.setFireTicks(healamount);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",3000);
      EntityDamageEvent damageEvent=new EntityDamageEvent(hero.getPlayer(),DamageCause.ENTITY_ATTACK,0);
      Bukkit.getServer().getPluginManager().callEvent(damageEvent);
      if (damageEvent.isCancelled()) {
        return false;
      }
      pN.setFireTicks(healamount);
    }
  }
  notifyNearbyPlayers(hero.getPlayer().getLocation(),useText,hero.getPlayer().getName(),name);
  return true;
}
Program: 20652
Project: 20652
Buggy source:
@Override public boolean use(Hero hero,String[] args){
  List<Block> blocks=hero.getPlayer().getLineOfSight(null,6);
  hero.getPlayer().teleport(blocks.get(blocks.size() - 1).getLocation());
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,String[] args){
  List<Block> blocks=hero.getPlayer().getLineOfSight(null,6);
  float yawn=hero.getPlayer().getLocation().getYaw();
  hero.getPlayer().teleport(blocks.get(blocks.size() - 1).getLocation());
  hero.getPlayer().getLocation().setYaw(yawn);
  return true;
}
Program: 20653
Project: 20653
Buggy source:
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  int absorbamount=getSetting(hero.getHeroClass(),"String_Node_Str",4);
  if (target.getHealth() < absorbamount) {
    player.setHealth(player.getHealth() + target.getHealth());
    target.damage(target.getHealth());
  }
 else {
    player.setHealth(player.getHealth() + absorbamount);
    target.damage(absorbamount);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  int absorbamount=getSetting(hero.getHeroClass(),"String_Node_Str",4);
  if ((hero.getPlayer().getHealth() + absorbamount) > 100) {
    absorbamount=(100 - hero.getPlayer().getHealth());
  }
  if (target.getHealth() < absorbamount) {
    player.setHealth(player.getHealth() + target.getHealth());
    target.damage(target.getHealth());
    notifyNearbyPlayers(hero.getPlayer().getLocation(),useText,hero.getPlayer().getName(),name);
  }
 else {
    player.setHealth(player.getHealth() + absorbamount);
    target.damage(absorbamount);
    notifyNearbyPlayers(hero.getPlayer().getLocation(),useText,hero.getPlayer().getName(),name);
  }
  return true;
}
Program: 20654
Project: 20654
Buggy source:
public SkillDrainsoul(Heroes plugin){
  super(plugin);
  name="String_Node_Str";
  description="String_Node_Str";
  minArgs=0;
  maxArgs=1;
  identifiers.add("String_Node_Str");
}

Fixed version (ground truth):
public SkillDrainsoul(Heroes plugin){
  super(plugin);
  name="String_Node_Str";
  description="String_Node_Str";
  minArgs=0;
  maxArgs=0;
  identifiers.add("String_Node_Str");
}
Program: 20655
Project: 20655
Buggy source:
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",2);
      pN.setHealth(pN.getHealth() + healamount);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",2);
      pN.setHealth(pN.getHealth() + healamount);
    }
  }
  notifyNearbyPlayers(hero.getPlayer().getLocation(),useText,hero.getPlayer().getName(),name);
  return true;
}
Program: 20656
Project: 20656
Buggy source:
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",1);
      EntityDamageEvent damageEvent=new EntityDamageEvent(hero.getPlayer(),DamageCause.ENTITY_ATTACK,healamount);
      Bukkit.getServer().getPluginManager().callEvent(damageEvent);
      if (damageEvent.isCancelled()) {
        return false;
      }
      pN.damage(healamount);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,String[] args){
  List<Entity> entities=hero.getPlayer().getNearbyEntities(5,5,5);
  for (  Entity n : entities) {
    if (n instanceof Player) {
      Player pN=(Player)n;
      int healamount=getSetting(hero.getHeroClass(),"String_Node_Str",1);
      EntityDamageEvent damageEvent=new EntityDamageEvent(hero.getPlayer(),DamageCause.ENTITY_ATTACK,healamount);
      Bukkit.getServer().getPluginManager().callEvent(damageEvent);
      if (damageEvent.isCancelled()) {
        return false;
      }
      pN.damage(healamount);
    }
  }
  notifyNearbyPlayers(hero.getPlayer().getLocation(),useText,hero.getPlayer().getName(),name);
  return true;
}
Program: 20657
Project: 20657
Buggy source:
public Double expireEffect(String effect){
  System.out.println(effect + "String_Node_Str");
  effectLock.writeLock().lock();
  Double oldTime=effects.remove(effect);
  BaseCommand cmd=manager.getCommand(effect);
  if (cmd != null && cmd instanceof ActiveEffectSkill) {
    ActiveEffectSkill active=(ActiveEffectSkill)cmd;
    active.onExpire(hero);
  }
  effectLock.writeLock().unlock();
  return oldTime;
}

Fixed version (ground truth):
public Double expireEffect(String effect){
  effectLock.writeLock().lock();
  Double oldTime=effects.remove(effect);
  BaseCommand cmd=manager.getCommand(effect);
  if (cmd != null && cmd instanceof ActiveEffectSkill) {
    ActiveEffectSkill active=(ActiveEffectSkill)cmd;
    active.onExpire(hero);
  }
  effectLock.writeLock().unlock();
  return oldTime;
}
Program: 20658
Project: 20658
Buggy source:
@Override public void onPlayerInteract(PlayerInteractEvent event){
  if (event.isCancelled()) {
    return;
  }
  Player player=event.getPlayer();
  Material material=player.getItemInHand().getType();
  Hero hero=plugin.getHeroManager().getHero(player);
  if (hero.getBinds().containsKey(material)) {
    if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
      String[] args=hero.getBinds().get(material);
      plugin.onCommand(player,null,"String_Node_Str",args);
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteract(PlayerInteractEvent event){
  if (event.useItemInHand() == Result.DENY) {
    return;
  }
  Player player=event.getPlayer();
  Material material=player.getItemInHand().getType();
  Hero hero=plugin.getHeroManager().getHero(player);
  if (hero.getBinds().containsKey(material)) {
    if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
      String[] args=hero.getBinds().get(material);
      plugin.onCommand(player,null,"String_Node_Str",args);
    }
  }
}
Program: 20659
Project: 20659
Buggy source:
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  if (target instanceof Player) {
    Player tPlayer=(Player)target;
    if (!(player.getItemInHand().getType() == Material.PAPER)) {
      Messaging.send(player,"String_Node_Str");
      return false;
    }
    if (playerSchedulers.containsKey(tPlayer.getEntityId())) {
      Messaging.send(player,"String_Node_Str",tPlayer.getName());
      return false;
    }
    if (tPlayer.getHealth() >= 20) {
      Messaging.send(player,"String_Node_Str",tPlayer.getName());
      return false;
    }
    tickHealth=config.getInt("String_Node_Str",1);
    ticks=config.getInt("String_Node_Str",10);
    playerSchedulers.put(tPlayer.getEntityId(),plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin,new BandageTask(plugin,tPlayer),20L,20L));
    notifyNearbyPlayers(player.getLocation().toVector(),"String_Node_Str",player.getName(),tPlayer == player ? "String_Node_Str" : tPlayer.getName());
    int firstSlot=player.getInventory().first(Material.PAPER);
    int num=player.getInventory().getItem(firstSlot).getAmount();
    if (num == 1) {
      player.getInventory().clear(firstSlot);
    }
 else     if (num > 1) {
      player.getInventory().getItem(firstSlot).setAmount(num - 1);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  if (target instanceof Player) {
    Player tPlayer=(Player)target;
    if (!(player.getItemInHand().getType() == Material.PAPER)) {
      Messaging.send(player,"String_Node_Str");
      return false;
    }
    if (playerSchedulers.containsKey(tPlayer.getEntityId())) {
      Messaging.send(player,"String_Node_Str",tPlayer.getName());
      return false;
    }
    if (tPlayer.getHealth() >= 20) {
      Messaging.send(player,"String_Node_Str",tPlayer.getName());
      return false;
    }
    tickHealth=config.getInt("String_Node_Str",1);
    ticks=config.getInt("String_Node_Str",10);
    playerSchedulers.put(tPlayer.getEntityId(),plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new BandageTask(plugin,tPlayer),20L,20L));
    notifyNearbyPlayers(player.getLocation().toVector(),"String_Node_Str",player.getName(),tPlayer == player ? "String_Node_Str" : tPlayer.getName());
    int firstSlot=player.getInventory().first(Material.PAPER);
    int num=player.getInventory().getItem(firstSlot).getAmount();
    if (num == 1) {
      player.getInventory().clear(firstSlot);
    }
 else     if (num > 1) {
      player.getInventory().getItem(firstSlot).setAmount(num - 1);
    }
    return true;
  }
  return false;
}
Program: 20661
Project: 20661
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    return;
  }
  Player player=(Player)sender;
  int page=0;
  if (args.length != 0) {
    try {
      page=Integer.parseInt(args[0]) - 1;
    }
 catch (    NumberFormatException e) {
    }
  }
  List<BaseCommand> sortCommands=plugin.getCommandManager().getCommands();
  List<Skill> skills=new ArrayList<Skill>();
  HeroClass heroClass=plugin.getHeroManager().getHero(player).getPlayerClass();
  for (  BaseCommand command : sortCommands) {
    if (command instanceof Skill) {
      Skill skill=(Skill)command;
      if (heroClass.hasSkill(skill.getName())) {
        skills.add(skill);
      }
    }
  }
  int numPages=skills.size() / SKILLS_PER_PAGE;
  if (skills.size() % SKILLS_PER_PAGE != 0) {
    numPages++;
  }
  if (page >= numPages || page < 0) {
    page=0;
  }
  sender.sendMessage("String_Node_Str" + "String_Node_Str" + heroClass.getName() + "String_Node_Str"+ (page + 1)+ "String_Node_Str"+ numPages+ "String_Node_Str");
  int start=page * SKILLS_PER_PAGE;
  int end=start + SKILLS_PER_PAGE;
  if (end > skills.size()) {
    end=skills.size();
  }
  for (int s=start; s < end; s++) {
    Skill skill=skills.get(s);
    sender.sendMessage("String_Node_Str" + skill.getUsage() + "String_Node_Str"+ heroClass.getSkillSettings(skill.getName()).LevelRequirement);
  }
  sender.sendMessage("String_Node_Str");
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    return;
  }
  Player player=(Player)sender;
  int page=0;
  if (args.length != 0) {
    try {
      page=Integer.parseInt(args[0]) - 1;
    }
 catch (    NumberFormatException e) {
    }
  }
  List<BaseCommand> sortCommands=plugin.getCommandManager().getCommands();
  List<Skill> skills=new ArrayList<Skill>();
  HeroClass heroClass=plugin.getHeroManager().getHero(player).getPlayerClass();
  for (  BaseCommand command : sortCommands) {
    if (command instanceof Skill) {
      Skill skill=(Skill)command;
      if (heroClass.hasSkill(skill.getName()) && !skills.contains(skill)) {
        skills.add(skill);
      }
    }
  }
  int numPages=skills.size() / SKILLS_PER_PAGE;
  if (skills.size() % SKILLS_PER_PAGE != 0) {
    numPages++;
  }
  if (page >= numPages || page < 0) {
    page=0;
  }
  sender.sendMessage("String_Node_Str" + "String_Node_Str" + heroClass.getName() + "String_Node_Str"+ (page + 1)+ "String_Node_Str"+ numPages+ "String_Node_Str");
  int start=page * SKILLS_PER_PAGE;
  int end=start + SKILLS_PER_PAGE;
  if (end > skills.size()) {
    end=skills.size();
  }
  for (int s=start; s < end; s++) {
    Skill skill=skills.get(s);
    sender.sendMessage("String_Node_Str" + skill.getUsage() + "String_Node_Str"+ heroClass.getSkillSettings(skill.getName()).LevelRequirement);
  }
  sender.sendMessage("String_Node_Str");
}
Program: 20662
Project: 20662
Buggy source:
@Override public boolean use(Hero hero,String[] args){
  Player player=hero.getPlayer();
  float pitch=player.getEyeLocation().getPitch();
  if (pitch > 0) {
    pitch=-pitch;
  }
  float multiplier=(90f + pitch) / 40f;
  Vector v=player.getVelocity().setY(1).add(player.getLocation().getDirection().setY(0).normalize().multiply(multiplier));
  player.setVelocity(v);
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,String[] args){
  Player player=hero.getPlayer();
  float pitch=player.getEyeLocation().getPitch();
  if (pitch > 0) {
    pitch=-pitch;
  }
  float multiplier=(90f + pitch) / 40f;
  Vector v=player.getVelocity().setY(1).add(player.getLocation().getDirection().setY(0).normalize().multiply(multiplier));
  player.setVelocity(v);
  player.setFallDistance(-5f);
  return true;
}
Program: 20663
Project: 20663
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    HeroManager heroManager=plugin.getHeroManager();
    ClassManager classManager=plugin.getClassManager();
    Hero hero=heroManager.getHero(player);
    HeroClass playerClass=hero.getPlayerClass();
    if (playerClass.isPrimary() && prop.getLevel(hero.getExperience()) > prop.classSwitchLevel) {
      HeroClass subClass=classManager.getClass(args[0]);
      if (subClass != null) {
        if (subClass.getParent() == playerClass) {
          hero.setPlayerClass(subClass);
          plugin.getMessager().send(player,"String_Node_Str",subClass.getName());
        }
 else {
          plugin.getMessager().send(player,"String_Node_Str",playerClass.getName());
        }
      }
 else {
        plugin.getMessager().send(player,"String_Node_Str");
      }
    }
 else {
      plugin.getMessager().send(player,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    HeroManager heroManager=plugin.getHeroManager();
    ClassManager classManager=plugin.getClassManager();
    Hero hero=heroManager.getHero(player);
    HeroClass playerClass=hero.getPlayerClass();
    if (playerClass.isPrimary()) {
      if (prop.getLevel(hero.getExperience()) >= prop.classSwitchLevel) {
        HeroClass subClass=classManager.getClass(args[0]);
        if (subClass != null) {
          if (subClass.getParent() == playerClass) {
            hero.setPlayerClass(subClass);
            plugin.getMessager().send(player,"String_Node_Str",subClass.getName());
          }
 else {
            plugin.getMessager().send(player,"String_Node_Str",playerClass.getName());
          }
        }
 else {
          plugin.getMessager().send(player,"String_Node_Str");
        }
      }
 else {
        plugin.getMessager().send(player,"String_Node_Str");
      }
    }
 else {
      plugin.getMessager().send(player,"String_Node_Str");
    }
  }
}
Program: 20664
Project: 20664
Buggy source:
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  final Player tPlayer=(Player)target;
  if (!player.getItemInHand().equals(Material.PAPER)) {
    plugin.getMessager().send(player,"String_Node_Str");
    return false;
  }
  playerSchedulers.put(tPlayer,plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin,new Runnable(){
    public int timesRan=0;
    @Override public void run(){
      if (timesRan == 10) {
        playerSchedulers.remove(tPlayer);
        plugin.getServer().getScheduler().cancelTask(playerSchedulers.get(tPlayer));
      }
 else {
        timesRan++;
        tPlayer.setHealth(tPlayer.getHealth() + 1);
      }
    }
  }
,20L,20L));
  return true;
}

Fixed version (ground truth):
@Override public boolean use(Hero hero,LivingEntity target,String[] args){
  Player player=hero.getPlayer();
  final Player tPlayer=(Player)target;
  if (!player.getItemInHand().equals(Material.PAPER)) {
    plugin.getMessager().send(player,"String_Node_Str");
    return false;
  }
  playerSchedulers.put(tPlayer,plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin,new Runnable(){
    public int timesRan=0;
    public int id=playerSchedulers.get(tPlayer);
    @Override public void run(){
      if (timesRan == 10) {
        playerSchedulers.remove(id);
        plugin.getServer().getScheduler().cancelTask(id);
      }
 else {
        timesRan++;
        tPlayer.setHealth(tPlayer.getHealth() + 1);
      }
    }
  }
,20L,20L));
  return true;
}
Program: 20665
Project: 20665
Buggy source:
@Override public void run(){
  if (timesRan == 10) {
    playerSchedulers.remove(tPlayer);
    plugin.getServer().getScheduler().cancelTask(playerSchedulers.get(tPlayer));
  }
 else {
    timesRan++;
    tPlayer.setHealth(tPlayer.getHealth() + 1);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (timesRan == 10) {
    playerSchedulers.remove(id);
    plugin.getServer().getScheduler().cancelTask(id);
  }
 else {
    timesRan++;
    tPlayer.setHealth(tPlayer.getHealth() + 1);
  }
}
Program: 20666
Project: 20666
Buggy source:
@Override public void execute(CommandSender sender,String[] args){
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    if (args[1] != null) {
      if (plugin.getHeroManager().getHero((Player)sender).getPlayerClass().getSkills().contains(args[0])) {
        plugin.getHeroManager().getHero((Player)sender).bind(Material.getMaterial(args[0]),Arrays.copyOf(args,1));
        Player player=(Player)sender;
        if (args.length > 0) {
          if (plugin.getHeroManager().getHero(player).getPlayerClass().getSkills().contains(args[0])) {
            plugin.getHeroManager().getHero(player).bind(Material.getMaterial(args[0]),Arrays.copyOf(args,1));
            plugin.getMessager().send(sender,"String_Node_Str",(String[])null);
          }
 else {
            plugin.getMessager().send(sender,"String_Node_Str",(String[])null);
          }
        }
 else {
          plugin.getHeroManager().getHero(player).unbind(Material.getMaterial(args[0]));
          plugin.getMessager().send(sender,"String_Node_Str",(String[])null);
        }
      }
 else {
        plugin.getHeroManager().getHero((Player)sender).bind(Material.getMaterial(args[0]),null);
      }
    }
  }
}
Program: 20667
Project: 20667
Buggy source:
/** 
 * Change the Players Class to the specified Class.
 * @param player
 * @param playerClass
 */
public void setClass(Player player,HeroClass playerClass){
  PlayerClassEvent event=new PlayerClassEvent(Type.CUSTOM_EVENT,player,playerClass);
  plugin.getServer().getPluginManager().callEvent(event);
  if (event.isCancelled() == true) {
    return;
  }
  String name=event.getPlayer().getName();
  plugin.getSqlManager().tryUpdate("String_Node_Str" + event.getPlayerClass().getName() + "String_Node_Str"+ name+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Change the Players Class to the specified Class.
 * @param player
 * @param playerClass
 */
public void setClass(Player player,HeroClass playerClass){
  PlayerClassEvent event=new PlayerClassEvent(Type.CUSTOM_EVENT,player,playerClass);
  plugin.getServer().getPluginManager().callEvent(event);
  if (event.isCancelled() == true) {
    return;
  }
  String name=event.getPlayer().getName();
  setExp(player,0);
  plugin.getSqlManager().tryUpdate("String_Node_Str" + event.getPlayerClass().getName() + "String_Node_Str"+ name+ "String_Node_Str");
}
Program: 20668
Project: 20668
Buggy source:
public void onEntityDeath(EntityDeathEvent event){
  Entity defender=event.getEntity();
  Player attacker=kills.get(defender);
  if (attacker != null) {
    HeroClass playerClass=plugin.getPlayerManager().getClass(attacker);
    Set<ExperienceType> expSources=playerClass.getExperienceSources();
    if (expSources.contains(ExperienceType.KILLING)) {
      if (defender instanceof LivingEntity) {
        if (defender instanceof Player) {
          playerManager.setExp(attacker,playerManager.getExp(attacker) + Properties.playerKillingExp);
        }
 else {
          CreatureType type=null;
          try {
            Class<?>[] interfaces=defender.getClass().getInterfaces();
            for (            Class<?> c : interfaces) {
              if (LivingEntity.class.isAssignableFrom(c)) {
                type=CreatureType.fromName(c.getSimpleName());
                break;
              }
            }
          }
 catch (          IllegalArgumentException e) {
          }
          if (type != null) {
            playerManager.setExp(attacker,playerManager.getExp(attacker) + Properties.creatureKillingExp.get("String_Node_Str"));
          }
        }
      }
    }
  }
  kills.remove(defender);
}

Fixed version (ground truth):
public void onEntityDeath(EntityDeathEvent event){
  Entity defender=event.getEntity();
  Player attacker=kills.get(defender);
  if (attacker != null) {
    HeroClass playerClass=plugin.getPlayerManager().getClass(attacker);
    Set<ExperienceType> expSources=playerClass.getExperienceSources();
    if (expSources.contains(ExperienceType.KILLING)) {
      if (defender instanceof LivingEntity) {
        if (defender instanceof Player) {
          playerManager.setExp(attacker,playerManager.getExp(attacker) + Properties.playerKillingExp);
        }
 else {
          CreatureType type=null;
          try {
            Class<?>[] interfaces=defender.getClass().getInterfaces();
            for (            Class<?> c : interfaces) {
              if (LivingEntity.class.isAssignableFrom(c)) {
                type=CreatureType.fromName(c.getSimpleName());
                break;
              }
            }
          }
 catch (          IllegalArgumentException e) {
          }
          if (type != null) {
            playerManager.setExp(attacker,playerManager.getExp(attacker) + Properties.creatureKillingExp.get(type.toString()));
          }
        }
      }
    }
  }
  kills.remove(defender);
}
Program: 20669
Project: 20669
Buggy source:
private static String parameterizeMessage(String msg,String... params){
  msg="String_Node_Str" + msg;
  for (int i=0; i < params.length; i++) {
    msg=msg.replace("String_Node_Str" + i,"String_Node_Str" + params[i] + "String_Node_Str");
  }
  return msg;
}

Fixed version (ground truth):
private static String parameterizeMessage(String msg,String... params){
  msg="String_Node_Str" + msg;
  for (int i=0; i < params.length; i++) {
    msg=msg.replace("String_Node_Str" + (i + 1),"String_Node_Str" + params[i] + "String_Node_Str");
  }
  return msg;
}
Program: 20670
Project: 20670
Buggy source:
@Around(value="String_Node_Str",argNames="String_Node_Str") static void timeMethod(final ProceedingJoinPoint pjp,final PerfTimed timed) throws Throwable {
  time(pjp,timed);
}

Fixed version (ground truth):
@Around(value="String_Node_Str",argNames="String_Node_Str") static Object timeMethod(final ProceedingJoinPoint pjp,final PerfTimed timed) throws Throwable {
  return time(pjp,timed);
}
Program: 20671
Project: 20671
Buggy source:
private static void time(final ProceedingJoinPoint pjp,final PerfTimed timed) throws Throwable {
  Assert.notNull(pjp);
  Assert.notNull(timed);
  final Signature signature=pjp.getSignature();
  final String longString="String_Node_Str" + signature.toLongString() + "String_Node_Str";
  System.out.println();
  System.out.println("String_Node_Str" + longString);
  final long startTimeMs=System.currentTimeMillis();
  try {
    pjp.proceed();
  }
  finally {
    final long timeTakenMs=System.currentTimeMillis() - startTimeMs;
    System.out.println("String_Node_Str" + longString + "String_Node_Str"+ timeTakenMs+ "String_Node_Str");
    System.out.println();
  }
}

Fixed version (ground truth):
private static Object time(final ProceedingJoinPoint pjp,final PerfTimed timed) throws Throwable {
  Assert.notNull(pjp);
  Assert.notNull(timed);
  final Signature signature=pjp.getSignature();
  final String longString="String_Node_Str" + signature.toLongString() + "String_Node_Str";
  System.out.println();
  System.out.println("String_Node_Str" + longString);
  final long startTimeMs=System.currentTimeMillis();
  try {
    return pjp.proceed();
  }
  finally {
    final long timeTakenMs=System.currentTimeMillis() - startTimeMs;
    System.out.println("String_Node_Str" + longString + "String_Node_Str"+ timeTakenMs+ "String_Node_Str");
    System.out.println();
  }
}
Program: 20672
Project: 20672
Buggy source:
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
}

Fixed version (ground truth):
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createRequest(header).getMiddleSwitch().setBitValue(headerValue);
}
Program: 20673
Project: 20673
Buggy source:
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createRequest(header).getRootHeaderA().setBitValue(headerValue);
}

Fixed version (ground truth):
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createRequest(header).getRootSwitch().setBitValue(headerValue);
}
Program: 20674
Project: 20674
Buggy source:
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
}

Fixed version (ground truth):
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createResponse(header).getMiddleSwitch().setBitValue(headerValue);
}
Program: 20675
Project: 20675
Buggy source:
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
}

Fixed version (ground truth):
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createResponse(header).getMiddleSwitch().setBitValue(headerValue);
}
Program: 20676
Project: 20676
Buggy source:
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  MyRootProtocol_Response_API response=createResponse(header);
}

Fixed version (ground truth):
@Override protected void makeHeader(IProtocolMessage header,IProtocolMessage payload,int headerValue){
  createResponse(header).getRootSwitchResp().setBitValue(headerValue);
}
Program: 20677
Project: 20677
Buggy source:
/** 
 * Returns a machine-readable String for printing the contents of this pose.
 * @return the convenient string.
 */
public String serialize(){
  return "String_Node_Str" + "String_Node_Str" + getTranslateY() + "String_Node_Str"+ getRotateTheta();
}

Fixed version (ground truth):
/** 
 * Returns a machine-readable String for printing the contents of this pose.
 * @return the convenient string.
 */
public String serialize(){
  return getTranslateX() + "String_Node_Str" + getTranslateY()+ "String_Node_Str"+ getRotateTheta();
}
Program: 20678
Project: 20678
Buggy source:
/** 
 * Returns a convenient String for printing the contents of this pose.
 * @return the convenient string.
 */
public String toString(){
  return "String_Node_Str" + "String_Node_Str" + getTranslateY() + "String_Node_Str"+ getRotateTheta();
}

Fixed version (ground truth):
/** 
 * Returns a convenient String for printing the contents of this pose.
 * @return the convenient string.
 */
public String toString(){
  return getTranslateX() + "String_Node_Str" + getTranslateY()+ "String_Node_Str"+ getRotateTheta();
}