Program: 187533
Project: 187533
Buggy source:
@SuppressWarnings("String_Node_Str") @EventHandler public void onEntityDeath(final EntityDeathEvent event){
  if (MyPetConfiguration.USE_LEVEL_SYSTEM) {
    if (!MyPetExperience.GAIN_EXP_FROM_MONSTER_SPAWNER_MOBS && event.getEntity().hasMetadata("String_Node_Str")) {
      for (      MetadataValue value : event.getEntity().getMetadata("String_Node_Str")) {
        if (value.getOwningPlugin() == MyPetPlugin.getPlugin()) {
          if (value.asBoolean()) {
            return;
          }
          break;
        }
      }
    }
    if (MyPetExperience.DAMAGE_WEIGHTED_EXPERIENCE_DISTRIBUTION) {
      Map<Entity,Double> damagePercentMap=MyPetExperience.getDamageToEntityPercent(event.getEntity());
      for (      Entity entity : damagePercentMap.keySet()) {
        if (entity instanceof CraftMyPet) {
          MyPet myPet=((CraftMyPet)entity).getMyPet();
          if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
            continue;
          }
          double randomExp=MyPetMonsterExperience.getMonsterExperience(event.getEntity().getType()).getRandomExp();
          myPet.getExperience().addExp(damagePercentMap.get(entity) * randomExp);
        }
 else         if (entity instanceof Player) {
          Player owner=(Player)entity;
          if (MyPetList.hasMyPet(owner)) {
            MyPet myPet=MyPetList.getMyPet(owner);
            if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
              return;
            }
            if (myPet.isPassiv()) {
              if (myPet.getStatus() == PetState.Here) {
                double randomExp=MyPetMonsterExperience.getMonsterExperience(event.getEntity().getType()).getRandomExp();
                myPet.getExperience().addExp(damagePercentMap.get(entity) * randomExp);
              }
            }
          }
        }
      }
    }
 else     if (event.getEntity().getLastDamageCause() instanceof EntityDamageByEntityEvent) {
      EntityDamageByEntityEvent edbee=(EntityDamageByEntityEvent)event.getEntity().getLastDamageCause();
      if (edbee.getDamager() instanceof CraftMyPet) {
        MyPet myPet=((CraftMyPet)edbee.getDamager()).getMyPet();
        if (myPet.getSkillTree() == null && MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE) {
          return;
        }
        myPet.getExperience().addExp(edbee.getEntity().getType());
      }
 else       if (edbee.getDamager() instanceof Player) {
        Player owner=(Player)edbee.getDamager();
        if (MyPetList.hasMyPet(owner)) {
          MyPet myPet=MyPetList.getMyPet(owner);
          if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
            return;
          }
          if (myPet.isPassiv()) {
            if (myPet.getStatus() == PetState.Here) {
              myPet.getExperience().addExp(event.getEntity().getType(),MyPetConfiguration.PASSIVE_PERCENT_PER_MONSTER);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @EventHandler public void onEntityDeath(final EntityDeathEvent event){
  if (MyPetConfiguration.USE_LEVEL_SYSTEM) {
    LivingEntity deadEntity=event.getEntity();
    if (deadEntity instanceof CraftMyPet) {
      return;
    }
    if (!MyPetExperience.GAIN_EXP_FROM_MONSTER_SPAWNER_MOBS && event.getEntity().hasMetadata("String_Node_Str")) {
      for (      MetadataValue value : event.getEntity().getMetadata("String_Node_Str")) {
        if (value.getOwningPlugin().getName().equals(MyPetPlugin.getPlugin().getName())) {
          if (value.asBoolean()) {
            return;
          }
          break;
        }
      }
    }
    if (MyPetExperience.DAMAGE_WEIGHTED_EXPERIENCE_DISTRIBUTION) {
      Map<Entity,Double> damagePercentMap=MyPetExperience.getDamageToEntityPercent(deadEntity);
      for (      Entity entity : damagePercentMap.keySet()) {
        if (entity instanceof CraftMyPet) {
          MyPet myPet=((CraftMyPet)entity).getMyPet();
          if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
            continue;
          }
          double randomExp=MyPetMonsterExperience.getMonsterExperience(deadEntity.getType()).getRandomExp();
          myPet.getExperience().addExp(damagePercentMap.get(entity) * randomExp);
        }
 else         if (entity instanceof Player) {
          Player owner=(Player)entity;
          if (MyPetList.hasMyPet(owner)) {
            MyPet myPet=MyPetList.getMyPet(owner);
            if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
              return;
            }
            if (myPet.isPassiv()) {
              if (myPet.getStatus() == PetState.Here) {
                double randomExp=MyPetMonsterExperience.getMonsterExperience(deadEntity.getType()).getRandomExp();
                myPet.getExperience().addExp(damagePercentMap.get(entity) * randomExp);
              }
            }
          }
        }
      }
    }
 else     if (deadEntity.getLastDamageCause() instanceof EntityDamageByEntityEvent) {
      EntityDamageByEntityEvent edbee=(EntityDamageByEntityEvent)deadEntity.getLastDamageCause();
      if (edbee.getDamager() instanceof CraftMyPet) {
        MyPet myPet=((CraftMyPet)edbee.getDamager()).getMyPet();
        if (myPet.getSkillTree() == null && MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE) {
          return;
        }
        myPet.getExperience().addExp(edbee.getEntity().getType());
      }
 else       if (edbee.getDamager() instanceof Player) {
        Player owner=(Player)edbee.getDamager();
        if (MyPetList.hasMyPet(owner)) {
          MyPet myPet=MyPetList.getMyPet(owner);
          if (MyPetConfiguration.PREVENT_LEVELLING_WITHOUT_SKILLTREE && myPet.getSkillTree() == null) {
            return;
          }
          if (myPet.isPassiv()) {
            if (myPet.getStatus() == PetState.Here) {
              myPet.getExperience().addExp(deadEntity.getType(),MyPetConfiguration.PASSIVE_PERCENT_PER_MONSTER);
            }
          }
        }
      }
    }
  }
}