nus-yam/ex-repair huggingface dataset:
Program: 187540
Project: 187540
Buggy source:
@EventHandler public void onEntityDamageByLightning(final EntityDamageByEntityEvent event){
  if (event.getCause() == DamageCause.LIGHTNING) {
    LightningStrike bolt=(LightningStrike)event.getDamager();
    if (Lightning.isSkillLightning(bolt)) {
      MyPet boltMyPet=Lightning.lightningList.get(bolt);
      if (event.getEntity() instanceof CraftMyPet) {
        MyPet myPet=((CraftMyPet)event.getEntity()).getMyPet();
        if (boltMyPet == myPet) {
          event.setCancelled(true);
        }
 else         if (!MyPetPvP.canHurt(boltMyPet.getOwner().getPlayer(),myPet.getOwner().getPlayer())) {
          event.setCancelled(true);
        }
      }
 else       if (event.getEntity() instanceof Player) {
        Player victim=(Player)event.getEntity();
        if (boltMyPet.getOwner().getPlayer() == victim) {
          event.setCancelled(true);
        }
 else         if (!MyPetPvP.canHurt(boltMyPet.getOwner().getPlayer(),victim)) {
          event.setCancelled(true);
        }
      }
 else       if (event.getEntity() instanceof Tameable) {
        Tameable tameable=(Tameable)event.getEntity();
        if (boltMyPet.getOwner().equals(tameable.getOwner())) {
          event.setCancelled(true);
        }
      }
      if (event.getEntity() instanceof LivingEntity && !event.isCancelled() && MyPetExperience.DAMAGE_WEIGHTED_EXPERIENCE_DISTRIBUTION) {
        MyPetExperience.addDamageToEntity(boltMyPet.getCraftPet(),(LivingEntity)event.getEntity(),event.getDamage());
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onEntityDamageByLightning(final EntityDamageByEntityEvent event){
  if (event.getCause() == DamageCause.LIGHTNING && event.getDamager() instanceof LightningStrike) {
    LightningStrike bolt=(LightningStrike)event.getDamager();
    if (Lightning.isSkillLightning(bolt)) {
      MyPet boltMyPet=Lightning.lightningList.get(bolt);
      if (event.getEntity() instanceof CraftMyPet) {
        MyPet myPet=((CraftMyPet)event.getEntity()).getMyPet();
        if (boltMyPet == myPet) {
          event.setCancelled(true);
        }
 else         if (!MyPetPvP.canHurt(boltMyPet.getOwner().getPlayer(),myPet.getOwner().getPlayer())) {
          event.setCancelled(true);
        }
      }
 else       if (event.getEntity() instanceof Player) {
        Player victim=(Player)event.getEntity();
        if (boltMyPet.getOwner().getPlayer() == victim) {
          event.setCancelled(true);
        }
 else         if (!MyPetPvP.canHurt(boltMyPet.getOwner().getPlayer(),victim)) {
          event.setCancelled(true);
        }
      }
 else       if (event.getEntity() instanceof Tameable) {
        Tameable tameable=(Tameable)event.getEntity();
        if (boltMyPet.getOwner().equals(tameable.getOwner())) {
          event.setCancelled(true);
        }
      }
      if (event.getEntity() instanceof LivingEntity && !event.isCancelled() && MyPetExperience.DAMAGE_WEIGHTED_EXPERIENCE_DISTRIBUTION) {
        MyPetExperience.addDamageToEntity(boltMyPet.getCraftPet(),(LivingEntity)event.getEntity(),event.getDamage());
      }
    }
  }
}
Program: 187542
Project: 187542
Buggy source:
public String getFormattedValue(){
  String availableBuffs="String_Node_Str";
  for (  int primaryBuffId : primaryBuffs) {
    if (primaryActive.get(primaryBuffId)) {
      if (!availableBuffs.equalsIgnoreCase("String_Node_Str")) {
        availableBuffs+="String_Node_Str";
      }
      availableBuffs+=ChatColor.GOLD + MyPetLocales.getString("String_Node_Str" + buffNames.get(primaryBuffId),myPet.getOwner().getLanguage());
      if (secundaryActive.get(primaryBuffId)) {
        availableBuffs+="String_Node_Str";
      }
      availableBuffs+=ChatColor.RESET;
    }
  }
  if (secundaryActive.get(10)) {
    if (!availableBuffs.equalsIgnoreCase("String_Node_Str")) {
      availableBuffs+="String_Node_Str";
    }
    availableBuffs+=ChatColor.GOLD + MyPetLocales.getString("String_Node_Str" + buffNames.get(10),myPet.getOwner().getLanguage()) + ChatColor.RESET;
  }
  return availableBuffs;
}

Fixed version (ground truth):
public String getFormattedValue(){
  String availableBuffs="String_Node_Str";
  for (  int primaryBuffId : primaryBuffs) {
    if (primaryBuffId != 0 && primaryActive.get(primaryBuffId)) {
      if (!availableBuffs.equalsIgnoreCase("String_Node_Str")) {
        availableBuffs+="String_Node_Str";
      }
      availableBuffs+=ChatColor.GOLD + MyPetLocales.getString("String_Node_Str" + buffNames.get(primaryBuffId),myPet.getOwner().getLanguage());
      if (secundaryActive.get(primaryBuffId)) {
        availableBuffs+="String_Node_Str";
      }
      availableBuffs+=ChatColor.RESET;
    }
  }
  if (secundaryActive.get(10)) {
    if (!availableBuffs.equalsIgnoreCase("String_Node_Str")) {
      availableBuffs+="String_Node_Str";
    }
    availableBuffs+=ChatColor.GOLD + MyPetLocales.getString("String_Node_Str" + buffNames.get(10),myPet.getOwner().getLanguage()) + ChatColor.RESET;
  }
  return availableBuffs;
}
Program: 187545
Project: 187545
Buggy source:
public void activateBehavior(BehaviorState behaviorState){
  if (active) {
    behavior=behaviorState;
    myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str",MyPetLanguage.getString("String_Node_Str" + behavior.name())));
    if (behavior == BehaviorState.Friendly) {
      myPet.getCraftPet().getHandle().setGoalTarget(null);
    }
  }
 else {
    myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str",this.getName()));
  }
}

Fixed version (ground truth):
public void activateBehavior(BehaviorState behaviorState){
  if (active) {
    if (behaviorActive.get(behaviorState)) {
      behavior=behaviorState;
      myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str",MyPetLanguage.getString("String_Node_Str" + behavior.name())));
      if (behavior == BehaviorState.Friendly) {
        myPet.getCraftPet().getHandle().setGoalTarget(null);
      }
    }
  }
 else {
    myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str",this.getName()));
  }
}
Program: 187547
Project: 187547
Buggy source:
@EventHandler public void onMyPetPlayerTeleport(final PlayerTeleportEvent event){
  if (MyPetPlayer.isMyPetPlayer(event.getPlayer().getName())) {
    final MyPetPlayer myPetPlayer=MyPetPlayer.getMyPetPlayer(event.getPlayer());
    if (myPetPlayer.hasMyPet()) {
      final MyPet myPet=myPetPlayer.getMyPet();
      if (myPet.getStatus() == PetState.Here) {
        myPet.removePet();
        myPet.setLocation(event.getPlayer().getLocation());
        MyPetPlugin.getPlugin().getServer().getScheduler().runTaskLater(MyPetPlugin.getPlugin(),new Runnable(){
          public void run(){
            if (myPetPlayer.hasMyPet()) {
              MyPet runMyPet=myPetPlayer.getMyPet();
switch (runMyPet.createPet()) {
case Canceled:
                runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",runMyPet.petName));
              break;
case NoSpace:
            runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",runMyPet.petName));
          break;
case NotAllowed:
        runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName));
      break;
  }
}
}
}
,25L);
}
}
}
}

Fixed version (ground truth):
@EventHandler public void onMyPetPlayerTeleport(final PlayerTeleportEvent event){
  if (MyPetPlayer.isMyPetPlayer(event.getPlayer().getName())) {
    final MyPetPlayer myPetPlayer=MyPetPlayer.getMyPetPlayer(event.getPlayer());
    if (myPetPlayer.hasMyPet()) {
      final MyPet myPet=myPetPlayer.getMyPet();
      if (myPet.getStatus() == PetState.Here) {
        if (myPet.getLocation().getWorld() != event.getTo().getWorld() || myPet.getLocation().distance(event.getTo()) > 10) {
          myPet.removePet();
        }
        myPet.setLocation(event.getTo());
        MyPetPlugin.getPlugin().getServer().getScheduler().runTaskLater(MyPetPlugin.getPlugin(),new Runnable(){
          public void run(){
            if (myPetPlayer.hasMyPet()) {
              MyPet runMyPet=myPetPlayer.getMyPet();
switch (runMyPet.createPet()) {
case Canceled:
                runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",runMyPet.petName));
              break;
case NoSpace:
            runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",runMyPet.petName));
          break;
case NotAllowed:
        runMyPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName));
      break;
  }
}
}
}
,25L);
}
}
}
}
Program: 187549
Project: 187549
Buggy source:
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    this.sitPathfinder=new MyPetAISit(this);
    super.setMyPet(myPet);
    this.setSitting(((MyWolf)myPet).isSitting());
    this.setTamed(((MyWolf)myPet).isTamed());
    this.setCollarColor(((MyWolf)myPet).getCollarColor());
  }
}

