nus-yam/ex-repair huggingface dataset:
Program: 2213
Project: 2213
Buggy source:
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void altars(PlayerInteractEvent event){
  Action action=event.getAction();
  if (action != Action.RIGHT_CLICK_BLOCK)   return;
  Player player=event.getPlayer();
  UConf uconf=UConf.get(player);
  uconf.altarDark.evalBlockUse(event.getClickedBlock(),player);
  uconf.altarLight.evalBlockUse(event.getClickedBlock(),player);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void altars(PlayerInteractEvent event){
  Action action=event.getAction();
  if (action != Action.RIGHT_CLICK_BLOCK)   return;
  Player player=event.getPlayer();
  UConf uconf=UConf.get(player);
  if (uconf.altarDark.evalBlockUse(event.getClickedBlock(),player) || uconf.altarLight.evalBlockUse(event.getClickedBlock(),player)) {
    event.setCancelled(true);
  }
}
Program: 2214
Project: 2214
Buggy source:
public void evalBlockUse(Block coreBlock,Player player){
  if (coreBlock.getType() != coreMaterial)   return;
  UPlayer uplayer=UPlayer.get(player);
  UConf uconf=UConf.get(player);
  if (!this.materialCounts.containsKey(this.coreMaterial)) {
    this.materialCounts.put(this.coreMaterial,1);
  }
  ArrayList<Block> blocks=getCubeBlocks(coreBlock,uconf.altarSearchRadius);
  Map<Material,Integer> nearbyMaterialCounts=countMaterials(blocks,this.materialCounts.keySet());
  int requiredMaterialCountSum=this.sumCollection(this.materialCounts.values());
  int nearbyMaterialCountSum=this.sumCollection(nearbyMaterialCounts.values());
  if (nearbyMaterialCountSum < requiredMaterialCountSum * uconf.altarMinRatioForInfo)   return;
  Map<Material,Integer> missingMaterialCounts=this.getMissingMaterialCounts(nearbyMaterialCounts);
  if (this.sumCollection(missingMaterialCounts.values()) > 0) {
    player.sendMessage(Txt.parse(MLang.get().altarIncomplete,this.name));
    for (    Entry<Material,Integer> entry : missingMaterialCounts.entrySet()) {
      Material material=entry.getKey();
      int count=entry.getValue();
      player.sendMessage(Txt.parse("String_Node_Str",count,Txt.getMaterialName(material)));
    }
    return;
  }
  this.use(uplayer,player);
}

Fixed version (ground truth):
public boolean evalBlockUse(Block coreBlock,Player player){
  if (coreBlock.getType() != coreMaterial)   return false;
  UPlayer uplayer=UPlayer.get(player);
  UConf uconf=UConf.get(player);
  if (!this.materialCounts.containsKey(this.coreMaterial)) {
    this.materialCounts.put(this.coreMaterial,1);
  }
  ArrayList<Block> blocks=getCubeBlocks(coreBlock,uconf.altarSearchRadius);
  Map<Material,Integer> nearbyMaterialCounts=countMaterials(blocks,this.materialCounts.keySet());
  int requiredMaterialCountSum=this.sumCollection(this.materialCounts.values());
  int nearbyMaterialCountSum=this.sumCollection(nearbyMaterialCounts.values());
  if (nearbyMaterialCountSum < requiredMaterialCountSum * uconf.altarMinRatioForInfo)   return false;
  Map<Material,Integer> missingMaterialCounts=this.getMissingMaterialCounts(nearbyMaterialCounts);
  if (this.sumCollection(missingMaterialCounts.values()) > 0) {
    player.sendMessage(Txt.parse(MLang.get().altarIncomplete,this.name));
    for (    Entry<Material,Integer> entry : missingMaterialCounts.entrySet()) {
      Material material=entry.getKey();
      int count=entry.getValue();
      player.sendMessage(Txt.parse("String_Node_Str",count,Txt.getMaterialName(material)));
    }
    return false;
  }
  return this.use(uplayer,player);
}
Program: 2215
Project: 2215
Buggy source:
public abstract void use(UPlayer uplayer,Player player);

Fixed version (ground truth):
public abstract boolean use(UPlayer uplayer,Player player);
Program: 2216
Project: 2216
Buggy source:
@Override public void use(UPlayer uplayer,Player player){
  uplayer.msg("String_Node_Str");
  uplayer.msg(this.desc);
  if (!Perm.ALTAR_DARK.has(player,true))   return;
  uplayer.msg(MLang.get().altarDarkCommon);
  FxUtil.ensure(PotionEffectType.BLINDNESS,player,12 * 20);
  uplayer.runFxSmoke();
  if (uplayer.isHealthy()) {
    if (!ResourceUtil.playerRemoveAttempt(player,this.resources,MLang.get().altarResourceSuccess,MLang.get().altarResourceFail))     return;
    uplayer.msg(MLang.get().altarDarkHealthy);
    player.getWorld().strikeLightningEffect(player.getLocation().add(0,3,0));
    uplayer.runFxSmokeBurst();
    uplayer.addInfection(0.01D,InfectionReason.ALTAR,null);
  }
 else   if (uplayer.isVampire()) {
    uplayer.msg(MLang.get().altarDarkVampire);
  }
 else   if (uplayer.isInfected()) {
    uplayer.msg(MLang.get().altarDarkInfected);
  }
}

Fixed version (ground truth):
@Override public boolean use(final UPlayer uplayer,final Player player){
  uplayer.msg("String_Node_Str");
  uplayer.msg(this.desc);
  if (!Perm.ALTAR_DARK.has(player,true))   return false;
  uplayer.msg(MLang.get().altarDarkCommon);
  FxUtil.ensure(PotionEffectType.BLINDNESS,player,12 * 20);
  uplayer.runFxSmoke();
  if (uplayer.isHealthy()) {
    if (!ResourceUtil.playerRemoveAttempt(player,this.resources,MLang.get().altarResourceSuccess,MLang.get().altarResourceFail))     return false;
    Bukkit.getScheduler().scheduleSyncDelayedTask(Vampire.get(),new Runnable(){
      public void run(){
        uplayer.msg(MLang.get().altarDarkHealthy);
        player.getWorld().strikeLightningEffect(player.getLocation().add(0,3,0));
        uplayer.runFxSmokeBurst();
        uplayer.addInfection(0.01D,InfectionReason.ALTAR,null);
      }
    }
,1);
    return true;
  }
 else   if (uplayer.isVampire()) {
    uplayer.msg(MLang.get().altarDarkVampire);
  }
 else   if (uplayer.isInfected()) {
    uplayer.msg(MLang.get().altarDarkInfected);
  }
  return false;
}
Program: 2217
Project: 2217
Buggy source:
@Override public void use(UPlayer uplayer,Player player){
  UConf uconf=UConf.get(player);
  uplayer.msg("String_Node_Str");
  uplayer.msg(this.desc);
  if (!Perm.ALTAR_LIGHT.has(player,true))   return;
  if (!uplayer.isVampire() && playerHoldsWaterBottle(player)) {
    if (!ResourceUtil.playerRemoveAttempt(player,uconf.holyWaterResources,MLang.get().altarLightWaterResourceSuccess,MLang.get().altarLightWaterResourceFail))     return;
    ResourceUtil.playerAdd(player,HolyWaterUtil.createItemStack());
    uplayer.msg(MLang.get().altarLightWaterResult);
    uplayer.runFxEnderBurst();
    return;
  }
  uplayer.msg(MLang.get().altarLightCommon);
  uplayer.runFxEnder();
  if (uplayer.isVampire()) {
    if (!ResourceUtil.playerRemoveAttempt(player,this.resources,MLang.get().altarResourceSuccess,MLang.get().altarResourceFail))     return;
    uplayer.msg(MLang.get().altarLightVampire);
    player.getWorld().strikeLightningEffect(player.getLocation().add(0,3,0));
    uplayer.runFxEnderBurst();
    uplayer.setVampire(false);
    return;
  }
 else   if (uplayer.isHealthy()) {
    uplayer.msg(MLang.get().altarLightHealthy);
  }
 else   if (uplayer.isInfected()) {
    uplayer.msg(MLang.get().altarLightInfected);
    uplayer.setInfection(0);
    uplayer.runFxEnderBurst();
  }
}

Fixed version (ground truth):
@Override public boolean use(final UPlayer uplayer,final Player player){
  UConf uconf=UConf.get(player);
  uplayer.msg("String_Node_Str");
  uplayer.msg(this.desc);
  if (!Perm.ALTAR_LIGHT.has(player,true))   return false;
  if (!uplayer.isVampire() && playerHoldsWaterBottle(player)) {
    if (!ResourceUtil.playerRemoveAttempt(player,uconf.holyWaterResources,MLang.get().altarLightWaterResourceSuccess,MLang.get().altarLightWaterResourceFail))     return false;
    Bukkit.getScheduler().scheduleSyncDelayedTask(Vampire.get(),new Runnable(){
      public void run(){
        ResourceUtil.playerAdd(player,HolyWaterUtil.createItemStack());
        uplayer.msg(MLang.get().altarLightWaterResult);
        uplayer.runFxEnderBurst();
      }
    }
,1);
    return true;
  }
  uplayer.msg(MLang.get().altarLightCommon);
  uplayer.runFxEnder();
  if (uplayer.isVampire()) {
    if (!ResourceUtil.playerRemoveAttempt(player,this.resources,MLang.get().altarResourceSuccess,MLang.get().altarResourceFail))     return false;
    Bukkit.getScheduler().scheduleSyncDelayedTask(Vampire.get(),new Runnable(){
      public void run(){
        uplayer.msg(MLang.get().altarLightVampire);
        player.getWorld().strikeLightningEffect(player.getLocation().add(0,3,0));
        uplayer.runFxEnderBurst();
        uplayer.setVampire(false);
      }
    }
,1);
    return true;
  }
 else   if (uplayer.isHealthy()) {
    uplayer.msg(MLang.get().altarLightHealthy);
  }
 else   if (uplayer.isInfected()) {
    uplayer.msg(MLang.get().altarLightInfected);
    uplayer.setInfection(0);
    uplayer.runFxEnderBurst();
  }
  return false;
}
Program: 2218
Project: 2218
Buggy source:
public void tickRegen(long ticks){
  if (!this.isVampire())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() == GameMode.CREATIVE)   return;
  if (me.isDead())   return;
  if (me.getHealth() >= 20)   return;
  if (this.getFood().get() < conf.regenMinFood)   return;
  long millisSinceLastDamage=System.currentTimeMillis() - this.lastDamageMillis;
  if (millisSinceLastDamage < conf.regenDelayMillis)   return;
  double foodDiff=this.getFood().add(-conf.regenFoodPerTick * ticks);
  me.setHealth(me.getHealth() - foodDiff * conf.regenHealthPerFood);
}

