Program: 187513
Project: 187513
Buggy source:
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    return true;
  }
  Player player=(Player)sender;
  if (MyPetList.hasMyPet(player)) {
    final MyPet myPet=MyPetList.getMyPet(player);
    final MyPetPlayer myPetOwner=myPet.getOwner();
    if (Configuration.AUTOMATIC_SKILLTREE_ASSIGNMENT && !myPet.getOwner().isMyPetAdmin()) {
      myPet.autoAssignSkilltree();
      sender.sendMessage(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()));
    }
 else     if (myPet.getSkillTree() != null && Configuration.CHOOSE_SKILLTREE_ONLY_ONCE && !myPet.getOwner().isMyPetAdmin()) {
      sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),myPet.getPetName()));
    }
 else     if (SkillTreeMobType.hasMobType(myPet.getPetType().getTypeName())) {
      SkillTreeMobType skillTreeMobType=SkillTreeMobType.getMobTypeByName(myPet.getPetType().getTypeName());
      if (args.length >= 1) {
        String skilltreeName="String_Node_Str";
        for (        String arg : args) {
          skilltreeName+=arg + "String_Node_Str";
        }
        skilltreeName=skilltreeName.substring(0,skilltreeName.length() - 1);
        if (skillTreeMobType.hasSkillTree(skilltreeName)) {
          SkillTree skillTree=skillTreeMobType.getSkillTree(skilltreeName);
          if (Permissions.has(player,"String_Node_Str" + skillTree.getPermission())) {
            int requiredLevel=skillTree.getRequiredLevel();
            if (requiredLevel > 1 && myPet.getExperience().getLevel() < requiredLevel) {
              myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",player),myPet.getPetName(),requiredLevel));
            }
 else             if (myPet.setSkilltree(skillTree)) {
              sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skillTree.getName()));
              if (myPet.getOwner().isMyPetAdmin() && Configuration.SKILLTREE_SWITCH_PENALTY_ADMIN) {
                myPet.getExperience().removeExp(Configuration.SKILLTREE_SWITCH_PENALTY_FIXED);
                myPet.getExperience().removeExp(myPet.getExperience().getExp() * Configuration.SKILLTREE_SWITCH_PENALTY_PERCENT / 100.);
              }
 else {
                myPet.getExperience().removeExp(Configuration.SKILLTREE_SWITCH_PENALTY_FIXED);
                myPet.getExperience().removeExp(myPet.getExperience().getExp() * Configuration.SKILLTREE_SWITCH_PENALTY_PERCENT / 100.);
              }
            }
 else {
              sender.sendMessage(Locales.getString("String_Node_Str",player));
            }
          }
 else {
            sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skilltreeName));
          }
        }
 else {
          sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skilltreeName));
        }
      }
 else {
        List<SkillTree> availableSkilltrees=new ArrayList<SkillTree>();
        for (        SkillTree skillTree : skillTreeMobType.getSkillTrees()) {
          if (Permissions.has(player,"String_Node_Str" + skillTree.getPermission())) {
            availableSkilltrees.add(skillTree);
          }
        }
        if (availableSkilltrees.size() == 0) {
          sender.sendMessage(Locales.getString("String_Node_Str",player));
          return true;
        }
        final Map<Integer,SkillTree> skilltreeSlotMap=new HashMap<Integer,SkillTree>();
        IconMenu menu=new IconMenu(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),myPet.getPetName()),(int)(Math.ceil(availableSkilltrees.size() / 9.) * 9),new IconMenu.OptionClickEventHandler(){
          @Override public void onOptionClick(          IconMenu.OptionClickEvent event){
            if (myPet != myPetOwner.getMyPet()) {
              event.setWillClose(true);
              event.setWillDestroy(true);
              return;
            }
            if (skilltreeSlotMap.containsKey(event.getPosition())) {
              SkillTree selecedSkilltree=skilltreeSlotMap.get(event.getPosition());
              if (selecedSkilltree != null) {
                int requiredLevel=selecedSkilltree.getRequiredLevel();
                if (requiredLevel > 1 && myPet.getExperience().getLevel() < requiredLevel) {
                  myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),myPet.getPetName(),requiredLevel));
                }
 else                 if (myPet.setSkilltree(selecedSkilltree)) {
                  myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),selecedSkilltree.getName()));
                }
 else {
                  myPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPetOwner));
                }
              }
            }
            event.setWillClose(true);
            event.setWillDestroy(true);
          }
        }