Fixed version (ground truth):
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    this.sitPathfinder=new MyPetAISit(this);
    super.setMyPet(myPet);
    this.setBaby(((MyWolf)myPet).isBaby());
    this.setSitting(((MyWolf)myPet).isSitting());
    this.setTamed(((MyWolf)myPet).isTamed());
    this.setCollarColor(((MyWolf)myPet).getCollarColor());
  }
}
Program: 187551
Project: 187551
Buggy source:
@Override public boolean shouldStart(){
  if (myPet.getDamage() <= 0 && myPet.getRangedDamage() <= 0) {
    return false;
  }
  if (behaviorSkill != null && behaviorSkill.isActive()) {
    if (behaviorSkill.getBehavior() == BehaviorState.Farm && myPet.getCraftPet().canMove()) {
      if (petEntity.getGoalTarget() == null || !petEntity.getGoalTarget().isAlive()) {
        if (duelOpponent != null) {
          this.target=duelOpponent;
          return true;
        }
        for (float range=1.F; range <= this.range; range++) {
          for (          Object entityObj : this.petEntity.world.a(EntityMyPet.class,this.petOwnerEntity.boundingBox.grow((double)range,4.0D,(double)range))) {
            EntityMyPet entityMyPet=((EntityMyPet)entityObj);
            MyPet targetMyPet=entityMyPet.getMyPet();
            if (petEntity.getEntitySenses().canSee(entityMyPet) && entityMyPet != petEntity && entityMyPet.isAlive()) {
              if (!targetMyPet.getSkills().isSkillActive("String_Node_Str") || !targetMyPet.getCraftPet().canMove()) {
                continue;
              }
              Behavior targetbehavior=(Behavior)targetMyPet.getSkills().getSkill("String_Node_Str");
              if (targetbehavior.getBehavior() != BehaviorState.Duel) {
                continue;
              }
              if (targetMyPet.getDamage() == 0) {
                continue;
              }
              this.target=entityMyPet;
              return true;
            }
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean shouldStart(){
  if (myPet.getDamage() <= 0 && myPet.getRangedDamage() <= 0) {
    return false;
  }
  if (behaviorSkill != null && behaviorSkill.isActive()) {
    if (behaviorSkill.getBehavior() == BehaviorState.Duel && myPet.getCraftPet().canMove()) {
      if (petEntity.getGoalTarget() == null || !petEntity.getGoalTarget().isAlive()) {
        if (duelOpponent != null) {
          this.target=duelOpponent;
          return true;
        }
        for (float range=1.F; range <= this.range; range++) {
          for (          Object entityObj : this.petEntity.world.a(EntityMyPet.class,this.petOwnerEntity.boundingBox.grow((double)range,4.0D,(double)range))) {
            EntityMyPet entityMyPet=((EntityMyPet)entityObj);
            MyPet targetMyPet=entityMyPet.getMyPet();
            if (petEntity.getEntitySenses().canSee(entityMyPet) && entityMyPet != petEntity && entityMyPet.isAlive()) {
              if (!targetMyPet.getSkills().isSkillActive("String_Node_Str") || !targetMyPet.getCraftPet().canMove()) {
                continue;
              }
              Behavior targetbehavior=(Behavior)targetMyPet.getSkills().getSkill("String_Node_Str");
              if (targetbehavior.getBehavior() != BehaviorState.Duel) {
                continue;
              }
              if (targetMyPet.getDamage() == 0) {
                continue;
              }
              this.target=entityMyPet;
              return true;
            }
          }
        }
      }
    }
  }
  return false;
}
Program: 187552
Project: 187552
Buggy source:
public boolean activate(){
  if (rows > 0) {
    if (myPet.getOwner().getPlayer().getGameMode() == GameMode.CREATIVE && !OPEN_IN_CREATIVEMODE && !MyPetPermissions.has(myPet.getOwner().getPlayer(),"String_Node_Str",false)) {
      myPet.sendMessageToOwner(MyPetLanguage.getString("String_Node_Str"));
      return false;
    }
    if (myPet.getLocation().getBlock().isLiquid()) {
      inv.setName(myPet.petName);
      openInventory(myPet.getOwner().getPlayer());
      return true;
    }
 else {
      myPet.sendMessageToOwner(MyPetLanguage.getString("String_Node_Str"));
      return false;
    }
  }
 else {
    myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName));
    return false;
  }
}

Fixed version (ground truth):
public boolean activate(){
  if (rows > 0) {
    if (myPet.getOwner().getPlayer().getGameMode() == GameMode.CREATIVE && !OPEN_IN_CREATIVEMODE && !MyPetPermissions.has(myPet.getOwner().getPlayer(),"String_Node_Str",false)) {
      myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")));
      return false;
    }
    if (!myPet.getLocation().getBlock().isLiquid()) {
      inv.setName(myPet.petName);
      openInventory(myPet.getOwner().getPlayer());
      return true;
    }
 else {
      myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str").replace("String_Node_Str",myPet.petName)));
      return false;
    }
  }
 else {
    myPet.sendMessageToOwner(MyPetBukkitUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName));
    return false;
  }
}
Program: 187553
Project: 187553
Buggy source:
public static MyPet setMyPetActive(InactiveMyPet inactiveMyPet){
  if (hasMyPet(inactiveMyPet.getPetName())) {
    setMyPetInactive(inactiveMyPet.getOwner());
  }
  boolean isCancelled=false;
  if (MyPetConfiguration.ENABLE_EVENTS) {
    MyPetSelectEvent event=new MyPetSelectEvent(inactiveMyPet,NewStatus.Active);
    getServer().getPluginManager().callEvent(event);
    isCancelled=event.isCancelled();
  }
  if (!isCancelled) {
    MyPet activeMyPet=getMyPetFromInactiveMyPet(inactiveMyPet);
    addMyPet(activeMyPet);
    removeInactiveMyPet(inactiveMyPet);
    inactiveMyPet.getOwner().setLastActiveMyPetUUID(activeMyPet.getUUID());
    DebugLogger.info("String_Node_Str" + activeMyPet);
    DebugLogger.info("String_Node_Str" + inactiveMyPet);
    return activeMyPet;
  }
  return null;
}

Fixed version (ground truth):
public static MyPet setMyPetActive(InactiveMyPet inactiveMyPet){
  if (inactiveMyPet.getOwner().hasMyPet()) {
    setMyPetInactive(inactiveMyPet.getOwner());
  }
  boolean isCancelled=false;
  if (MyPetConfiguration.ENABLE_EVENTS) {
    MyPetSelectEvent event=new MyPetSelectEvent(inactiveMyPet,NewStatus.Active);
    getServer().getPluginManager().callEvent(event);
    isCancelled=event.isCancelled();
  }
  if (!isCancelled) {
    MyPet activeMyPet=getMyPetFromInactiveMyPet(inactiveMyPet);
    addMyPet(activeMyPet);
    removeInactiveMyPet(inactiveMyPet);
    inactiveMyPet.getOwner().setLastActiveMyPetUUID(activeMyPet.getUUID());
    DebugLogger.info("String_Node_Str" + activeMyPet);
    DebugLogger.info("String_Node_Str" + inactiveMyPet);
    return activeMyPet;
  }
  return null;
}
Program: 187556
Project: 187556
Buggy source:
public void setSize(float extra){
  EntitySize es=this.getClass().getAnnotation(EntitySize.class);
  if (es != null) {
    this.a(es.width(),es.height() + extra);
  }
  float f=this.width / 2.0F;
  float f1=this.length;
  this.boundingBox.b(locX - f,locY - this.height + this.W,locZ - f,locX + f,locY - this.height + this.W + f1,locZ + f);
}

Fixed version (ground truth):
public void setSize(float extra){
  EntitySize es=this.getClass().getAnnotation(EntitySize.class);
  if (es != null) {
    this.a(es.width(),es.height() + extra);
  }
}
Program: 187557
Project: 187557
Buggy source:
@Override public List<String> saveSkillTrees(String configPath,String[] mobtypes){
  SnakeYAML_Configuration yamlConfiguration;
  File skillFile;
  List<String> savedPetTypes=new ArrayList<String>();
  for (  MyPetType petType : MyPetType.values()) {
    skillFile=new File(configPath + File.separator + petType.getTypeName().toLowerCase()+ "String_Node_Str");
    yamlConfiguration=new SnakeYAML_Configuration(skillFile);
    if (saveSkillTree(yamlConfiguration,petType.getTypeName())) {
      savedPetTypes.add(petType.getTypeName());
    }
  }
  skillFile=new File(configPath + File.separator + "String_Node_Str");
  yamlConfiguration=new SnakeYAML_Configuration(skillFile);
  if (saveSkillTree(yamlConfiguration,"String_Node_Str")) {
    savedPetTypes.add("String_Node_Str");
  }
  return savedPetTypes;
}

Fixed version (ground truth):
@Override public List<String> saveSkillTrees(String configPath,String[] mobtypes){
  SnakeYAML_Configuration yamlConfiguration;
  File skillFile;
  List<String> savedPetTypes=new ArrayList<String>();
  for (  String petType : mobtypes) {
    skillFile=new File(configPath + File.separator + petType.toLowerCase()+ "String_Node_Str");
    yamlConfiguration=new SnakeYAML_Configuration(skillFile);
    if (saveSkillTree(yamlConfiguration,petType)) {
      savedPetTypes.add(petType);
    }
  }
  skillFile=new File(configPath + File.separator + "String_Node_Str");
  yamlConfiguration=new SnakeYAML_Configuration(skillFile);
  if (saveSkillTree(yamlConfiguration,"String_Node_Str")) {
    savedPetTypes.add("String_Node_Str");
  }
  return savedPetTypes;
}
Program: 187558
Project: 187558
Buggy source:
public void j_(){
  super.j_();
  if (!world.getMaterial((int)locX,(int)locY,(int)locZ).isLiquid() && !world.getMaterial((int)locX,(int)(locY + 0.65),(int)locZ).isSolid()) {
    this.locY+=0.65;
  }
}

Fixed version (ground truth):
public void j_(){
  super.j_();
  if (!world.getMaterial((int)locX,(int)locY,(int)locZ).isLiquid() && !world.getMaterial((int)locX,(int)(locY + 1.),(int)locZ).isSolid()) {
    this.locY+=0.65;
  }
}
Program: 187560
Project: 187560
Buggy source:
public static String getMinecraftVersion(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return MinecraftVersion;
}

Fixed version (ground truth):
public static String getMinecraftVersion(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return minecraftVersion;
}
Program: 187561
Project: 187561
Buggy source:
public static String getMyPetVersion(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return MyPetVersion;
}

Fixed version (ground truth):
public static String getMyPetVersion(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return myPetVersion;
}
Program: 187562
Project: 187562
Buggy source:
public static String getMyPetBuild(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return MyPetBuild;
}

Fixed version (ground truth):
public static String getMyPetBuild(){
  if (!updated) {
    getManifestVersion();
    updated=true;
  }
  return myPetBuild;
}
Program: 187563
Project: 187563
Buggy source:
private static void getManifestVersion(){
  try {
    Enumeration<URL> e=MyPetVersion.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
    while (e.hasMoreElements()) {
      URL u=e.nextElement();
      if (u.getPath().contains(MyPetVersion.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath())) {
        Manifest mf=new Manifest(u.openStream());
        Attributes attr=mf.getMainAttributes();
        if (attr.getValue("String_Node_Str") != null) {
          MyPetVersion=attr.getValue("String_Node_Str");
        }
        if (attr.getValue("String_Node_Str") != null) {
          MyPetBuild=attr.getValue("String_Node_Str");
        }
        if (attr.getValue("String_Node_Str") != null) {
          MinecraftVersion=attr.getValue("String_Node_Str");
        }
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  URISyntaxException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void getManifestVersion(){
  try {
    String path=MyPetVersion.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
    Attributes attr=getClassLoaderForExtraModule(path).getMainAttributes();
    if (attr.getValue("String_Node_Str") != null) {
      myPetVersion=attr.getValue("String_Node_Str");
    }
    if (attr.getValue("String_Node_Str") != null) {
      myPetBuild=attr.getValue("String_Node_Str");
    }
    if (attr.getValue("String_Node_Str") != null) {
      minecraftVersion=attr.getValue("String_Node_Str");
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  URISyntaxException e) {
    e.printStackTrace();
  }
}
Program: 187565
Project: 187565
Buggy source:
public void load(){
  List<Tag<?>> tags=readRawNBT(NBTFile,true);
  if (tags != null) {
    MyPetUtil.getDebugLogger().info("String_Node_Str" + NBTFile.getName() + "String_Node_Str");
  }
 else {
    tags=readRawNBT(NBTFile,false);
    if (tags != null) {
      MyPetUtil.getDebugLogger().info("String_Node_Str" + NBTFile.getName() + "String_Node_Str");
    }
  }
  if (tags != null && tags.size() > 0) {
    nbtTagCompound=(CompoundTag)tags.get(0);
  }
}

Fixed version (ground truth):
public void load(){
  if (!NBTFile.exists()) {
    return;
  }
  List<Tag<?>> tags=readRawNBT(NBTFile,true);
  if (tags != null) {
    if (MyPetUtil.getDebugLogger() != null) {
      MyPetUtil.getDebugLogger().info("String_Node_Str" + NBTFile.getName() + "String_Node_Str");
    }
  }
 else {
    tags=readRawNBT(NBTFile,false);
    if (tags != null) {
      if (MyPetUtil.getDebugLogger() != null) {
        MyPetUtil.getDebugLogger().info("String_Node_Str" + NBTFile.getName() + "String_Node_Str");
      }
    }
  }
  if (tags != null && tags.size() > 0) {
    nbtTagCompound=(CompoundTag)tags.get(0);
  }
}
Program: 187566
Project: 187566
Buggy source:
public CompoundTag getNBTCompound(){
  if (nbtTagCompound == null) {
    nbtTagCompound=new CompoundTag("String_Node_Str",new CompoundMap());
  }
  return nbtTagCompound;
}

Fixed version (ground truth):
public CompoundTag getNBTCompound(){
  if (nbtTagCompound == null) {
    clearConfig();
  }
  return nbtTagCompound;
}
Program: 187567
Project: 187567
Buggy source:
@Override public void schedule(){
  if (range > 0 && pickup && myPet.getStatus() == PetState.Here && myPet.getSkills().isSkillActive("String_Node_Str")) {
    for (    Entity e : myPet.getCraftPet().getNearbyEntities(range,range,range)) {
      if (e instanceof Item) {
        Item item=(Item)e;
        PlayerPickupItemEvent playerPickupEvent=new PlayerPickupItemEvent(myPet.getOwner().getPlayer(),item,item.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(playerPickupEvent);
        if (playerPickupEvent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)myPet.getSkills().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().playerConnection.sendPacket(new Packet22Collect(e.getEntityId(),myPet.getCraftPet().getEntityId()));
            }
          }
          myPet.getCraftPet().getHandle().makeSound("String_Node_Str",0.2F,1.0F);
          e.remove();
        }
 else {
          item.getItemStack().setAmount(itemAmount);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void schedule(){
  if (range > 0 && pickup && myPet.getStatus() == PetState.Here && myPet.getSkills().isSkillActive("String_Node_Str")) {
    for (    Entity entity : myPet.getCraftPet().getNearbyEntities(range,range,range)) {
      if (entity instanceof Item) {
        Item itemEntity=(Item)entity;
        PlayerPickupItemEvent playerPickupEvent=new PlayerPickupItemEvent(myPet.getOwner().getPlayer(),itemEntity,itemEntity.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(playerPickupEvent);
        if (playerPickupEvent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)myPet.getSkills().getSkill("String_Node_Str")).inv;
        int itemAmount=inv.addItem(itemEntity.getItemStack());
        if (itemAmount == 0) {
          for (          Entity p : itemEntity.getNearbyEntities(20,20,20)) {
            if (p instanceof Player) {
              ((CraftPlayer)p).getHandle().playerConnection.sendPacket(new Packet22Collect(entity.getEntityId(),myPet.getCraftPet().getEntityId()));
            }
          }
          myPet.getCraftPet().getHandle().makeSound("String_Node_Str",0.2F,1.0F);
          itemEntity.remove();
        }
 else {
          itemEntity.getItemStack().setAmount(itemAmount);
        }
      }
    }
  }
}
Program: 187571
Project: 187571
Buggy source:
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MyPigZombie myPigZombie=(MyPigZombie)myPet;
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (myPigZombie.getEquipment(slot) != null) {
        setEquipment(slot.getSlotId(),myPigZombie.getEquipment(slot));
      }
    }
  }
}

Fixed version (ground truth):
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MyPigZombie myPigZombie=(MyPigZombie)myPet;
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (myPigZombie.getEquipment(slot) != null) {
        setPetEquipment(slot.getSlotId(),myPigZombie.getEquipment(slot));
      }
    }
  }
}
Program: 187572
Project: 187572
Buggy source:
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    getCraftPet().getHandle().setEquipment(slot.getSlotId(),item);
  }
}

Fixed version (ground truth):
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    ((EntityMyPigZombie)getCraftPet().getHandle()).setPetEquipment(slot.getSlotId(),item);
  }
}
Program: 187573
Project: 187573
Buggy source:
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MySkeleton mySkeleton=(MySkeleton)myPet;
    this.setWither(mySkeleton.isWither());
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (mySkeleton.getEquipment(slot) != null) {
        setEquipment(slot.getSlotId(),mySkeleton.getEquipment(slot));
      }
    }
  }
}