Fixed version (ground truth):
public void tickRegen(long ticks){
  if (!this.isVampire())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() == GameMode.CREATIVE)   return;
  if (me.isDead())   return;
  if (me.getHealth() >= 20)   return;
  if (this.getFood().get() < conf.regenMinFood)   return;
  long millisSinceLastDamage=System.currentTimeMillis() - this.lastDamageMillis;
  if (millisSinceLastDamage < conf.regenDelayMillis)   return;
  double foodDiff=this.getFood().add(-conf.regenFoodPerTick * ticks);
  double healthTarget=me.getHealth() - foodDiff * conf.regenHealthPerFood;
  healthTarget=Math.min(healthTarget,me.getMaxHealth());
  healthTarget=Math.max(healthTarget,0D);
  me.setHealth(healthTarget);
}
Program: 2219
Project: 2219
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void bloodlustSmokeTrail(PlayerMoveEvent event){
  Player player=event.getPlayer();
  if (player.getGameMode() != GameMode.SURVIVAL)   return;
  Block from=event.getFrom().getBlock();
  Block to=event.getTo().getBlock();
  if (from.equals(to))   return;
  VPlayer vplayer=VPlayer.get(player);
  if (vplayer.isHuman())   return;
  if (!vplayer.isBloodlusting())   return;
  Conf conf=Conf.get(player);
  Location one=event.getFrom().clone();
  Location two=one.clone().add(0,1,0);
  long count1=MUtil.probabilityRound(conf.bloodlustSmokes);
  long count2=MUtil.probabilityRound(conf.bloodlustSmokes);
  for (long i=count1; i > 0; i--)   FxUtil.smoke(one);
  for (long i=count2; i > 0; i--)   FxUtil.smoke(two);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void bloodlustSmokeTrail(PlayerMoveEvent event){
  Player player=event.getPlayer();
  if (player.getGameMode() == GameMode.CREATIVE)   return;
  Block from=event.getFrom().getBlock();
  Block to=event.getTo().getBlock();
  if (from.equals(to))   return;
  VPlayer vplayer=VPlayer.get(player);
  if (vplayer.isHuman())   return;
  if (!vplayer.isBloodlusting())   return;
  Conf conf=Conf.get(player);
  Location one=event.getFrom().clone();
  Location two=one.clone().add(0,1,0);
  long count1=MUtil.probabilityRound(conf.bloodlustSmokes);
  long count2=MUtil.probabilityRound(conf.bloodlustSmokes);
  for (long i=count1; i > 0; i--)   FxUtil.smoke(one);
  for (long i=count2; i > 0; i--)   FxUtil.smoke(two);
}
Program: 2220
Project: 2220
Buggy source:
public void tickRegen(long ticks){
  if (!this.isVampire())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  boolean survival=me.getGameMode() == GameMode.SURVIVAL;
  if (!survival)   return;
  if (me.isDead())   return;
  if (me.getHealth() >= 20)   return;
  if (this.getFood().get() < conf.regenMinFood)   return;
  long millisSinceLastDamage=System.currentTimeMillis() - this.lastDamageMillis;
  if (millisSinceLastDamage < conf.regenDelayMillis)   return;
  double foodDiff=this.getFood().add(-conf.regenFoodPerTick * ticks);
  this.getHealth().add(-foodDiff * conf.regenHealthPerFood);
}

Fixed version (ground truth):
public void tickRegen(long ticks){
  if (!this.isVampire())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() == GameMode.CREATIVE)   return;
  if (me.isDead())   return;
  if (me.getHealth() >= 20)   return;
  if (this.getFood().get() < conf.regenMinFood)   return;
  long millisSinceLastDamage=System.currentTimeMillis() - this.lastDamageMillis;
  if (millisSinceLastDamage < conf.regenDelayMillis)   return;
  double foodDiff=this.getFood().add(-conf.regenFoodPerTick * ticks);
  this.getHealth().add(-foodDiff * conf.regenHealthPerFood);
}
Program: 2222
Project: 2222
Buggy source:
public void tickInfection(long ticks){
  if (!this.isInfected())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  boolean survival=me.getGameMode() == GameMode.SURVIVAL;
  if (!survival)   return;
  int indexOld=this.infectionGetMessageIndex();
  this.addInfection(ticks * conf.infectionPerTick);
  int indexNew=this.infectionGetMessageIndex();
  if (this.isVampire())   return;
  if (indexOld == indexNew)   return;
  if (conf.infectionProgressDamage != 0)   me.damage(conf.infectionProgressDamage);
  if (conf.infectionProgressNauseaTicks > 0)   FxUtil.ensure(PotionEffectType.CONFUSION,me,conf.infectionProgressNauseaTicks);
  this.msg(Lang.infectionFeeling.get(indexNew));
  this.msg(Lang.infectionHint.get(MCore.random.nextInt(Lang.infectionHint.size())));
  this.changed();
}

