nus-yam/ex-repair huggingface dataset:
Program: 187618
Project: 187618
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyVillager)myPet).isBaby=flag;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,new Integer(-24000));
  }
 else {
    this.datawatcher.watch(12,new Integer(0));
  }
  ((MyVillager)myPet).isBaby=flag;
}
Program: 187619
Project: 187619
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyWolf)myPet).isBaby=flag;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,new Integer(-24000));
  }
 else {
    this.datawatcher.watch(12,new Integer(0));
  }
  ((MyWolf)myPet).isBaby=flag;
}
Program: 187620
Project: 187620
Buggy source:
public static void loadSkillTrees(){
  YamlConfiguration MWConfig;
  MyPetUtil.getDebugLogger().info("String_Node_Str" + configPath);
  File skillFile;
  skillFile=new File(configPath + File.separator + "String_Node_Str");
  MyPetSkillTreeMobType skillTreeMobType=new MyPetSkillTreeMobType("String_Node_Str");
  skillTreeMobTypes.put("String_Node_Str",skillTreeMobType);
  if (skillFile.exists()) {
    MWConfig=new YamlConfiguration(skillFile);
    loadSkillTree(MWConfig,skillTreeMobType);
    MyPetUtil.getDebugLogger().info("String_Node_Str");
  }
  for (  MyPetType mobType : MyPetType.values()) {
    skillFile=new File(configPath + File.separator + mobType.getTypeName()+ "String_Node_Str");
    skillTreeMobType=new MyPetSkillTreeMobType(mobType.getTypeName().toLowerCase());
    skillTreeMobTypes.put(mobType.getTypeName().toLowerCase(),skillTreeMobType);
    if (!skillFile.exists()) {
      continue;
    }
    MWConfig=new YamlConfiguration(skillFile);
    loadSkillTree(MWConfig,skillTreeMobType);
    MyPetUtil.getDebugLogger().info("String_Node_Str" + mobType.getTypeName().toLowerCase() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public static void loadSkillTrees(){
  YamlConfiguration MWConfig;
  MyPetUtil.getDebugLogger().info("String_Node_Str" + configPath);
  File skillFile;
  skillFile=new File(configPath + File.separator + "String_Node_Str");
  MyPetSkillTreeMobType skillTreeMobType=new MyPetSkillTreeMobType("String_Node_Str");
  skillTreeMobTypes.put("String_Node_Str",skillTreeMobType);
  if (skillFile.exists()) {
    MWConfig=new YamlConfiguration(skillFile);
    loadSkillTree(MWConfig,skillTreeMobType);
    MyPetUtil.getDebugLogger().info("String_Node_Str");
  }
  for (  MyPetType mobType : MyPetType.values()) {
    skillFile=new File(configPath + File.separator + mobType.getTypeName()+ "String_Node_Str");
    skillTreeMobType=new MyPetSkillTreeMobType(mobType.getTypeName().toLowerCase());
    skillTreeMobTypes.put(mobType.getTypeName().toLowerCase(),skillTreeMobType);
    if (!skillFile.exists()) {
      if (!skillTreeMobType.getMobTypeName().equals("String_Node_Str")) {
        addDefault(skillTreeMobType);
      }
      manageInheritance(skillTreeMobType);
      continue;
    }
    MWConfig=new YamlConfiguration(skillFile);
    loadSkillTree(MWConfig,skillTreeMobType);
    MyPetUtil.getDebugLogger().info("String_Node_Str" + mobType.getTypeName().toLowerCase() + "String_Node_Str");
  }
}
Program: 187623
Project: 187623
Buggy source:
protected void a(){
  super.a();
  this.datawatcher.a(16,(byte)1);
}

Fixed version (ground truth):
protected void a(){
  super.a();
  this.datawatcher.a(16,new Byte((byte)1));
}
Program: 187624
Project: 187624
Buggy source:
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageResult(EntityDamageEvent event){
  if (event.getEntity() instanceof CraftMyEnderman) {
    MyEnderman myEnderman=(MyEnderman)((CraftMyEnderman)event.getEntity()).getMyPet();
    ((EntityMyEnderman)myEnderman.getCraftPet().getHandle()).setScreaming(true);
    ((EntityMyEnderman)myEnderman.getCraftPet().getHandle()).setScreaming(false);
  }
  if (!(event instanceof EntityDamageByEntityEvent) || event.isCancelled()) {
    return;
  }
  EntityDamageByEntityEvent e=(EntityDamageByEntityEvent)event;
  if (event.getEntity() instanceof LivingEntity) {
    if (e.getDamager() instanceof Player) {
      Player damager=(Player)e.getDamager();
      if (MyPetList.hasMyPet(damager)) {
        MyPet myPet=MyPetList.getMyPet(damager);
        if (myPet.status == PetState.Here && event.getEntity() != myPet.getCraftPet()) {
          myPet.getCraftPet().getHandle().goalTarget=((CraftLivingEntity)event.getEntity()).getHandle();
        }
      }
 else       if (e.getDamager() instanceof CraftMyPet) {
        MyPet myPet=((CraftMyPet)e.getDamager()).getHandle().getMyPet();
        if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
          Poison poisonSkill=(Poison)myPet.getSkillSystem().getSkill("String_Node_Str");
          if (poisonSkill.getPoison()) {
            PotionEffect effect=new PotionEffect(PotionEffectType.POISON,5,1);
            ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageResult(EntityDamageEvent event){
  if (event.getEntity() instanceof CraftMyEnderman) {
    MyEnderman myEnderman=(MyEnderman)((CraftMyEnderman)event.getEntity()).getMyPet();
    ((EntityMyEnderman)myEnderman.getCraftPet().getHandle()).setScreaming(true);
    ((EntityMyEnderman)myEnderman.getCraftPet().getHandle()).setScreaming(false);
  }
  if (!(event instanceof EntityDamageByEntityEvent) || event.isCancelled()) {
    return;
  }
  EntityDamageByEntityEvent e=(EntityDamageByEntityEvent)event;
  if (event.getEntity() instanceof LivingEntity) {
    if (e.getDamager() instanceof Player) {
      Player damager=(Player)e.getDamager();
      if (MyPetList.hasMyPet(damager)) {
        MyPet myPet=MyPetList.getMyPet(damager);
        if (myPet.status == PetState.Here && event.getEntity() != myPet.getCraftPet()) {
          myPet.getCraftPet().getHandle().goalTarget=((CraftLivingEntity)event.getEntity()).getHandle();
        }
      }
    }
 else     if (e.getDamager() instanceof CraftMyPet) {
      MyPet myPet=((CraftMyPet)e.getDamager()).getHandle().getMyPet();
      if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
        Poison poisonSkill=(Poison)myPet.getSkillSystem().getSkill("String_Node_Str");
        if (poisonSkill.getPoison()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.POISON,5,1);
          ((LivingEntity)event.getEntity()).addPotionEffect(effect);
        }
      }
    }
  }
}
Program: 187625
Project: 187625
Buggy source:
public boolean createPet(Location loc){
  if (status != PetState.Here && getOwner().isOnline()) {
    if (respawnTime <= 0) {
      this.petLocation=loc;
      net.minecraft.server.World mcWorld=((CraftWorld)loc.getWorld()).getHandle();
      EntityMyPet petEntity=getPetType().getNewEntityInstance(mcWorld,this);
      petEntity.setLocation(loc);
      if (!petLocation.getChunk().isLoaded()) {
        petLocation.getChunk().load();
      }
      if (!mcWorld.addEntity(petEntity,CreatureSpawnEvent.SpawnReason.CUSTOM)) {
        return false;
      }
      craftMyPet=(CraftMyPet)petEntity.getBukkitEntity();
      status=PetState.Here;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean createPet(Location loc){
  if (status != PetState.Here && getOwner().isOnline()) {
    if (respawnTime <= 0) {
      this.petLocation=loc;
      net.minecraft.server.World mcWorld=((CraftWorld)loc.getWorld()).getHandle();
      EntityMyPet petEntity=getPetType().getNewEntityInstance(mcWorld,this);
      petEntity.setLocation(loc);
      if (!petLocation.getChunk().isLoaded()) {
        petLocation.getChunk().load();
      }
      if (!mcWorld.addEntity(petEntity,CreatureSpawnEvent.SpawnReason.CUSTOM)) {
        status=PetState.Despawned;
        return false;
      }
      craftMyPet=(CraftMyPet)petEntity.getBukkitEntity();
      status=PetState.Here;
      return true;
    }
  }
  return false;
}
Program: 187627
Project: 187627
Buggy source:
public void setMoveTo(Location loc){
  moveTo=loc;
}

Fixed version (ground truth):
public void setMoveTo(Location loc){
  if (prevMoveTo != null) {
    if (MyPetUtil.getDistance2D(loc,prevMoveTo) > 1) {
      moveTo=loc;
      prevMoveTo=loc;
    }
  }
 else {
    moveTo=loc;
  }
}
Program: 187629
Project: 187629
Buggy source:
/** 
 * Checks whether this pathfinder should be activated
 */
public boolean a(){
  if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
    Behavior behavior=(Behavior)myPet.getSkillSystem().getSkill("String_Node_Str");
    if (behavior.getLevel() > 0) {
      if (behavior.getBehavior() == Behavior.BehaviorState.Friendly) {
        return false;
      }
 else       if (behavior.getBehavior() == Behavior.BehaviorState.Aggressive && myPet.getPet().canMove()) {
        if (target == null || !target.isAlive()) {
          for (float range=1.F; range <= this.range; range++) {
            for (            Object entityObj : this.petEntity.world.a(EntityLiving.class,this.petEntity.boundingBox.grow((double)range,4.0D,(double)range))) {
              Entity entity=(Entity)entityObj;
              EntityLiving entityLiving=(EntityLiving)entity;
              if (petEntity.az().canSee(entityLiving) && entityLiving != petEntity) {
                if (entityLiving instanceof EntityPlayer) {
                  Player targetPlayer=(Player)entityLiving.getBukkitEntity();
                  if (myPet.getOwner().equals(targetPlayer)) {
                    continue;
                  }
                  if (!MyPetUtil.canHurt(myPet.getOwner().getPlayer(),targetPlayer)) {
                    continue;
                  }
                }
                this.target=entityLiving;
                return true;
              }
            }
          }
          return false;
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether this pathfinder should be activated
 */
public boolean a(){
  if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
    Behavior behavior=(Behavior)myPet.getSkillSystem().getSkill("String_Node_Str");
    if (behavior.getLevel() > 0) {
      if (behavior.getBehavior() == Behavior.BehaviorState.Friendly) {
        return false;
      }
 else       if (behavior.getBehavior() == Behavior.BehaviorState.Aggressive && myPet.getPet().canMove()) {
        if (target == null || !target.isAlive()) {
          for (float range=1.F; range <= this.range; range++) {
            for (            Object entityObj : this.petEntity.world.a(EntityLiving.class,this.petEntity.boundingBox.grow((double)range,4.0D,(double)range))) {
              Entity entity=(Entity)entityObj;
              EntityLiving entityLiving=(EntityLiving)entity;
              if (petEntity.aA().canSee(entityLiving) && entityLiving != petEntity) {
                if (entityLiving instanceof EntityPlayer) {
                  Player targetPlayer=(Player)entityLiving.getBukkitEntity();
                  if (myPet.getOwner().equals(targetPlayer)) {
                    continue;
                  }
                  if (!MyPetUtil.canHurt(myPet.getOwner().getPlayer(),targetPlayer)) {
                    continue;
                  }
                }
                this.target=entityLiving;
                return true;
              }
            }
          }
          return false;
        }
        return true;
      }
    }
  }
  return false;
}
Program: 187630
Project: 187630
Buggy source:
/** 
 * Checks whether this pathfinder should be activated
 */
public boolean a(){
  if (controlPathfinderGoal.moveTo != null && petEntity.canMove()) {
    if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
      Behavior behaviorSkill=(Behavior)myPet.getSkillSystem().getSkill("String_Node_Str");
      if (behaviorSkill.getLevel() > 0) {
        if (behaviorSkill.getBehavior() == Behavior.BehaviorState.Friendly) {
          return false;
        }
      }
    }
    for (    Object entityObj : this.petEntity.world.a(EntityLiving.class,this.petEntity.boundingBox.grow((double)this.range,4.0D,(double)this.range))) {
      Entity entity=(Entity)entityObj;
      EntityLiving entityLiving=(EntityLiving)entity;
      if (petEntity.az().canSee(entityLiving) && entityLiving != petEntity) {
        if (entityLiving instanceof EntityPlayer) {
          Player targetPlayer=(Player)entityLiving.getBukkitEntity();
          if (myPet.getOwner().equals(targetPlayer)) {
            continue;
          }
          if (!MyPetUtil.canHurt(myPet.getOwner().getPlayer(),targetPlayer)) {
            continue;
          }
        }
        controlPathfinderGoal.stopControl();
        this.target=entityLiving;
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether this pathfinder should be activated
 */
public boolean a(){
  if (controlPathfinderGoal.moveTo != null && petEntity.canMove()) {
    if (myPet.getSkillSystem().hasSkill("String_Node_Str")) {
      Behavior behaviorSkill=(Behavior)myPet.getSkillSystem().getSkill("String_Node_Str");
      if (behaviorSkill.getLevel() > 0) {
        if (behaviorSkill.getBehavior() == Behavior.BehaviorState.Friendly) {
          return false;
        }
      }
    }
    for (    Object entityObj : this.petEntity.world.a(EntityLiving.class,this.petEntity.boundingBox.grow((double)this.range,4.0D,(double)this.range))) {
      Entity entity=(Entity)entityObj;
      EntityLiving entityLiving=(EntityLiving)entity;
      if (petEntity.aA().canSee(entityLiving) && entityLiving != petEntity) {
        if (entityLiving instanceof EntityPlayer) {
          Player targetPlayer=(Player)entityLiving.getBukkitEntity();
          if (myPet.getOwner().equals(targetPlayer)) {
            continue;
          }
          if (!MyPetUtil.canHurt(myPet.getOwner().getPlayer(),targetPlayer)) {
            continue;
          }
        }
        controlPathfinderGoal.stopControl();
        this.target=entityLiving;
        return true;
      }
    }
  }
  return false;
}
Program: 187631
Project: 187631
Buggy source:
public void c(){
  this.petOwner=null;
  this.nav.f();
  this.nav.a(this.i);
}

Fixed version (ground truth):
public void c(){
  this.h=0;
  this.i=this.nav.a();
  this.nav.a(false);
}
Program: 187632
Project: 187632
Buggy source:
public void d(){
  this.petEntity.getControllerLook().a(this.petOwner,10.0F,(float)this.petEntity.bm());
  if (this.petEntity.canMove()) {
    if (--this.h <= 0) {
      this.h=10;
      if (!this.nav.a(this.petOwner,this.f)) {
        if (this.petEntity.e(this.petOwner) >= 144.0D && controlPathfinderGoal.moveTo == null && petEntity.goalTarget == null) {
          int i=MathHelper.floor(this.petOwner.locX) - 2;
          int j=MathHelper.floor(this.petOwner.locZ) - 2;
          int k=MathHelper.floor(this.petOwner.boundingBox.b);
          for (int l=0; l <= 4; ++l) {
            for (int i1=0; i1 <= 4; ++i1) {
              if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.world.t(i + l,k - 1,j + i1) && !this.world.t(i + l,k,j + i1)&& !this.world.t(i + l,k + 1,j + i1)) {
                this.petEntity.setPositionRotation((double)((float)(i + l) + 0.5F),(double)k,(double)((float)(j + i1) + 0.5F),this.petEntity.yaw,this.petEntity.pitch);
                this.nav.f();
                return;
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void d(){
  this.petOwner=null;
  this.nav.f();
  this.nav.a(this.i);
}
Program: 187633
Project: 187633
Buggy source:
public void e(){
  this.h=0;
  this.i=this.nav.a();
  this.nav.a(false);
}

Fixed version (ground truth):
public void e(){
  this.petEntity.getControllerLook().a(this.petOwner,10.0F,(float)this.petEntity.bp());
  if (this.petEntity.canMove()) {
    if (--this.h <= 0) {
      this.h=10;
      if (!this.nav.a(this.petOwner,this.f)) {
        if (this.petEntity.e(this.petOwner) >= 144.0D && controlPathfinderGoal.moveTo == null && petEntity.goalTarget == null) {
          int i=MathHelper.floor(this.petOwner.locX) - 2;
          int j=MathHelper.floor(this.petOwner.locZ) - 2;
          int k=MathHelper.floor(this.petOwner.boundingBox.b);
          for (int l=0; l <= 4; ++l) {
            for (int i1=0; i1 <= 4; ++i1) {
              if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.world.t(i + l,k - 1,j + i1) && !this.world.t(i + l,k,j + i1)&& !this.world.t(i + l,k + 1,j + i1)) {
                this.petEntity.setPositionRotation((double)((float)(i + l) + 0.5F),(double)k,(double)((float)(j + i1) + 0.5F),this.petEntity.yaw,this.petEntity.pitch);
                this.nav.f();
                return;
              }
            }
          }
        }
      }
    }
  }
}
Program: 187634
Project: 187634
Buggy source:
public boolean a(){
  EntityLiving localEntityLiving=this.entityMyPet.getOwner();
  if (localEntityLiving == null) {
    return false;
  }
  this.b=localEntityLiving.aB();
  return a(this.b,false);
}

Fixed version (ground truth):
public boolean a(){
  EntityLiving localEntityLiving=this.entityMyPet.getOwner();
  if (localEntityLiving == null) {
    return false;
  }
  this.b=localEntityLiving.aC();
  return a(this.b,false);
}
Program: 187635
Project: 187635
Buggy source:
protected void a(){
  super.a();
  this.datawatcher.a(16,(byte)0);
}

Fixed version (ground truth):
protected void a(){
  super.a();
  this.datawatcher.a(16,new Byte((byte)0));
}
Program: 187636
Project: 187636
Buggy source:
protected void a(){
  super.a();
  this.datawatcher.a(12,0);
}

Fixed version (ground truth):
protected void a(){
  super.a();
  this.datawatcher.a(12,new Integer(0));
}
Program: 187637
Project: 187637
Buggy source:
protected void a(){
  super.a();
  this.datawatcher.a(16,(byte)0);
  this.datawatcher.a(18,(byte)0);
  this.datawatcher.a(12,0);
}

Fixed version (ground truth):
protected void a(){
  super.a();
  this.datawatcher.a(12,new Integer(0));
  this.datawatcher.a(16,new Byte((byte)0));
  this.datawatcher.a(18,new Byte((byte)0));
}
Program: 187638
Project: 187638
Buggy source:
protected void a(){
  super.a();
  this.datawatcher.a(16,0);
  this.datawatcher.a(12,0);
}

Fixed version (ground truth):
protected void a(){
  super.a();
  this.datawatcher.a(16,new Integer(0));
  this.datawatcher.a(12,new Integer(0));
}
Program: 187640
Project: 187640
Buggy source:
public NBTConfiguration(File f){
  NBTFile=f;
  if (!NBTFile.exists()) {
    try {
      NBTFile.createNewFile();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public NBTConfiguration(File f){
  NBTFile=f;
  if (!NBTFile.exists()) {
    try {
      NBTFile.createNewFile();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  f.setWritable(true);
  f.setReadable(true);
}
Program: 187641
Project: 187641
Buggy source:
public YamlConfiguration(File f){
  ConfigFile=f;
  Config=new org.bukkit.configuration.file.YamlConfiguration();
  try {
    Config.load(ConfigFile);
  }
 catch (  Exception ignored) {
  }
}

Fixed version (ground truth):
public YamlConfiguration(File f){
  ConfigFile=f;
  Config=new org.bukkit.configuration.file.YamlConfiguration();
  try {
    Config.load(ConfigFile);
  }
 catch (  Exception ignored) {
  }
  f.setWritable(true);
  f.setReadable(true);
}
Program: 187647
Project: 187647
Buggy source:
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    String playerName=sender.getName();
    if (args != null && args.length > 0) {
      playerName=args[0];
    }
    if (MyPetList.hasMyPet(MyPetUtil.getOfflinePlayer(playerName))) {
      MyPet MPet=MyPetList.getMyPet(MyPetUtil.getOfflinePlayer(playerName));
      player.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",MPet.skillTree.getName()));
      Collection<MyPetGenericSkill> skills=MPet.getSkillSystem().getSkills();
      if (skills.size() > 0) {
        for (        MyPetGenericSkill skill : skills) {
          if (skill.getLevel() > 0) {
            player.sendMessage(MyPetUtil.setColors("String_Node_Str").replace("String_Node_Str",skill.getName()).replace("String_Node_Str","String_Node_Str" + skill.getLevel()));
          }
        }
      }
      return true;
    }
 else {
      if (args != null && args.length > 0) {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str").replace("String_Node_Str",playerName)));
      }
 else {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    String playerName=sender.getName();
    if (args != null && args.length > 0) {
      playerName=args[0];
    }
    if (MyPetList.hasMyPet(MyPetUtil.getOfflinePlayer(playerName))) {
      MyPet MPet=MyPetList.getMyPet(MyPetUtil.getOfflinePlayer(playerName));
      player.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",MPet.getSkillTree().getName()));
      Collection<MyPetGenericSkill> skills=MPet.getSkillSystem().getSkills();
      if (skills.size() > 0) {
        for (        MyPetGenericSkill skill : skills) {
          if (skill.getLevel() > 0) {
            player.sendMessage(MyPetUtil.setColors("String_Node_Str").replace("String_Node_Str",skill.getName()).replace("String_Node_Str","String_Node_Str" + skill.getLevel()));
          }
        }
      }
      return true;
    }
 else {
      if (args != null && args.length > 0) {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str").replace("String_Node_Str",playerName)));
      }
 else {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
      }
    }
  }
  return true;
}
Program: 187648
Project: 187648
Buggy source:
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (sender instanceof Player) {
    Player owner=(Player)sender;
    if (MyPetList.hasMyPet(owner)) {
      MyPet MPet=MyPetList.getMyPet(owner);
      if (!MyPetPermissions.has(owner,"String_Node_Str")) {
        return true;
      }
      if (MPet.Status == PetState.Despawned) {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
        return true;
      }
      sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name));
      MPet.Pet.getHandle().setTarget(null);
      MPet.Pet.getHandle().b((EntityLiving)null);
      MPet.Pet.getHandle().Goaltarget=null;
      return true;
    }
 else {
      sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (sender instanceof Player) {
    Player owner=(Player)sender;
    if (MyPetList.hasMyPet(owner)) {
      MyPet MPet=MyPetList.getMyPet(owner);
      if (!MyPetPermissions.has(owner,"String_Node_Str")) {
        return true;
      }
      if (MPet.Status == PetState.Despawned) {
        sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
        return true;
      }
      sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name));
      MPet.getPet().getHandle().setTarget(null);
      MPet.getPet().getHandle().b((EntityLiving)null);
      MPet.getPet().getHandle().Goaltarget=null;
      return true;
    }
 else {
      sender.sendMessage(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
    }
  }
  return true;
}
Program: 187649
Project: 187649
Buggy source:
public PathfinderGoalAggressiveTarget(MyPet MPet,float range){
  super(MPet.Pet.getHandle(),32.0F,false);
  this.pet=MPet.Pet.getHandle();
  this.MPet=MPet;
  this.range=range;
}

Fixed version (ground truth):
public PathfinderGoalAggressiveTarget(MyPet MPet,float range){
  super(MPet.getPet().getHandle(),32.0F,false);
  this.pet=MPet.getPet().getHandle();
  this.MPet=MPet;
  this.range=range;
}
Program: 187650
Project: 187650
Buggy source:
public boolean b(){
  Control control=(Control)MPet.getSkillSystem().getSkill("String_Node_Str");
  if (control.getLocation(false) != null) {
    moveTo=control.getLocation();
    TimeToMove=(int)MyPetUtil.getDistance(MPet.getLocation(),moveTo) / 3;
    if (!nav.a(this.moveTo.getX(),this.moveTo.getY(),this.moveTo.getZ(),this.speed)) {
      moveTo=null;
    }
  }
  return moveTo != null && !this.MPet.Pet.isSitting();
}

Fixed version (ground truth):
public boolean b(){
  Control control=(Control)MPet.getSkillSystem().getSkill("String_Node_Str");
  if (control.getLocation(false) != null) {
    moveTo=control.getLocation();
    TimeToMove=(int)MyPetUtil.getDistance(MPet.getLocation(),moveTo) / 3;
    if (!nav.a(this.moveTo.getX(),this.moveTo.getY(),this.moveTo.getZ(),this.speed)) {
      moveTo=null;
    }
  }
  return moveTo != null && !this.MPet.isSitting();
}
Program: 187651
Project: 187651
Buggy source:
public PathfinderGoalControl(MyPet MPet,float f){
  this.MPet=MPet;
  speed=f;
  nav=this.MPet.Pet.getHandle().al();
}

Fixed version (ground truth):
public PathfinderGoalControl(MyPet MPet,float f){
  this.MPet=MPet;
  speed=f;
  nav=this.MPet.getPet().getHandle().al();
}
Program: 187652
Project: 187652
Buggy source:
public PathfinderGoalControlTarget(MyPet MPet,PathfinderGoalControl control,float range){
  super(MPet.Pet.getHandle(),32.0F,false);
  this.pet=MPet.Pet.getHandle();
  this.MPet=MPet;
  this.range=range;
  this.control=control;
}

Fixed version (ground truth):
public PathfinderGoalControlTarget(MyPet MPet,PathfinderGoalControl control,float range){
  super(MPet.getPet().getHandle(),32.0F,false);
  this.pet=MPet.getPet().getHandle();
  this.MPet=MPet;
  this.range=range;
  this.control=control;
}
Program: 187653
Project: 187653
Buggy source:
public PathfinderGoalOwnerHurtTarget(MyPet MPet){
  super(MPet.Pet.getHandle(),32.0F,false);
  this.pet=MPet.Pet.getHandle();
  this.MPet=MPet;
  this.a(1);
}

Fixed version (ground truth):
public PathfinderGoalOwnerHurtTarget(MyPet MPet){
  super(MPet.getPet().getHandle(),32.0F,false);
  this.pet=MPet.getPet().getHandle();
  this.MPet=MPet;
  this.a(1);
}
Program: 187654
Project: 187654
Buggy source:
public void createPet(){
  if (Status == PetState.Here || getOwner() == null) {
  }
 else {
    if (RespawnTime <= 0) {
      net.minecraft.server.World mcWorld=((CraftWorld)Location.getWorld()).getHandle();
      EntityMyPet MWentityMyPet=getPetType().getNewEntityInstance();
      MWentityMyPet.setLocation(Location);
      mcWorld.addEntity(MWentityMyPet,CreatureSpawnEvent.SpawnReason.CUSTOM);
      Pet=(CraftMyPet)MWentityMyPet.getBukkitEntity();
      Pet.setSitting(isSitting);
      Status=PetState.Here;
    }
  }
}

Fixed version (ground truth):
public void createPet(Location loc){
  if (Status == PetState.Here || getOwner() == null) {
  }
 else {
    if (RespawnTime <= 0) {
      this.Location=loc;
      net.minecraft.server.World mcWorld=((CraftWorld)loc.getWorld()).getHandle();
      EntityMyPet MWentityMyPet=getPetType().getNewEntityInstance(mcWorld,this);
      MWentityMyPet.setLocation(loc);
      mcWorld.addEntity(MWentityMyPet,CreatureSpawnEvent.SpawnReason.CUSTOM);
      Pet=(CraftMyPet)MWentityMyPet.getBukkitEntity();
      Pet.setSitting(isSitting);
      Status=PetState.Here;
    }
  }
}
Program: 187655
Project: 187655
Buggy source:
public EntityMyWolf(World world,MyWolf MPet){
  super(world,MPet);
  this.texture="String_Node_Str";
  this.b(0.6F,0.8F);
  this.bb=0.3F;
  this.al().a(true);
  PathfinderGoalControl Control=new PathfinderGoalControl(MPet,0.4F);
  this.goalSelector.a(1,new PathfinderGoalFloat(this));
  this.goalSelector.a(2,this.a);
  this.goalSelector.a(3,new PathfinderGoalLeapAtTarget(this,0.4F));
  this.goalSelector.a(4,new PathfinderGoalMeleeAttack(this,this.bb,true));
  this.goalSelector.a(5,Control);
  this.goalSelector.a(7,new de.Keyle.MyPet.entity.pathfinder.PathfinderGoalFollowOwner(this,this.bb,5.0F,2.0F,Control));
  this.goalSelector.a(8,new PathfinderGoalLookAtPlayer(this,EntityHuman.class,8.0F));
  this.goalSelector.a(8,new PathfinderGoalRandomLookaround(this));
  this.targetSelector.a(1,new PathfinderGoalOwnerHurtByTarget(this));
  this.targetSelector.a(2,new de.Keyle.MyPet.entity.pathfinder.PathfinderGoalOwnerHurtTarget(MPet));
  this.targetSelector.a(3,new PathfinderGoalHurtByTarget(this,true));
  this.targetSelector.a(4,new PathfinderGoalControlTarget(MPet,Control,1));
  this.targetSelector.a(5,new PathfinderGoalAggressiveTarget(MPet,10));
}

Fixed version (ground truth):
public EntityMyWolf(World world,MyPet MPet){
  super(world,MPet);
  this.texture="String_Node_Str";
  this.b(0.6F,0.8F);
  this.bb=0.3F;
  this.al().a(true);
  PathfinderGoalControl Control=new PathfinderGoalControl(MPet,0.4F);
  this.goalSelector.a(1,new PathfinderGoalFloat(this));
  this.goalSelector.a(2,this.a);
  this.goalSelector.a(3,new PathfinderGoalLeapAtTarget(this,0.4F));
  this.goalSelector.a(4,new PathfinderGoalMeleeAttack(this,this.bb,true));
  this.goalSelector.a(5,Control);
  this.goalSelector.a(7,new de.Keyle.MyPet.entity.pathfinder.PathfinderGoalFollowOwner(this,this.bb,5.0F,2.0F,Control));
  this.goalSelector.a(8,new PathfinderGoalLookAtPlayer(this,EntityHuman.class,8.0F));
  this.goalSelector.a(8,new PathfinderGoalRandomLookaround(this));
  this.targetSelector.a(1,new PathfinderGoalOwnerHurtByTarget(this));
  this.targetSelector.a(2,new de.Keyle.MyPet.entity.pathfinder.PathfinderGoalOwnerHurtTarget(MPet));
  this.targetSelector.a(3,new PathfinderGoalHurtByTarget(this,true));
  this.targetSelector.a(4,new PathfinderGoalControlTarget(MPet,Control,1));
  this.targetSelector.a(5,new PathfinderGoalAggressiveTarget(MPet,10));
}
Program: 187656
Project: 187656
Buggy source:
public MyWolf(OfflinePlayer Owner){
  super(Owner);
  if (MyPetSkillTreeConfigLoader.getSkillTreeNames().length > 0) {
    for (    String ST : MyPetSkillTreeConfigLoader.getSkillTreeNames()) {
      if (MyPetPermissions.has(Owner.getPlayer(),"String_Node_Str" + ST)) {
        this.skillTree=MyPetSkillTreeConfigLoader.getSkillTree(ST);
        break;
      }
    }
  }
  if (this.skillTree == null) {
    this.skillTree=new MyPetSkillTree("String_Node_Str");
  }
  skillSystem=new MyPetSkillSystem(this);
  experience=new MyPetExperience(this);
}

Fixed version (ground truth):
public MyWolf(OfflinePlayer Owner){
  super(Owner);
  this.Name="String_Node_Str";
  if (MyPetSkillTreeConfigLoader.getSkillTreeNames().length > 0) {
    for (    String ST : MyPetSkillTreeConfigLoader.getSkillTreeNames()) {
      if (MyPetPermissions.has(Owner.getPlayer(),"String_Node_Str" + ST)) {
        this.skillTree=MyPetSkillTreeConfigLoader.getSkillTree(ST);
        break;
      }
    }
  }
  if (this.skillTree == null) {
    this.skillTree=new MyPetSkillTree("String_Node_Str");
  }
  skillSystem=new MyPetSkillSystem(this);
  experience=new MyPetExperience(this);
}
Program: 187658
Project: 187658
Buggy source:
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageResult(EntityDamageEvent event){
  if (!(event instanceof EntityDamageByEntityEvent) || event.isCancelled()) {
    return;
  }
  EntityDamageByEntityEvent e=(EntityDamageByEntityEvent)event;
  if (event.getEntity() instanceof LivingEntity) {
    if (e.getDamager() instanceof Player) {
      Player damager=(Player)e.getDamager();
      if (MyPetList.hasMyPet(damager)) {
        MyPet MPet=MyPetList.getMyPet(damager);
        if (MPet.Status == PetState.Here && event.getEntity() != MPet.Pet) {
          MyPetList.getMyPet(damager).Pet.getHandle().Goaltarget=((CraftLivingEntity)event.getEntity()).getHandle();
        }
      }
 else       if (e.getDamager() instanceof CraftMyPet) {
        MyPet MPet=((CraftMyPet)e.getDamager()).getHandle().getMyPet();
        if (MPet.getSkillSystem().hasSkill("String_Node_Str")) {
          Poison poison=(Poison)MPet.getSkillSystem().getSkill("String_Node_Str");
          if (poison.getPoison()) {
            PotionEffect effect=new PotionEffect(PotionEffectType.POISON,5,1);
            ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageResult(EntityDamageEvent event){
  if (!(event instanceof EntityDamageByEntityEvent) || event.isCancelled()) {
    return;
  }
  EntityDamageByEntityEvent e=(EntityDamageByEntityEvent)event;
  if (event.getEntity() instanceof LivingEntity) {
    if (e.getDamager() instanceof Player) {
      Player damager=(Player)e.getDamager();
      if (MyPetList.hasMyPet(damager)) {
        MyPet MPet=MyPetList.getMyPet(damager);
        if (MPet.Status == PetState.Here && event.getEntity() != MPet.getPet()) {
          MyPetList.getMyPet(damager).getPet().getHandle().Goaltarget=((CraftLivingEntity)event.getEntity()).getHandle();
        }
      }
 else       if (e.getDamager() instanceof CraftMyPet) {
        MyPet MPet=((CraftMyPet)e.getDamager()).getHandle().getMyPet();
        if (MPet.getSkillSystem().hasSkill("String_Node_Str")) {
          Poison poison=(Poison)MPet.getSkillSystem().getSkill("String_Node_Str");
          if (poison.getPoison()) {
            PotionEffect effect=new PotionEffect(PotionEffectType.POISON,5,1);
            ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          }
        }
      }
    }
  }
}
Program: 187659
Project: 187659
Buggy source:
@EventHandler public void onLevelUp(MyPetLevelUpEvent eventMyPet){
  MyPet MPet=eventMyPet.getPet();
  if (!eventMyPet.isQuiet()) {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str","String_Node_Str" + eventMyPet.getLevel()));
  }
  int lvl=eventMyPet.getLevel();
  MyPetSkillTree st=MPet.skillTree;
  String[] Skills=st.getSkills(lvl);
  if (Skills.length > 0) {
    for (    String skill : Skills) {
      if (MPet.getSkillSystem().hasSkill(skill)) {
        if (eventMyPet.isQuiet()) {
          MPet.getSkillSystem().getSkill(skill).setLevel(MPet.getSkillSystem().getSkill(skill).getLevel() + 1);
        }
 else {
          MPet.getSkillSystem().getSkill(skill).upgrade();
        }
      }
    }
  }
  MPet.setHealth(MPet.getMaxHealth());
}

Fixed version (ground truth):
@EventHandler public void onLevelUp(MyPetLevelUpEvent eventMyPet){
  MyPet MPet=eventMyPet.getPet();
  if (!eventMyPet.isQuiet()) {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str","String_Node_Str" + eventMyPet.getLevel()));
  }
  int lvl=eventMyPet.getLevel();
  MyPetSkillTree st=MPet.getSkillTree();
  String[] Skills=st.getSkills(lvl);
  if (Skills.length > 0) {
    for (    String skill : Skills) {
      if (MPet.getSkillSystem().hasSkill(skill)) {
        if (eventMyPet.isQuiet()) {
          MPet.getSkillSystem().getSkill(skill).setLevel(MPet.getSkillSystem().getSkill(skill).getLevel() + 1);
        }
 else {
          MPet.getSkillSystem().getSkill(skill).upgrade();
        }
      }
    }
  }
  MPet.setHealth(MPet.getMaxHealth());
}
Program: 187660
Project: 187660
Buggy source:
@EventHandler public void onPlayerInteractEntity(final PlayerInteractEntityEvent event){
  if (event.isCancelled() || event.getPlayer().getItemInHand().getType() != MyPetConfig.LeashItem || !(event.getRightClicked() instanceof LivingEntity)) {
    return;
  }
  if (MyPetList.hasMyPet(event.getPlayer())) {
    MyPet MPet=MyPetList.getMyPet(event.getPlayer());
    if (event.getRightClicked() != MPet.Pet) {
      MPet.Pet.getHandle().Goaltarget=((CraftLivingEntity)event.getRightClicked()).getHandle();
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerInteractEntity(final PlayerInteractEntityEvent event){
  if (event.isCancelled() || event.getPlayer().getItemInHand().getType() != MyPetConfig.LeashItem || !(event.getRightClicked() instanceof LivingEntity)) {
    return;
  }
  if (MyPetList.hasMyPet(event.getPlayer())) {
    MyPet MPet=MyPetList.getMyPet(event.getPlayer());
    if (event.getRightClicked() != MPet.getPet()) {
      MPet.getPet().getHandle().Goaltarget=((CraftLivingEntity)event.getRightClicked()).getHandle();
    }
  }
}
Program: 187661
Project: 187661
Buggy source:
public void activateBehavior(BehaviorState behaviorState){
  if (Level > 0) {
    Behavior=behaviorState;
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
    if (Behavior == BehaviorState.Friendly) {
      MPet.Pet.setTarget(null);
    }
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",this.Name));
  }
}

Fixed version (ground truth):
public void activateBehavior(BehaviorState behaviorState){
  if (Level > 0) {
    Behavior=behaviorState;
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
    if (Behavior == BehaviorState.Friendly) {
      MPet.getPet().setTarget(null);
    }
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",this.Name));
  }
}
Program: 187662
Project: 187662
Buggy source:
public void setBehavior(BehaviorState behaviorState){
  Behavior=behaviorState;
  MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
  if (Behavior == BehaviorState.Friendly) {
    MPet.Pet.setTarget(null);
  }
}

Fixed version (ground truth):
public void setBehavior(BehaviorState behaviorState){
  Behavior=behaviorState;
  MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
  if (Behavior == BehaviorState.Friendly) {
    MPet.getPet().setTarget(null);
  }
}
Program: 187663
Project: 187663
Buggy source:
@Override public void activate(){
  if (Level > 0) {
    if (Behavior == BehaviorState.Normal) {
      Behavior=BehaviorState.Friendly;
      MPet.Pet.setTarget(null);
    }
 else     if (Behavior == BehaviorState.Friendly) {
      Behavior=BehaviorState.Aggressive;
    }
 else     if (Behavior == BehaviorState.Aggressive || Behavior == BehaviorState.Raid) {
      Behavior=BehaviorState.Normal;
    }
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",this.Name));
  }
}

Fixed version (ground truth):
@Override public void activate(){
  if (Level > 0) {
    if (Behavior == BehaviorState.Normal) {
      Behavior=BehaviorState.Friendly;
      MPet.getPet().setTarget(null);
    }
 else     if (Behavior == BehaviorState.Friendly) {
      Behavior=BehaviorState.Aggressive;
    }
 else     if (Behavior == BehaviorState.Aggressive || Behavior == BehaviorState.Raid) {
      Behavior=BehaviorState.Normal;
    }
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",Behavior.name()));
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name).replace("String_Node_Str",this.Name));
  }
}
Program: 187664
Project: 187664
Buggy source:
public void schedule(){
  if (Level > 0 && MPet.Status == PetState.Here) {
    timeCounter--;
    if (timeCounter <= 0) {
      MPet.Pet.getHandle().heal(1,EntityRegainHealthEvent.RegainReason.REGEN);
      timeCounter=HealtregenTime - Level;
    }
  }
}

Fixed version (ground truth):
public void schedule(){
  if (Level > 0 && MPet.Status == PetState.Here) {
    timeCounter--;
    if (timeCounter <= 0) {
      MPet.getPet().getHandle().heal(1,EntityRegainHealthEvent.RegainReason.REGEN);
      timeCounter=HealtregenTime - Level;
    }
  }
}
Program: 187665
Project: 187665
Buggy source:
@Override public void activate(){
  if (Level > 0) {
    if (MPet.getLocation().getBlock().getType() != Material.STATIONARY_WATER && MPet.getLocation().getBlock().getType() != Material.WATER) {
      inv.setName(MPet.Name);
      OpenInventory(MPet.getOwner().getPlayer());
      if (!MPet.isSitting()) {
        PetChestOpened.add(MPet.getOwner().getPlayer());
      }
      MPet.Pet.setSitting(true);
    }
 else {
      MPet.sendMessageToOwner(MyPetLanguage.getString("String_Node_Str"));
    }
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name));
  }
}

Fixed version (ground truth):
@Override public void activate(){
  if (Level > 0) {
    if (MPet.getLocation().getBlock().getType() != Material.STATIONARY_WATER && MPet.getLocation().getBlock().getType() != Material.WATER) {
      inv.setName(MPet.Name);
      OpenInventory(MPet.getOwner().getPlayer());
      if (!MPet.isSitting()) {
        PetChestOpened.add(MPet.getOwner().getPlayer());
      }
      MPet.getPet().setSitting(true);
    }
 else {
      MPet.sendMessageToOwner(MyPetLanguage.getString("String_Node_Str"));
    }
  }
 else {
    MPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",MPet.Name));
  }
}
Program: 187666
Project: 187666
Buggy source:
@Override public void schedule(){
  if (Level > 0 && Pickup && MPet.Status == PetState.Here && MPet.getSkillSystem().hasSkill("String_Node_Str") && MPet.getSkillSystem().getSkill("String_Node_Str").getLevel() > 0) {
    for (    Entity e : MPet.Pet.getNearbyEntities(Level * RangePerLevel,Level * RangePerLevel,RangePerLevel)) {
      if (e instanceof Item) {
        Item item=(Item)e;
        PlayerPickupItemEvent ppievent=new PlayerPickupItemEvent(MPet.getOwner().getPlayer(),item,item.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(ppievent);
        if (ppievent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)MPet.getSkillSystem().getSkill("String_Node_Str")).inv;
        int ItemAmount=inv.addItem(item.getItemStack());
        if (ItemAmount == 0) {
          for (          Entity p : e.getNearbyEntities(20,20,20)) {
            if (p instanceof Player) {
              ((CraftPlayer)p).getHandle().netServerHandler.sendPacket(new Packet22Collect(e.getEntityId(),MPet.Pet.getEntityId()));
            }
          }
          e.remove();
        }
 else {
          item.getItemStack().setAmount(ItemAmount);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void schedule(){
  if (Level > 0 && Pickup && MPet.Status == PetState.Here && MPet.getSkillSystem().hasSkill("String_Node_Str") && MPet.getSkillSystem().getSkill("String_Node_Str").getLevel() > 0) {
    for (    Entity e : MPet.getPet().getNearbyEntities(Level * RangePerLevel,Level * RangePerLevel,RangePerLevel)) {
      if (e instanceof Item) {
        Item item=(Item)e;
        PlayerPickupItemEvent ppievent=new PlayerPickupItemEvent(MPet.getOwner().getPlayer(),item,item.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(ppievent);
        if (ppievent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)MPet.getSkillSystem().getSkill("String_Node_Str")).inv;
        int ItemAmount=inv.addItem(item.getItemStack());
        if (ItemAmount == 0) {
          for (          Entity p : e.getNearbyEntities(20,20,20)) {
            if (p instanceof Player) {
              ((CraftPlayer)p).getHandle().netServerHandler.sendPacket(new Packet22Collect(e.getEntityId(),MPet.getPet().getEntityId()));
            }
          }
          e.remove();
        }
 else {
          item.getItemStack().setAmount(ItemAmount);
        }
      }
    }
  }
}
Program: 187667
Project: 187667
Buggy source:
public void createPet(Location loc){
  if (Status == PetState.Here || getOwner() == null) {
  }
 else {
    if (RespawnTime <= 0) {
      this.Location=loc;
      net.minecraft.server.World mcWorld=((CraftWorld)loc.getWorld()).getHandle();
      EntityMyPet MWentityMyPet=getPetType().getNewEntityInstance(mcWorld,this);
      MWentityMyPet.setLocation(loc);
      mcWorld.addEntity(MWentityMyPet,CreatureSpawnEvent.SpawnReason.CUSTOM);
      Pet=(CraftMyPet)MWentityMyPet.getBukkitEntity();
      Pet.setSitting(isSitting);
      Status=PetState.Here;
    }
  }
}

Fixed version (ground truth):
public void createPet(Location loc){
  if (Status == PetState.Here || getOwner() == null) {
  }
 else {
    if (RespawnTime <= 0) {
      this.Location=loc;
      net.minecraft.server.World mcWorld=((CraftWorld)loc.getWorld()).getHandle();
      EntityMyPet MPentityMyPet=getPetType().getNewEntityInstance(mcWorld,this);
      MPentityMyPet.setLocation(loc);
      if (!Location.getChunk().isLoaded()) {
        Location.getChunk().load();
      }
      if (!mcWorld.addEntity(MPentityMyPet,CreatureSpawnEvent.SpawnReason.CUSTOM)) {
        return;
      }
      Pet=(CraftMyPet)MPentityMyPet.getBukkitEntity();
      Pet.setSitting(isSitting);
      Status=PetState.Here;
    }
  }
}
Program: 187668
Project: 187668
Buggy source:
public static boolean has(Player player,String node){
  if (player.isOp()) {
    return true;
  }
 else   if (PermissionsMode == PermissionsType.NONE) {
    return true;
  }
 else   if (PermissionsMode == PermissionsType.Vault) {
    ((Permission)Permissions).has(player,node);
  }
 else   if (PermissionsMode == PermissionsType.BukkitPermissions) {
    player.hasPermission(node);
  }
  return false;
}

Fixed version (ground truth):
public static boolean has(Player player,String node){
  if (player.isOp()) {
    return true;
  }
 else   if (PermissionsMode == PermissionsType.NONE) {
    return true;
  }
 else   if (PermissionsMode == PermissionsType.Vault) {
    return ((Permission)Permissions).has(player,node);
  }
 else   if (PermissionsMode == PermissionsType.BukkitPermissions) {
    return player.hasPermission(node);
  }
  return false;
}
Program: 187670
Project: 187670
Buggy source:
public EntityMyWolf(World world,MyWolf MWolf){
  super(world);
  setMyWolf(MWolf);
  MyWolfUtil.getLogger().info("String_Node_Str");
}

Fixed version (ground truth):
public EntityMyWolf(World world,MyWolf MWolf){
  super(world);
  setMyWolf(MWolf);
}
Program: 187671
Project: 187671
Buggy source:
public void e(NBTTagCompound nbttagcompound){
  if (!isMyWolf) {
    MyWolfUtil.getLogger().info("String_Node_Str");
    super.d(nbttagcompound);
    EntityWolf entityWolf=new EntityWolf(world);
    entityWolf.d(nbttagcompound);
    this.getBukkitEntity().remove();
  }
 else {
    MyWolfUtil.getLogger().info("String_Node_Str");
    super.d(nbttagcompound);
  }
}

Fixed version (ground truth):
public void e(NBTTagCompound nbttagcompound){
  if (!isMyWolf) {
    super.d(nbttagcompound);
    EntityWolf entityWolf=new EntityWolf(world);
    entityWolf.d(nbttagcompound);
    this.getBukkitEntity().remove();
    MyWolfUtil.getLogger().severe("String_Node_Str");
  }
 else {
    super.d(nbttagcompound);
  }
}