Fixed version (ground truth):
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MySkeleton mySkeleton=(MySkeleton)myPet;
    this.setWither(mySkeleton.isWither());
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (mySkeleton.getEquipment(slot) != null) {
        setPetEquipment(slot.getSlotId(),mySkeleton.getEquipment(slot));
      }
    }
  }
}
Program: 187574
Project: 187574
Buggy source:
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    getCraftPet().getHandle().setEquipment(slot.getSlotId(),item);
  }
}

Fixed version (ground truth):
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    ((EntityMySkeleton)getCraftPet().getHandle()).setPetEquipment(slot.getSlotId(),item);
  }
}
Program: 187575
Project: 187575
Buggy source:
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MyZombie myZombie=(MyZombie)myPet;
    this.setBaby(myZombie.isBaby());
    this.setVillager(myZombie.isVillager());
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (myZombie.getEquipment(slot) != null) {
        setEquipment(slot.getSlotId(),myZombie.getEquipment(slot));
      }
    }
  }
}

Fixed version (ground truth):
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    super.setMyPet(myPet);
    MyZombie myZombie=(MyZombie)myPet;
    this.setBaby(myZombie.isBaby());
    this.setVillager(myZombie.isVillager());
    for (    EquipmentSlot slot : EquipmentSlot.values()) {
      if (myZombie.getEquipment(slot) != null) {
        setPetEquipment(slot.getSlotId(),myZombie.getEquipment(slot));
      }
    }
  }
}
Program: 187576
Project: 187576
Buggy source:
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    getCraftPet().getHandle().setEquipment(slot.getSlotId(),item);
  }
}