,MyPetPlugin.getPlugin());
        for (int i=0; i < availableSkilltrees.size(); i++) {
          SkillTree addedSkilltree=availableSkilltrees.get(i);
          CompoundTag tag=addedSkilltree.getIconItem();
          net.minecraft.server.v1_6_R3.ItemStack is=ItemStackNBTConverter.CompundToItemStack(tag);
          ItemStack shownItem=CraftItemStack.asCraftMirror(is);
          boolean selectable=false;
          int requiredLevel=addedSkilltree.getRequiredLevel();
          if (requiredLevel > 1) {
            selectable=myPet.getExperience().getLevel() >= addedSkilltree.getRequiredLevel();
          }
          int requireOffset=requiredLevel > 1 ? 1 : 0;
          String[] descriptionArray=new String[addedSkilltree.getDescription().size() + requireOffset];
          if (requireOffset == 1) {
            descriptionArray[0]=ChatColor.RESET + "String_Node_Str";
            if (selectable) {
              descriptionArray[0]+=ChatColor.GREEN;
            }
 else {
              descriptionArray[0]+=ChatColor.DARK_RED;
            }
            descriptionArray[0]+=Util.formatText(Locales.getString("String_Node_Str",myPetOwner),requiredLevel) + ChatColor.RESET + "String_Node_Str";
          }
          for (int j=requireOffset; j < addedSkilltree.getDescription().size() + requireOffset; j++) {
            descriptionArray[j]=ChatColor.RESET + Colorizer.setColors(String.valueOf(addedSkilltree.getDescription().get(j)));
          }
          menu.setOption(i,shownItem,ChatColor.RESET + "String_Node_Str" + ChatColor.DARK_GREEN+ addedSkilltree.getDisplayName()+ ChatColor.RESET+ "String_Node_Str",descriptionArray);
          skilltreeSlotMap.put(i,addedSkilltree);
        }
        menu.open(player);
      }
    }
  }
 else {
    sender.sendMessage(Locales.getString("String_Node_Str",player));
  }
  return true;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    return true;
  }
  Player player=(Player)sender;
  if (MyPetList.hasMyPet(player)) {
    final MyPet myPet=MyPetList.getMyPet(player);
    final MyPetPlayer myPetOwner=myPet.getOwner();
    if (Configuration.AUTOMATIC_SKILLTREE_ASSIGNMENT && !myPet.getOwner().isMyPetAdmin()) {
      myPet.autoAssignSkilltree();
      sender.sendMessage(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()));
    }
 else     if (myPet.getSkillTree() != null && Configuration.CHOOSE_SKILLTREE_ONLY_ONCE && !myPet.getOwner().isMyPetAdmin()) {
      sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),myPet.getPetName()));
    }
 else     if (SkillTreeMobType.hasMobType(myPet.getPetType().getTypeName())) {
      SkillTreeMobType skillTreeMobType=SkillTreeMobType.getMobTypeByName(myPet.getPetType().getTypeName());
      if (args.length >= 1) {
        String skilltreeName="String_Node_Str";
        for (        String arg : args) {
          skilltreeName+=arg + "String_Node_Str";
        }
        skilltreeName=skilltreeName.substring(0,skilltreeName.length() - 1);
        if (skillTreeMobType.hasSkillTree(skilltreeName)) {
          SkillTree skillTree=skillTreeMobType.getSkillTree(skilltreeName);
          if (Permissions.has(player,"String_Node_Str" + skillTree.getPermission())) {
            int requiredLevel=skillTree.getRequiredLevel();
            if (requiredLevel > 1 && myPet.getExperience().getLevel() < requiredLevel) {
              myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",player),myPet.getPetName(),requiredLevel));
            }
 else             if (myPet.setSkilltree(skillTree)) {
              sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skillTree.getName()));
              if (myPet.getOwner().isMyPetAdmin() && Configuration.SKILLTREE_SWITCH_PENALTY_ADMIN) {
                myPet.getExperience().removeExp(Configuration.SKILLTREE_SWITCH_PENALTY_FIXED);
                myPet.getExperience().removeExp(myPet.getExperience().getExp() * Configuration.SKILLTREE_SWITCH_PENALTY_PERCENT / 100.);
              }
 else {
                myPet.getExperience().removeExp(Configuration.SKILLTREE_SWITCH_PENALTY_FIXED);
                myPet.getExperience().removeExp(myPet.getExperience().getExp() * Configuration.SKILLTREE_SWITCH_PENALTY_PERCENT / 100.);
              }
            }
 else {
              sender.sendMessage(Locales.getString("String_Node_Str",player));
            }
          }
 else {
            sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skilltreeName));
          }
        }
 else {
          sender.sendMessage(Util.formatText(Locales.getString("String_Node_Str",player),skilltreeName));
        }
      }
 else {
        List<SkillTree> availableSkilltrees=new ArrayList<SkillTree>();
        for (        SkillTree skillTree : skillTreeMobType.getSkillTrees()) {
          if (Permissions.has(player,"String_Node_Str" + skillTree.getPermission())) {
            availableSkilltrees.add(skillTree);
          }
        }
        if (availableSkilltrees.size() == 0) {
          sender.sendMessage(Locales.getString("String_Node_Str",player));
          return true;
        }
        final Map<Integer,SkillTree> skilltreeSlotMap=new HashMap<Integer,SkillTree>();
        IconMenu menu=new IconMenu(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),myPet.getPetName()),(int)(Math.ceil(availableSkilltrees.size() / 9.) * 9),new IconMenu.OptionClickEventHandler(){
          @Override public void onOptionClick(          IconMenu.OptionClickEvent event){
            if (myPet != myPetOwner.getMyPet()) {
              event.setWillClose(true);
              event.setWillDestroy(true);
              return;
            }
            if (skilltreeSlotMap.containsKey(event.getPosition())) {
              SkillTree selecedSkilltree=skilltreeSlotMap.get(event.getPosition());
              if (selecedSkilltree != null) {
                int requiredLevel=selecedSkilltree.getRequiredLevel();
                if (requiredLevel > 1 && myPet.getExperience().getLevel() < requiredLevel) {
                  myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),myPet.getPetName(),requiredLevel));
                }
 else                 if (myPet.setSkilltree(selecedSkilltree)) {
                  myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPetOwner),selecedSkilltree.getName()));
                }
 else {
                  myPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPetOwner));
                }
              }
            }
            event.setWillClose(true);
            event.setWillDestroy(true);
          }
        }