Fixed version (ground truth):
public void tickInfection(long ticks){
  if (!this.isInfected())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() == GameMode.CREATIVE)   return;
  int indexOld=this.infectionGetMessageIndex();
  this.addInfection(ticks * conf.infectionPerTick);
  int indexNew=this.infectionGetMessageIndex();
  if (this.isVampire())   return;
  if (indexOld == indexNew)   return;
  if (conf.infectionProgressDamage != 0)   me.damage(conf.infectionProgressDamage);
  if (conf.infectionProgressNauseaTicks > 0)   FxUtil.ensure(PotionEffectType.CONFUSION,me,conf.infectionProgressNauseaTicks);
  this.msg(Lang.infectionFeeling.get(indexNew));
  this.msg(Lang.infectionHint.get(MCore.random.nextInt(Lang.infectionHint.size())));
  this.changed();
}
Program: 2223
Project: 2223
Buggy source:
public void tickRadTemp(long ticks){
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  boolean survival=me.getGameMode() == GameMode.SURVIVAL;
  if (survival && this.isVampire() && !me.isDead()) {
    this.rad=conf.baseRad + SunUtil.calcPlayerIrradiation(me);
    Double tempDelta=conf.tempPerRadAndTick * this.rad * ticks;
    this.addTemp(tempDelta);
  }
 else {
    this.rad=0;
    this.temp=0;
  }
}

Fixed version (ground truth):
public void tickRadTemp(long ticks){
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() != GameMode.CREATIVE && this.isVampire() && !me.isDead()) {
    this.rad=conf.baseRad + SunUtil.calcPlayerIrradiation(me);
    Double tempDelta=conf.tempPerRadAndTick * this.rad * ticks;
    this.addTemp(tempDelta);
  }
 else {
    this.rad=0;
    this.temp=0;
  }
}
Program: 2224
Project: 2224
Buggy source:
public void tickBloodlust(long ticks){
  if (!this.isVampire())   return;
  if (!this.isBloodlusting())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  boolean survival=me.getGameMode() == GameMode.SURVIVAL;
  if (!survival)   return;
  if (me.isDead())   return;
  this.getFood().add(ticks * conf.bloodlustFoodPerTick);
  if (this.getFood().get() < conf.bloodlustMinFood)   this.setBloodlusting(false);
}

Fixed version (ground truth):
public void tickBloodlust(long ticks){
  if (!this.isVampire())   return;
  if (!this.isBloodlusting())   return;
  Player me=this.getPlayer();
  if (me == null)   return;
  Conf conf=Conf.get(me);
  if (me.getGameMode() == GameMode.CREATIVE)   return;
  if (me.isDead())   return;
  this.getFood().add(ticks * conf.bloodlustFoodPerTick);
  if (this.getFood().get() < conf.bloodlustMinFood)   this.setBloodlusting(false);
}
Program: 2225
Project: 2225
Buggy source:
public void updateMovement(){
  Player player=this.getPlayer();
  Conf conf=Conf.get(player);
  if (player == null)   return;
  Map<Integer,Integer> potionEffectStrengths=null;
  if (this.vampire() && this.bloodlust()) {
    potionEffectStrengths=conf.potionEffectStrengthBloodlust;
  }
 else   if (this.vampire()) {
    potionEffectStrengths=conf.potionEffectStrengthVamp;
  }
 else {
    potionEffectStrengths=conf.potionEffectStrengthHuman;
  }
  boolean somethingEnabled=false;
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    Integer val=entry.getValue();
    if (val != null && val > 0) {
      somethingEnabled=true;
      break;
    }
  }
  if (somethingEnabled) {
    P.p.noCheatExemptedPlayerNames.add(player.getName());
  }
 else {
    P.p.noCheatExemptedPlayerNames.remove(player.getName());
  }
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    PotionEffectType pet=PotionEffectType.getById(entry.getKey());
    Integer strength=entry.getValue();
    if (strength == null || strength < 1) {
      player.removePotionEffect(pet);
    }
 else {
      PaketUtil.addPotionEffectNoGraphic(player,new PotionEffect(pet,100000,strength));
    }
  }
}