Fixed version (ground truth):
public void setEquipment(EquipmentSlot slot,ItemStack item){
  item=item.cloneItemStack();
  equipment.put(slot,item);
  if (status == PetState.Here) {
    ((EntityMyZombie)getCraftPet().getHandle()).setPetEquipment(slot.getSlotId(),item);
  }
}
Program: 187577
Project: 187577
Buggy source:
public org.bukkit.entity.Entity getBukkitEntity(){
  if (this.bukkitEntity == null) {
    this.bukkitEntity=new CraftMyPet(this.world.getServer(),this);
  }
  return this.bukkitEntity;
}

Fixed version (ground truth):
public CraftEntity getBukkitEntity(){
  if (this.myBukkitEntity == null) {
    this.myBukkitEntity=new CraftMyPet(this.world.getServer(),this);
  }
  try {
    Field bE=Entity.class.getDeclaredField("String_Node_Str");
    bE.setAccessible(true);
    if (bE.get(this) == null) {
      bE.set(this,this.myBukkitEntity);
    }
    return (CraftEntity)bE.get(this);
  }
 catch (  NoSuchFieldException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
  return this.myBukkitEntity;
}
Program: 187578
Project: 187578
Buggy source:
/** 
 * Is called when a MyPet attemps to do damge to another entity
 */
public boolean m(Entity entity){
  int damage=isMyPet() ? myPet.getDamage() : MyPet.getStartDamage(MyPetType.getMyPetTypeByEntityClass(this.getClass()).getMyPetClass());
  if (entity instanceof EntityPlayer) {
    Player victim=(Player)entity.getBukkitEntity();
    if (!MyPetPvP.canHurt(myPet.getOwner().getPlayer(),victim)) {
      if (myPet.hasTarget()) {
        myPet.getCraftPet().getHandle().setGoalTarget((EntityLiving)null);
      }
      return false;
    }
  }
  return entity.damageEntity(DamageSource.mobAttack(this),damage);
}

Fixed version (ground truth):
/** 
 * Is called when a MyPet attemps to do damge to another entity
 */
public boolean m(Entity entity){
  int damage=isMyPet() ? myPet.getDamage() : MyPet.getStartDamage(MyPetType.getMyPetTypeByEntityClass(this.getClass()).getMyPetClass());
  if (entity instanceof EntityPlayer) {
    Player victim=(Player)entity.getBukkitEntity();
    if (!MyPetPvP.canHurt(myPet.getOwner().getPlayer(),victim)) {
      if (myPet.hasTarget()) {
        myPet.getCraftPet().getHandle().setGoalTarget(null);
      }
      return false;
    }
  }
  return entity.damageEntity(DamageSource.mobAttack(this),damage);
}
Program: 187581
Project: 187581
Buggy source:
public NBTTagCompound getInfo(){
  return NBTextendetInfo;
}

Fixed version (ground truth):
public NBTTagCompound getInfo(){
  if (NBTextendetInfo == null) {
    NBTextendetInfo=new NBTTagCompound("String_Node_Str");
  }
  return NBTextendetInfo;
}
Program: 187591
Project: 187591
Buggy source:
public int getMaxHealth(){
  if (isMyPet()) {
    return myPet.getMaxHealth();
  }
 else {
    return MyPet.getStartHP(MyPetType.getMyPetTypeByEntityClass(this.getClass()).getMyPetClass());
  }
}

Fixed version (ground truth):
@Override public int getMaxHealth(){
  return this.maxHealth;
}
Program: 187593
Project: 187593
Buggy source:
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    this.myPet=myPet;
    isMyPet=true;
    this.setHealth(myPet.getHealth());
  }
}