,MyPetPlugin.getPlugin());
        for (int i=0; i < availableSkilltrees.size(); i++) {
          SkillTree addedSkilltree=availableSkilltrees.get(i);
          CompoundTag tag=addedSkilltree.getIconItem();
          net.minecraft.server.v1_6_R3.ItemStack is=ItemStackNBTConverter.CompundToItemStack(tag);
          ItemStack shownItem=CraftItemStack.asCraftMirror(is);
          boolean selectable=false;
          int requiredLevel=addedSkilltree.getRequiredLevel();
          if (requiredLevel > 1) {
            selectable=myPet.getExperience().getLevel() >= addedSkilltree.getRequiredLevel();
          }
          int requireOffset=requiredLevel > 1 ? 1 : 0;
          String[] descriptionArray=new String[addedSkilltree.getDescription().size() + requireOffset];
          if (requireOffset == 1) {
            descriptionArray[0]=ChatColor.RESET + "String_Node_Str";
            if (selectable) {
              descriptionArray[0]+=ChatColor.GREEN;
            }
 else {
              descriptionArray[0]+=ChatColor.DARK_RED;
            }
            descriptionArray[0]+=Util.formatText(Locales.getString("String_Node_Str",myPetOwner),requiredLevel) + ChatColor.RESET + "String_Node_Str";
          }
          for (int j=0; j < addedSkilltree.getDescription().size(); j++) {
            descriptionArray[j + requireOffset]=ChatColor.RESET + Colorizer.setColors(String.valueOf(addedSkilltree.getDescription().get(j)));
          }
          menu.setOption(i,shownItem,ChatColor.RESET + "String_Node_Str" + ChatColor.DARK_GREEN+ addedSkilltree.getDisplayName()+ ChatColor.RESET+ "String_Node_Str",descriptionArray);
          skilltreeSlotMap.put(i,addedSkilltree);
        }
        menu.open(player);
      }
    }
  }
 else {
    sender.sendMessage(Locales.getString("String_Node_Str",player));
  }
  return true;
}