Fixed version (ground truth):
public void updateMovement(){
  Player player=this.getPlayer();
  Conf conf=Conf.get(player);
  if (player == null)   return;
  Map<Integer,Integer> potionEffectStrengths=null;
  if (this.vampire() && this.bloodlust()) {
    potionEffectStrengths=conf.potionEffectStrengthBloodlust;
  }
 else   if (this.vampire()) {
    potionEffectStrengths=conf.potionEffectStrengthVamp;
  }
 else {
    potionEffectStrengths=conf.potionEffectStrengthHuman;
  }
  boolean somethingEnabled=false;
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    Integer val=entry.getValue();
    if (val != null && val > 0) {
      somethingEnabled=true;
      break;
    }
  }
  if (somethingEnabled) {
    P.p.noCheatExemptedPlayerNames.add(player.getName());
  }
 else {
    P.p.noCheatExemptedPlayerNames.remove(player.getName());
  }
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    PotionEffectType pet=PotionEffectType.getById(entry.getKey());
    Integer strength=entry.getValue();
    player.removePotionEffect(pet);
    if (strength == null || strength < 1)     continue;
    PaketUtil.addPotionEffectNoGraphic(player,new PotionEffect(pet,100000,strength));
  }
}
Program: 2226
Project: 2226
Buggy source:
public void updateMovement(){
  Player player=this.getPlayer();
  Conf conf=Conf.get(player);
  if (player == null)   return;
  Map<Integer,Integer> potionEffectStrengths=null;
  if (this.vampire() && this.bloodlust()) {
    potionEffectStrengths=conf.potionEffectStrengthBloodlust;
  }
 else   if (this.vampire()) {
    potionEffectStrengths=conf.potionEffectStrengthVamp;
  }
 else {
    potionEffectStrengths=conf.potionEffectStrengthHuman;
  }
  boolean somethingEnabled=false;
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    Integer val=entry.getValue();
    if (val != null && val > 0) {
      somethingEnabled=true;
      break;
    }
  }
  if (somethingEnabled) {
    P.p.noCheatExemptedPlayerNames.add(player.getName());
  }
 else {
    P.p.noCheatExemptedPlayerNames.remove(player.getName());
  }
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    PotionEffectType pet=PotionEffectType.getById(entry.getKey());
    Integer strength=entry.getValue();
    player.removePotionEffect(pet);
    if (strength == null || strength < 1)     continue;
    PaketUtil.addPotionEffectNoGraphic(player,new PotionEffect(pet,100000,strength));
  }
}

Fixed version (ground truth):
public void updateMovement(){
  Player player=this.getPlayer();
  if (player == null)   return;
  Conf conf=Conf.get(player);
  Map<Integer,Integer> potionEffectStrengths=null;
  if (this.vampire() && this.bloodlust()) {
    potionEffectStrengths=conf.potionEffectStrengthBloodlust;
  }
 else   if (this.vampire()) {
    potionEffectStrengths=conf.potionEffectStrengthVamp;
  }
 else {
    potionEffectStrengths=conf.potionEffectStrengthHuman;
  }
  boolean somethingEnabled=false;
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    Integer val=entry.getValue();
    if (val != null && val > 0) {
      somethingEnabled=true;
      break;
    }
  }
  if (somethingEnabled) {
    P.p.noCheatExemptedPlayerNames.add(player.getName());
  }
 else {
    P.p.noCheatExemptedPlayerNames.remove(player.getName());
  }
  for (  Entry<Integer,Integer> entry : potionEffectStrengths.entrySet()) {
    PotionEffectType pet=PotionEffectType.getById(entry.getKey());
    Integer strength=entry.getValue();
    player.removePotionEffect(pet);
    if (strength == null || strength < 1)     continue;
    PaketUtil.addPotionEffectNoGraphic(player,new PotionEffect(pet,100000,strength));
  }
}
Program: 2227
Project: 2227
Buggy source:
@Override public void onEnable(){
  if (!preEnable())   return;
  VPlayers.i.loadOldFormat();
  this.cmdBase=new CmdBase();
  this.cmdBase.register();
  this.cmd.setArgHandler(VPlayer.class,AHVPlayer.getInstance());
  Bukkit.getScheduler().scheduleSyncRepeatingTask(this,new TheTask(),0,Conf.taskInterval);
  new TheListener(this);
  this.noCheatPlusSetup();
  BloodlustToggle.get().register();
  postEnable();
}

Fixed version (ground truth):
@Override public void onEnable(){
  if (!preEnable())   return;
  VPlayers.i.loadOldFormat();
  this.cmdBase=new CmdBase();
  this.cmdBase.register();
  this.cmd.setArgHandler(VPlayer.class,AHVPlayer.getInstance());
  Bukkit.getScheduler().scheduleSyncRepeatingTask(this,new TheTask(),0,Conf.taskInterval);
  new TheListener(this);
  this.noCheatPlusSetup();
  BloodlustToggle.get().register();
  Shriek.get().register();
  postEnable();
}
Program: 2228
Project: 2228
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void fxOnDeath(EntityDeathEvent event){
  VPlayer vplayer=VPlayers.i.get(event.getEntity());
  if (vplayer == null)   return;
  if (vplayer.vampire() == false)   return;
  vplayer.fxShriek();
  vplayer.fxFlameBurstRun();
  vplayer.fxSmokeBurstRun();
  vplayer.updateSpoutMovement();
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.NORMAL) public void fxOnDeath(EntityDeathEvent event){
  VPlayer vplayer=VPlayers.i.get(event.getEntity());
  if (vplayer == null)   return;
  if (vplayer.vampire() == false)   return;
  vplayer.fxShriekRun();
  vplayer.fxFlameBurstRun();
  vplayer.fxSmokeBurstRun();
}
Program: 2229
Project: 2229
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void updateOnRespawn(PlayerRespawnEvent event){
  Player player=event.getPlayer();
  VPlayer vampire=VPlayers.i.get(player);
  if (vampire == null)   return;
  if (!vampire.vampire())   return;
  vampire.bloodlust(false);
  vampire.rad(0);
  vampire.temp(0);
  player.setFoodLevel(Conf.updateRespawnFood);
  player.setHealth(Conf.updateRespawnHealth);
  PlayerUtil.sendHealthFoodUpdatePacket(player);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.NORMAL,ignoreCancelled=true) public void updateOnRespawn(PlayerRespawnEvent event){
  final VPlayer vplayer=VPlayers.i.get(event.getPlayer());
  if (vplayer == null)   return;
  if (!vplayer.vampire())   return;
  Bukkit.getScheduler().scheduleSyncDelayedTask(p,new Runnable(){
    @Override public void run(){
      Player player=vplayer.getPlayer();
      player.setFoodLevel(Conf.updateRespawnFood);
      player.setHealth(Conf.updateRespawnHealth);
      PlayerUtil.sendHealthFoodUpdatePacket(player);
      vplayer.updateSpoutMovement();
    }
  }
);
}
Program: 2230
Project: 2230
Buggy source:
public void bloodlust(boolean val){
  if (this.bloodlust == val) {
    this.msg(Lang.boolIsY("String_Node_Str",val));
    return;
  }
  if (val) {
    if (this.human()) {
      msg("String_Node_Str");
      return;
    }
    if (this.food().get() < Conf.bloodlustMinFood) {
      msg("String_Node_Str");
      return;
    }
    if (this.isGameMode(GameMode.CREATIVE,true)) {
      msg("String_Node_Str");
      return;
    }
  }
  this.bloodlust=val;
  this.msg(this.bloodlustMsg());
  this.updateSpoutMovement();
}