Fixed version (ground truth):
public void setMyPet(MyPet myPet){
  if (myPet != null) {
    this.myPet=myPet;
    isMyPet=true;
    ((LivingEntity)this.getBukkitEntity()).setMaxHealth(myPet.getMaxHealth());
    this.setHealth(myPet.getHealth());
  }
}
Program: 187594
Project: 187594
Buggy source:
@Override public void upgrade(MyPetSkillTreeSkill upgrade,boolean quiet){
  if (upgrade instanceof HP) {
    if (upgrade.getProperties().hasKey("String_Node_Str")) {
      hpIncrease+=upgrade.getProperties().getInt("String_Node_Str");
      if (!quiet) {
        myPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str","String_Node_Str" + (MyPet.getStartHP(myPet.getClass()) + hpIncrease)));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void upgrade(MyPetSkillTreeSkill upgrade,boolean quiet){
  if (upgrade instanceof HP) {
    if (upgrade.getProperties().hasKey("String_Node_Str")) {
      hpIncrease+=upgrade.getProperties().getInt("String_Node_Str");
      if (getMyPet().status == PetState.Here) {
        getMyPet().getCraftPet().setMaxHealth(getMyPet().getMaxHealth());
      }
      if (!quiet) {
        myPet.sendMessageToOwner(MyPetUtil.setColors(MyPetLanguage.getString("String_Node_Str")).replace("String_Node_Str",myPet.petName).replace("String_Node_Str","String_Node_Str" + (MyPet.getStartHP(myPet.getClass()) + hpIncrease)));
      }
    }
  }
}
Program: 187595
Project: 187595
Buggy source:
public void schedule(){
  if (increaseHpBy > 0 && myPet.status == PetState.Here) {
    if (timeCounter-- <= 0) {
      timeCounter=healtregenTime - timeDecrease;
    }
  }
}

Fixed version (ground truth):
public void schedule(){
  if (increaseHpBy > 0 && myPet.status == PetState.Here) {
    if (timeCounter-- <= 0) {
      myPet.getCraftPet().getHandle().heal(increaseHpBy,EntityRegainHealthEvent.RegainReason.REGEN);
      timeCounter=healtregenTime - timeDecrease;
    }
  }
}
Program: 187596
Project: 187596
Buggy source:
public int getHungerValue(){
  return hunger;
}

Fixed version (ground truth):
public int getHungerValue(){
  if (MyPetConfig.hungerSystem) {
    return hunger;
  }
 else {
    return 100;
  }
}
Program: 187597
Project: 187597
Buggy source:
public void scheduleTask(){
  if (status != PetState.Despawned && getOwner().isOnline()) {
    if (skills.getSkills().size() > 0) {
      for (      MyPetGenericSkill skill : skills.getSkills()) {
        skill.schedule();
      }
    }
    if (status == PetState.Dead) {
      respawnTime--;
      if (respawnTime <= 0) {
        respawnPet();
      }
    }
    if (MyPetConfig.hungerSystem && hunger > 1 && hungerTime-- <= 0) {
      hunger--;
      hungerTime=MyPetConfig.hungerSystemTime;
    }
  }
}

Fixed version (ground truth):
public void scheduleTask(){
  if (status != PetState.Despawned && getOwner().isOnline()) {
    if (skills.getSkills().size() > 0) {
      for (      MyPetGenericSkill skill : skills.getSkills()) {
        skill.schedule();
      }
    }
    if (status == PetState.Dead) {
      respawnTime--;
      if (respawnTime <= 0) {
        respawnPet();
      }
    }
    if (MyPetConfig.hungerSystem && hunger > 1 && --hungerTime <= 0) {
      hunger--;
      hungerTime=MyPetConfig.hungerSystemTime;
    }
  }
}
Program: 187598
Project: 187598
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()) {
      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");
  }
}

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().toLowerCase()+ "String_Node_Str");
    skillTreeMobType=new MyPetSkillTreeMobType(mobType.getTypeName());
    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: 187602
Project: 187602
Buggy source:
public int getSize(){
  return this.datawatcher.getByte(16);
}

Fixed version (ground truth):
public int getSize(){
  int size=this.datawatcher.getByte(16);
  return size <= 0 ? 1 : size;
}
Program: 187603
Project: 187603
Buggy source:
public void setSize(int value){
  this.datawatcher.watch(16,(byte)value);
  Float[] entitySize=MyPet.getEntitySize(MyMagmaCube.class);
  this.a(entitySize[0] * value,entitySize[1] * value);
  ((MyMagmaCube)myPet).size=value;
}

Fixed version (ground truth):
public void setSize(int value){
  this.datawatcher.watch(16,new Byte((byte)value));
  Float[] entitySize=MyPet.getEntitySize(MyMagmaCube.class);
  this.a(entitySize[0] * value,entitySize[1] * value);
  ((MyMagmaCube)myPet).size=value;
}
Program: 187604
Project: 187604
Buggy source:
public int getSize(){
  return this.datawatcher.getByte(16);
}

Fixed version (ground truth):
public int getSize(){
  int size=this.datawatcher.getByte(16);
  return size <= 0 ? 1 : size;
}
Program: 187605
Project: 187605
Buggy source:
public void setSize(int value){
  this.datawatcher.watch(16,(byte)value);
  Float[] entitySize=MyPet.getEntitySize(MySlime.class);
  this.a(entitySize[0] * value,entitySize[1] * value);
  ((MySlime)myPet).size=value;
}