Fixed version (ground truth):
public void bloodlust(boolean val){
  if (this.bloodlust == val) {
    this.msg(Lang.boolIsY("String_Node_Str",val));
    return;
  }
  if (val) {
    if (!this.vampire()) {
      msg(Lang.onlyVampsCanX,"String_Node_Str");
      return;
    }
    if (this.food().get() < Conf.bloodlustMinFood) {
      msg("String_Node_Str");
      return;
    }
    if (this.isGameMode(GameMode.CREATIVE,true)) {
      msg("String_Node_Str");
      return;
    }
  }
  this.bloodlust=val;
  this.msg(this.bloodlustMsg());
  this.updateSpoutMovement();
}
Program: 2231
Project: 2231
Buggy source:
public void vampire(boolean val){
  this.infection=0;
  if (this.vampire == val)   return;
  this.vampire=val;
  this.save();
  if (this.vampire) {
    this.msg(Lang.vampireTrue);
    this.fxShriek();
    this.fxSmokeBurstRun();
    this.fxSmokeRun();
  }
 else {
    this.msg(Lang.vampireFalse);
    this.fxEnderRun();
    this.maker(null);
    this.reason(null);
    this.bloodlust(false);
    this.intend(false);
  }
  this.updateVampPermission();
  if (this.isGameMode(GameMode.CREATIVE,true))   return;
  this.updateSpoutMovement();
}

Fixed version (ground truth):
public void vampire(boolean val){
  this.infection=0;
  if (this.vampire == val)   return;
  this.vampire=val;
  this.save();
  if (this.vampire) {
    this.msg(Lang.vampireTrue);
    this.fxShriekRun();
    this.fxSmokeBurstRun();
    this.fxSmokeRun();
  }
 else {
    this.msg(Lang.vampireFalse);
    this.fxEnderRun();
    this.maker(null);
    this.reason(null);
    this.bloodlust(false);
    this.intend(false);
  }
  this.updateVampPermission();
  if (this.isGameMode(GameMode.CREATIVE,true))   return;
  this.updateSpoutMovement();
}
Program: 2232
Project: 2232
Buggy source:
public double combatInfectRisk(){
  if (this.intend())   return Conf.infectionRiskAtCloseCombatWithIntent;
  return Conf.infectionRiskAtCloseCombatWithoutIntent;
}

Fixed version (ground truth):
public double combatInfectRisk(){
  if (this.human())   return 0D;
  if (this.intend())   return Conf.infectionRiskAtCloseCombatWithIntent;
  return Conf.infectionRiskAtCloseCombatWithoutIntent;
}
Program: 2233
Project: 2233
Buggy source:
public CmdBase(){
  super();
  this.addAliases(Conf.baseCommandAliases);
  this.addSubCommand(HelpCommand.getInstance());
  this.addSubCommand(cmdShow);
  this.addSubCommand(cmdModeBloodlust);
  this.addSubCommand(cmdModeIntend);
  this.addSubCommand(cmdOffer);
  this.addSubCommand(cmdAccept);
  this.addSubCommand(cmdVersion);
  this.addSubCommand(cmdList);
  this.addSubCommand(cmdSet);
  this.setDesc("String_Node_Str");
}

Fixed version (ground truth):
public CmdBase(){
  super();
  this.addAliases(Conf.baseCommandAliases);
  this.addSubCommand(HelpCommand.getInstance());
  this.addSubCommand(cmdShow);
  this.addSubCommand(cmdModeBloodlust);
  this.addSubCommand(cmdModeIntend);
  this.addSubCommand(cmdOffer);
  this.addSubCommand(cmdAccept);
  this.addSubCommand(cmdShriek);
  this.addSubCommand(cmdVersion);
  this.addSubCommand(cmdList);
  this.addSubCommand(cmdSet);
  this.setDesc("String_Node_Str");
}
Program: 2234
Project: 2234
Buggy source:
@Override public void perform(){
  vme.fxShriek();
}

Fixed version (ground truth):
@Override public void perform(){
  vme.shriek();
}
Program: 2235
Project: 2235
Buggy source:
@Override public void pressed(KeyBindingEvent event,SpoutPlayer splayer,VPlayer vplayer){
  if (!Permission.SHRIEK.has(splayer,true))   return;
  vplayer.fxShriek();
}