Fixed version (ground truth):
public void setSize(int value){
  this.datawatcher.watch(16,new Byte((byte)value));
  Float[] entitySize=MyPet.getEntitySize(MySlime.class);
  this.a(entitySize[0] * value,entitySize[1] * value);
  ((MySlime)myPet).size=value;
}
Program: 187606
Project: 187606
Buggy source:
public void j_(){
  super.j_();
  this.motY*=0.6000000238418579D;
  this.locY+=0.65;
}

Fixed version (ground truth):
public void j_(){
  super.j_();
  this.locY+=0.65;
}
Program: 187607
Project: 187607
Buggy source:
public boolean getPoison(){
  return random.nextDouble() <= level * chancePerLevel / 100;
}

Fixed version (ground truth):
public boolean getPoison(){
  return random.nextDouble() <= level * chancePerLevel / 100.;
}
Program: 187608
Project: 187608
Buggy source:
public int getSize(){
  return items.size();
}

Fixed version (ground truth):
public int getSize(){
  return size;
}
Program: 187609
Project: 187609
Buggy source:
public void setSize(int Size){
  this.size=Size;
  for (int i=items.size(); i < Size; i++) {
    items.add(i,null);
  }
}

Fixed version (ground truth):
public void setSize(int size){
  this.size=size;
  for (int i=items.size(); i < size; i++) {
    items.add(i,null);
  }
}
Program: 187610
Project: 187610
Buggy source:
public void e(){
  this.petEntity.getControllerLook().a(this.petEntity.getOwner(),10.0F,(float)this.petEntity.bp());
  if (this.petEntity.canMove()) {
    if (--this.setPathTimer <= 0) {
      this.setPathTimer=10;
      if (!this.nav.a(this.petEntity.getOwner(),this.walkSpeed)) {
        Location ownerLocation=this.petEntity.getMyPet().getOwner().getPlayer().getLocation();
        if (this.petEntity.e(this.petEntity.getOwner()) > this.teleportDistance && controlPathfinderGoal.moveTo == null && petEntity.goalTarget == null && MyPetUtil.canSpawn(ownerLocation,this.petEntity)) {
          this.petEntity.setPositionRotation(ownerLocation.getX(),ownerLocation.getY(),ownerLocation.getZ(),this.petEntity.yaw,this.petEntity.pitch);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void e(){
  this.petEntity.getControllerLook().a(this.petEntity.getOwner(),10.0F,(float)this.petEntity.bp());
  if (this.petEntity.canMove()) {
    if (--this.setPathTimer <= 0) {
      this.setPathTimer=10;
      if (!this.nav.a(this.petEntity.getOwner(),this.walkSpeed)) {
        Location ownerLocation=this.petEntity.getMyPet().getOwner().getPlayer().getLocation();
        if (this.petEntity.e(this.petEntity.getOwner()) > this.teleportDistance && controlPathfinderGoal.moveTo == null && petEntity.goalTarget == null && MyPetUtil.canSpawn(ownerLocation,this.petEntity)) {
          this.petEntity.setPositionRotation(ownerLocation.getX(),ownerLocation.getY(),ownerLocation.getZ(),this.petEntity.yaw,this.petEntity.pitch);
          this.nav.a(this.petEntity.getOwner(),this.walkSpeed);
        }
      }
    }
  }
}
Program: 187611
Project: 187611
Buggy source:
@Override public void schedule(){
  if (level > 0 && pickup && myPet.status == PetState.Here && myPet.getSkills().getSkillLevel("String_Node_Str") > 0) {
    for (    Entity e : myPet.getCraftPet().getNearbyEntities(level * rangePerLevel,level * rangePerLevel,rangePerLevel)) {
      if (e instanceof Item) {
        Item item=(Item)e;
        PlayerPickupItemEvent playerPickupEvent=new PlayerPickupItemEvent(myPet.getOwner().getPlayer(),item,item.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(playerPickupEvent);
        if (playerPickupEvent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)myPet.getSkills().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(),myPet.getCraftPet().getEntityId()));
            }
          }
          e.remove();
        }
 else {
          item.getItemStack().setAmount(itemAmount);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void schedule(){
  if (level > 0 && pickup && myPet.status == PetState.Here && myPet.getSkills().getSkillLevel("String_Node_Str") > 0) {
    for (    Entity e : myPet.getCraftPet().getNearbyEntities(level * rangePerLevel,rangePerLevel,level * rangePerLevel)) {
      if (e instanceof Item) {
        Item item=(Item)e;
        PlayerPickupItemEvent playerPickupEvent=new PlayerPickupItemEvent(myPet.getOwner().getPlayer(),item,item.getItemStack().getAmount());
        MyPetUtil.getServer().getPluginManager().callEvent(playerPickupEvent);
        if (playerPickupEvent.isCancelled()) {
          continue;
        }
        MyPetCustomInventory inv=((Inventory)myPet.getSkills().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(),myPet.getCraftPet().getEntityId()));
            }
          }
          e.remove();
        }
 else {
          item.getItemStack().setAmount(itemAmount);
        }
      }
    }
  }
}
Program: 187612
Project: 187612
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyChicken)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));
  }
  ((MyChicken)myPet).isBaby=flag;
}
Program: 187613
Project: 187613
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyCow)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));
  }
  ((MyCow)myPet).isBaby=flag;
}
Program: 187614
Project: 187614
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyMooshroom)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));
  }
  ((MyMooshroom)myPet).isBaby=flag;
}
Program: 187615
Project: 187615
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyOcelot)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));
  }
  ((MyOcelot)myPet).isBaby=flag;
}
Program: 187616
Project: 187616
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MyPig)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));
  }
  ((MyPig)myPet).isBaby=flag;
}
Program: 187617
Project: 187617
Buggy source:
public void setBaby(boolean flag){
  if (flag) {
    this.datawatcher.watch(12,-1);
  }
 else {
    this.datawatcher.watch(12,0);
  }
  ((MySheep)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));
  }
  ((MySheep)myPet).isBaby=flag;
}