Fixed version (ground truth):
@Override public void pressed(KeyBindingEvent event,SpoutPlayer splayer,VPlayer vplayer){
  if (!Permission.SHRIEK.has(splayer,true))   return;
  vplayer.shriek();
}
Program: 2236
Project: 2236
Buggy source:
@Override public void onEnable(){
  this.getDataFolder().mkdirs();
  Conf.load();
  if (Conf.regenBloodPerHealth < Conf.playerBloodQuality) {
    log("String_Node_Str");
  }
  VPlayer.load();
  timer.schedule(new VampireTask(),0,Conf.timerInterval);
  PluginManager pm=this.getServer().getPluginManager();
  pm.registerEvent(Event.Type.PLAYER_ITEM,this.playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DAMAGED,this.entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_TARGET,this.entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DEATH,this.entityListener,Event.Priority.Normal,this);
  log("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  this.getDataFolder().mkdirs();
  Conf.load();
  if (Conf.regenBloodPerHealth < Conf.playerBloodQuality) {
    log("String_Node_Str");
  }
  VPlayer.load();
  timer.schedule(new VampireTask(),0,Conf.timerInterval);
  PluginManager pm=this.getServer().getPluginManager();
  pm.registerEvent(Event.Type.PLAYER_ITEM,this.playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DAMAGED,this.entityListener,Event.Priority.High,this);
  pm.registerEvent(Event.Type.ENTITY_TARGET,this.entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DEATH,this.entityListener,Event.Priority.Normal,this);
  log("String_Node_Str");
}
Program: 2237
Project: 2237
Buggy source:
public static String getMaterialName(Material material){
  String ret=material.toString();
  ret=ret.replace('_',' ');
  ret=ret.toLowerCase();
  return ret.substring(0,1).toUpperCase() + ret.substring(1);
}

Fixed version (ground truth):
public static String getMaterialName(Material material){
  String ret=material.toString();
  ret=ret.replace('_',' ');
  ret=ret.toLowerCase();
  return ret;
}
Program: 2238
Project: 2238
Buggy source:
public void cure(){
  this.infectionSet(0);
  this.isVampire=false;
  this.sendMessage(Conf.cureMessages);
  Vampire.log(this.playername + "String_Node_Str");
  VPlayer.save();
}

Fixed version (ground truth):
public void cure(){
  this.isVampire=false;
  this.infectionSet(0);
  this.sendMessage(Conf.cureMessages);
  Vampire.log(this.playername + "String_Node_Str");
  VPlayer.save();
}
Program: 2239
Project: 2239
Buggy source:
public static Collection<VPlayer> findAll(){
  return VPlayer.VPlayers.values();
}

Fixed version (ground truth):
public static Collection<VPlayer> findAll(){
  findAllOnline();
  return VPlayer.VPlayers.values();
}
Program: 2240
Project: 2240
Buggy source:
public void infectionSet(double infection){
  if (this.infectionGet() <= 0 && infection > 0) {
    VPlayer.save();
  }
  this.infection=this.limitDouble(infection,0,100);
}

Fixed version (ground truth):
public void infectionSet(double infection){
  double previousinfection=this.infectionGet();
  this.infection=this.limitDouble(infection,0D,100D);
  if ((previousinfection != 0 && this.infection == 0) || (previousinfection == 0 && this.infection != 0)) {
    VPlayer.save();
  }
}
Program: 2241
Project: 2241
Buggy source:
public void turn(){
  this.isVampire=true;
  this.sendMessage(Conf.turnMessages);
  Vampire.log(this.playername + "String_Node_Str");
  VPlayer.save();
}

Fixed version (ground truth):
public void turn(){
  this.isVampire=true;
  this.infectionSet(0);
  this.sendMessage(Conf.turnMessages);
  Vampire.log(this.playername + "String_Node_Str");
  VPlayer.save();
}
Program: 2242
Project: 2242
Buggy source:
public void infectionHeal(double amount){
  if (this.isVampire()) {
    return;
  }
  double current=this.infectionGet();
  if (current == 0) {
    return;
  }
  current-=amount;
  if (current <= 0) {
    this.infectionSet(0);
    this.sendMessage(Conf.infectionMessageCured);
    return;
  }
  this.infectionSet(current);
  this.sendMessage(Conf.infectionMessageHeal);
}

Fixed version (ground truth):
public void infectionHeal(double amount){
  if (this.isVampire()) {
    return;
  }
  double current=this.infectionGet();
  if (current == 0D) {
    return;
  }
  current-=amount;
  if (current <= 0D) {
    this.infectionSet(0D);
    this.sendMessage(Conf.infectionMessageCured);
    return;
  }
  this.infectionSet(current);
  this.sendMessage(Conf.infectionMessageHeal);
}
Program: 2243
Project: 2243
Buggy source:
public boolean isInfected(){
  return this.infection > 0 && this.isVampire == false;
}

Fixed version (ground truth):
public boolean isInfected(){
  return this.infection > 0D && this.isVampire == false;
}
Program: 2244
Project: 2244
Buggy source:
@Override public void perform(){
  String playername=parameters.get(0);
  double amount=1.0;
  if (parameters.size() == 2) {
    amount=Double.parseDouble(parameters.get(1));
  }
  Player player=Vampire.instance.getServer().getPlayer(playername);
  if (player == null) {
    this.sendMessage("String_Node_Str");
    return;
  }
  VPlayer vplayer=VPlayer.get(player);
  vplayer.infectionSet(amount);
  this.sendMessage(player.getDisplayName() + "String_Node_Str" + amount);
}

Fixed version (ground truth):
@Override public void perform(){
  String playername=parameters.get(0);
  double amount=1.0;
  if (parameters.size() == 2) {
    amount=Double.parseDouble(parameters.get(1));
  }
  Player player=Vampire.instance.getServer().getPlayer(playername);
  if (player == null) {
    this.sendMessage("String_Node_Str");
    return;
  }
  VPlayer vplayer=VPlayer.get(player);
  vplayer.infectionSet(amount);
  this.sendMessage(player.getDisplayName() + "String_Node_Str" + vplayer.infectionGet());
}
Program: 2245
Project: 2245
Buggy source:
public static DataTypeDecl parseDataTypeDecl(AntlrToScribParser parser,CommonTree ct,AstFactory af){
  CommonTree tmp1=getSchemaChild(ct);
  String schema=AntlrSimpleName.getName(tmp1);
  CommonTree tmp2=getExtNameChild(ct);
  String extName=AntlrExtIdentifier.getName(tmp2);
  CommonTree tmp3=getExtNameChild(ct);
  String source=AntlrExtIdentifier.getName(tmp3);
  DataTypeNode alias=AntlrSimpleName.toDataTypeNameNode(getAliasChild(ct),af);
  return af.DataTypeDecl(ct,schema,extName,source,alias);
}

Fixed version (ground truth):
public static DataTypeDecl parseDataTypeDecl(AntlrToScribParser parser,CommonTree ct,AstFactory af){
  CommonTree tmp1=getSchemaChild(ct);
  String schema=AntlrSimpleName.getName(tmp1);
  CommonTree tmp2=getExtNameChild(ct);
  String extName=AntlrExtIdentifier.getName(tmp2);
  CommonTree tmp3=getSourceChild(ct);
  String source=AntlrExtIdentifier.getName(tmp3);
  DataTypeNode alias=AntlrSimpleName.toDataTypeNameNode(getAliasChild(ct),af);
  return af.DataTypeDecl(ct,schema,extName,source,alias);
}
Program: 2246
Project: 2246
Buggy source:
protected void runBody() throws ScribParserException, AntlrSourceException, CommandLineException {
  MainContext mc=newMainContext();
  Job job=mc.newJob();
  ScribbleException fail=null;
  try {
    doValidationTasks(job);
  }
 catch (  ScribbleException x) {
    fail=x;
  }
  try {
    doNonAttemptableOutputTasks(job);
  }
 catch (  ScribbleException x) {
    if (fail == null) {
      fail=x;
    }
  }
  if (fail != null) {
    throw fail;
  }
  doNonAttemptableOutputTasks(job);
}

Fixed version (ground truth):
protected void runBody() throws ScribParserException, AntlrSourceException, CommandLineException {
  MainContext mc=newMainContext();
  Job job=mc.newJob();
  ScribbleException fail=null;
  try {
    doValidationTasks(job);
  }
 catch (  ScribbleException x) {
    fail=x;
  }
  try {
    tryOutputTasks(job);
  }
 catch (  ScribbleException x) {
    if (fail == null) {
      fail=x;
    }
  }
  if (fail != null) {
    throw fail;
  }
  doNonAttemptableOutputTasks(job);
}
Program: 2249
Project: 2249
Buggy source:
@Override public void receive(Smtp_C_8 s8,betty16.lec2.smtp.Smtp.Smtp.ops._250 op,Buf<_250> arg) throws ScribbleRuntimeException, IOException, ClassNotFoundException {
  s8.send(S,new Quit());
}

Fixed version (ground truth):
@Override public void receive(Smtp_C_8 s8,betty16.lec2.smtp.Smtp.Smtp.ops._250 op,Buf<_250> arg) throws ScribbleRuntimeException, IOException, ClassNotFoundException {
  System.out.println("String_Node_Str" + arg.val.getBody());
  s8.send(S,new Quit());
}
Program: 2250
Project: 2250
Buggy source:
private void run(Smtp_C_1 c1) throws Exception {
  c1.async(S,_220).send(S,new Ehlo("String_Node_Str")).branch(S,new MySmtp_C_3Handler());
}

Fixed version (ground truth):
private void run(Smtp_C_1 c1) throws Exception {
  System.out.println("String_Node_Str");
  c1.async(S,_220).send(S,new Ehlo("String_Node_Str")).branch(S,new MySmtp_C_3Handler());
}
Program: 2251
Project: 2251
Buggy source:
public F17State build(Map<Role,F17LType> P0){
  F17State init=new F17State(P0);
  Set<F17State> todo=new HashSet<>();
  todo.add(init);
  while (!todo.isEmpty()) {
    Iterator<F17State> i=todo.iterator();
    F17State curr=i.next();
    i.remove();
    Map<Role,List<F17Action>> fireable=curr.getFireable();
    for (    Entry<Role,List<F17Action>> e : fireable.entrySet()) {
      Role r=e.getKey();
      List<F17Action> as=e.getValue();
      for (      F17Action a : as) {
        F17State next=curr.fire(r,a);
        if (!todo.contains(next) && !next.equals(curr)) {
          curr.addEdge(a,next);
          todo.add(next);
        }
      }
    }
  }
  return init;
}

Fixed version (ground truth):
public F17State build(Map<Role,F17LType> P0){
  F17State init=new F17State(P0);
  Set<F17State> todo=new HashSet<>();
  Set<F17State> seen=new HashSet<>();
  todo.add(init);
  while (!todo.isEmpty()) {
    Iterator<F17State> i=todo.iterator();
    F17State curr=i.next();
    i.remove();
    seen.add(curr);
    Map<Role,List<F17Action>> fireable=curr.getFireable();
    for (    Entry<Role,List<F17Action>> e : fireable.entrySet()) {
      Role r=e.getKey();
      List<F17Action> as=e.getValue();
      for (      F17Action a : as) {
        F17State tmp=curr.fire(r,a);
        F17State next=tmp;
        if (seen.contains(tmp)) {
          next=seen.stream().filter((s) -> s.equals(tmp)).iterator().next();
        }
        curr.addEdge(a,next);
        if (!todo.contains(next) && !seen.contains(next)) {
          todo.add(next);
        }
      }
    }
  }
  return init;
}
Program: 2252
Project: 2252
Buggy source:
public Map<Role,List<F17Action>> getFireable(){
  Map<Role,List<F17Action>> f=new HashMap<>();
  for (  Entry<Role,F17LType> P : this.P.entrySet()) {
    Role r=P.getKey();
    f.put(r,new LinkedList<>());
    F17LType lt=P.getValue();
    if (lt instanceof F17LChoice) {
      F17LChoice lc=(F17LChoice)lt;
      for (      Entry<F17LAction,F17LType> e : lc.cases.entrySet()) {
        F17LAction a=e.getKey();
        if (a instanceof F17LSend) {
          F17LSend ls=(F17LSend)a;
          if (this.Q.get(ls.peer) == null) {
            f.get(r).add(new F17Action(ls));
          }
        }
 else         if (a instanceof F17LReceive) {
          F17LReceive lr=(F17LReceive)a;
          F17LSend m=this.Q.get(lr.peer);
          if (m != null && m.toDual().equals(lr)) {
            f.get(r).add(new F17Action(lr));
          }
        }
 else {
          throw new RuntimeException("String_Node_Str" + a);
        }
      }
    }
 else     if (lt instanceof F17LEnd) {
    }
 else {
      throw new RuntimeException("String_Node_Str" + lt);
    }
  }
  return f;
}

Fixed version (ground truth):
public Map<Role,List<F17Action>> getFireable(){
  Map<Role,List<F17Action>> f=new HashMap<>();
  for (  Entry<Role,F17LType> P : this.P.entrySet()) {
    Role r=P.getKey();
    f.put(r,new LinkedList<>());
    F17LType lt=P.getValue();
    if (lt instanceof F17LChoice) {
      F17LChoice lc=(F17LChoice)lt;
      for (      Entry<F17LAction,F17LType> e : lc.cases.entrySet()) {
        F17LAction a=e.getKey();
        if (a instanceof F17LSend) {
          F17LSend ls=(F17LSend)a;
          if (this.Q.get(ls.peer) == null) {
            f.get(r).add(new F17Action(ls));
          }
        }
 else         if (a instanceof F17LReceive) {
          F17LReceive lr=(F17LReceive)a;
          F17LSend m=this.Q.get(lr.self);
          if (m != null && m.toDual().equals(lr)) {
            f.get(r).add(new F17Action(lr));
          }
        }
 else {
          throw new RuntimeException("String_Node_Str" + a);
        }
      }
    }
 else     if (lt instanceof F17LEnd) {
    }
 else {
      throw new RuntimeException("String_Node_Str" + lt);
    }
  }
  return f;
}
Program: 2253
Project: 2253
Buggy source:
public F17State fire(Role r,F17Action a){
  Map<Role,F17LType> P=new HashMap<>(this.P);
  Map<Role,F17LSend> Q=new HashMap<>(this.Q);
  F17LAction la=a.action;
  F17LType succ=((F17LChoice)P.get(r)).cases.get(la);
  if (succ instanceof F17LRec) {
    succ=((F17LRec)succ).unfold();
  }
  if (la instanceof F17LSend) {
    F17LSend ls=(F17LSend)la;
    P.put(r,succ);
    Q.put(ls.peer,null);
  }
 else   if (la instanceof F17LReceive) {
    F17LReceive lr=(F17LReceive)la;
    P.put(r,succ);
    Q.put(lr.peer,lr.toDual());
  }
 else {
    throw new RuntimeException("String_Node_Str" + a);
  }
  return new F17State(P,Q);
}

Fixed version (ground truth):
public F17State fire(Role r,F17Action a){
  Map<Role,F17LType> P=new HashMap<>(this.P);
  Map<Role,F17LSend> Q=new HashMap<>(this.Q);
  F17LAction la=a.action;
  F17LType succ=((F17LChoice)P.get(r)).cases.get(la);
  if (succ instanceof F17LRec) {
    succ=((F17LRec)succ).unfold();
  }
  if (la instanceof F17LSend) {
    F17LSend ls=(F17LSend)la;
    P.put(r,succ);
    Q.put(ls.peer,ls);
  }
 else   if (la instanceof F17LReceive) {
    F17LReceive lr=(F17LReceive)la;
    P.put(r,succ);
    Q.put(lr.self,null);
  }
 else {
    throw new RuntimeException("String_Node_Str" + a);
  }
  return new F17State(P,Q);
}
Program: 2254
Project: 2254
Buggy source:
public boolean isEmpty(){
  return this.stuck.isEmpty() && this.waitFor.isEmpty() && this.orphans.isEmpty();
}

Fixed version (ground truth):
public boolean isEmpty(){
  return this.stuck.isEmpty() && this.waitFor.isEmpty() && this.orphans.isEmpty()&& this.unfinished.isEmpty();
}
Program: 2255
Project: 2255
Buggy source:
@Test public final void tests() throws IOException, InterruptedException, ExecutionException {
  try {
    String dir=ClassLoader.getSystemResource(AllTest.ALL_ROOT).getFile();
    if (File.separator.equals("String_Node_Str")) {
      dir=dir.substring(1).replace("String_Node_Str","String_Node_Str");
    }
    new CommandLine(this.example,CommandLineArgParser.JUNIT_FLAG,CommandLineArgParser.IMPORT_PATH_FLAG,dir).run();
    Assert.assertFalse("String_Node_Str",this.isBadTest);
  }
 catch (  ScribbleException e) {
    Assert.assertTrue("String_Node_Str" + e.getMessage() + "String_Node_Str",this.isBadTest);
  }
catch (  ScribParserException|CommandLineException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Test public void tests() throws IOException, InterruptedException, ExecutionException {
  try {
    String dir=ClassLoader.getSystemResource(AllTest.ALL_ROOT).getFile();
    if (File.separator.equals("String_Node_Str")) {
      dir=dir.substring(1).replace("String_Node_Str","String_Node_Str");
    }
    new CommandLine(this.example,CommandLineArgParser.JUNIT_FLAG,CommandLineArgParser.IMPORT_PATH_FLAG,dir).run();
    Assert.assertFalse("String_Node_Str",this.isBadTest);
  }
 catch (  ScribbleException e) {
    Assert.assertTrue("String_Node_Str" + e.getMessage() + "String_Node_Str",this.isBadTest);
  }
catch (  ScribParserException|CommandLineException e) {
    throw new RuntimeException(e);
  }
}
Program: 2256
Project: 2256
Buggy source:
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  return Harness.checkTestDirProperty(AllTest.BAD_TEST,BAD_ROOT);
}

Fixed version (ground truth):
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  String dir_good=ClassLoader.getSystemResource(GoodTest.GOOD_ROOT).getFile();
  String dir_bad=ClassLoader.getSystemResource(BadTest.BAD_ROOT).getFile();
  List<Object[]> result=new LinkedList<>();
  result.addAll(Harness.makeTests(GOOD_TEST,dir_good));
  result.addAll(Harness.makeTests(BAD_TEST,dir_bad));
  return result;
}
Program: 2257
Project: 2257
Buggy source:
private static List<File> getAllScrFilesUnderDirectory(String path){
  List<File> res=new LinkedList<>();
  for (  File f : new File(path).listFiles()) {
    if (f.isFile()) {
      if (f.getName().equals(DIR_IGNORE_FILE)) {
        return Collections.emptyList();
      }
 else       if (f.getName().endsWith(SCRIBBLE_EXT)) {
        res.add(f);
      }
    }
 else     if (f.isDirectory()) {
      res.addAll(getAllScrFilesUnderDirectory(f.getAbsolutePath()));
    }
  }
  return res;
}

Fixed version (ground truth):
private static List<File> getAllScrFilesUnderDirectory(String path){
  List<File> res=new LinkedList<>();
  for (  File f : new File(path).listFiles()) {
    if (f.isFile()) {
      if (f.getName().equals(Harness.DIR_IGNORE_FILE)) {
        return Collections.emptyList();
      }
 else       if (f.getName().endsWith(Harness.SCRIBBLE_EXT)) {
        res.add(f);
      }
    }
 else     if (f.isDirectory()) {
      res.addAll(getAllScrFilesUnderDirectory(f.getAbsolutePath()));
    }
  }
  return res;
}
Program: 2258
Project: 2258
Buggy source:
/** 
 * Returns all Scribble files in a given directory.
 * @param dir
 * @return
 */
private static Collection<String> getScribbleFilePaths(String dir){
  return getAllScrFilesUnderDirectory(dir).stream().map((f) -> f.getAbsolutePath().toString()).collect(Collectors.toList());
}

Fixed version (ground truth):
/** 
 * Returns all Scribble files in a given directory.
 * @param dir
 * @return
 */
private static Collection<String> getScribbleFilePaths(String dir){
  List<String> res=new LinkedList<>();
  for (  File f : getAllScrFilesUnderDirectory(dir)) {
    res.add(f.getAbsolutePath().toString());
  }
  return res;
}
Program: 2259
Project: 2259
Buggy source:
public static Collection<Object[]> checkTestDirProperty(boolean isBadTest,String root){
  String dir=System.getProperty(TEST_DIR_FLAG);
  if (dir == null) {
    dir=ClassLoader.getSystemResource(root).getFile();
  }
  return makeTests(isBadTest,dir);
}

Fixed version (ground truth):
public static Collection<Object[]> checkTestDirProperty(boolean isBadTest,String root){
  String dir=System.getProperty(Harness.TEST_DIR_FLAG);
  if (dir == null) {
    dir=ClassLoader.getSystemResource(root).getFile();
  }
  return makeTests(isBadTest,dir);
}
Program: 2260
Project: 2260
Buggy source:
public static Collection<Object[]> makeTests(boolean isBadTest,String dir){
  return findTests(dir).stream().map((e) -> new Object[]{e,isBadTest}).collect(Collectors.toList());
}

Fixed version (ground truth):
public static Collection<Object[]> makeTests(boolean isBadTest,String dir){
  List<Object[]> res=new LinkedList<>();
  for (  String t : findTests(dir)) {
    res.add(new Object[]{t,isBadTest});
  }
  return res;
}
Program: 2262
Project: 2262
Buggy source:
public ExplicitCorrelationEnv disableAccept(){
  ExplicitCorrelationEnv copy=copy();
  copy.canAccept=false;
  return copy;
}

Fixed version (ground truth):
public ExplicitCorrelationEnv disableAccept(){
  if (!this.canAccept) {
    return this;
  }
  ExplicitCorrelationEnv copy=copy();
  copy.canAccept=false;
  return copy;
}