Program: 187499
Project: 187499
Buggy source:
@Override public boolean onCommandOption(CommandSender sender,String[] args){
  if (args.length < 2) {
    return false;
  }
  String lang=BukkitUtil.getCommandSenderLanguage(sender);
  int forceOffset=0;
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    forceOffset=1;
  }
  MyPetType myPetType=MyPetType.getMyPetTypeByName(args[1 + forceOffset]);
  if (myPetType != null) {
    Player owner=Bukkit.getPlayer(args[forceOffset]);
    if (owner == null || !owner.isOnline()) {
      sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ Locales.getString("String_Node_Str",lang));
      return true;
    }
    MyPetPlayer newOwner=MyPetPlayer.getOrCreateMyPetPlayer(owner);
    if (newOwner.hasMyPet() && forceOffset == 1) {
      MyPetList.setMyPetInactive(newOwner);
    }
    if (!newOwner.hasMyPet()) {
      InactiveMyPet inactiveMyPet=new InactiveMyPet(newOwner);
      inactiveMyPet.setPetType(myPetType);
      inactiveMyPet.setPetName(Locales.getString("String_Node_Str" + inactiveMyPet.getPetType().getTypeName(),inactiveMyPet.getOwner().getLanguage()));
      TagCompound TagCompound=inactiveMyPet.getInfo();
      if (args.length > 2 + forceOffset) {
        for (int i=2 + forceOffset; i < args.length; i++) {
          if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String size=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(size)) {
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(Integer.parseInt(size)));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String horseTypeString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(horseTypeString)) {
              int horseType=Integer.parseInt(horseTypeString);
              horseType=Math.min(Math.max(0,horseType),4);
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte((byte)horseType));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String variantString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(variantString)) {
              int variant=Integer.parseInt(variantString);
              if (myPetType == MyPetType.Horse) {
                variant=Math.min(Math.max(0,variant),1030);
              }
 else               if (myPetType == MyPetType.Rabbit) {
                if (variant != 99 && (variant > 5 || variant < 0)) {
                  variant=0;
                }
              }
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(variant));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String catTypeString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(catTypeString)) {
              int catType=Integer.parseInt(catTypeString);
              catType=Math.min(Math.max(0,catType),3);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(catType));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String professionString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(professionString)) {
              int profession=Integer.parseInt(professionString);
              profession=Math.min(Math.max(0,profession),5);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(profession));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String colorString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(colorString)) {
              byte color=Byte.parseByte(colorString);
              color=color > 15 ? 15 : color < 0 ? 0 : color;
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte(color));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String colorString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(colorString)) {
              byte color=Byte.parseByte(colorString);
              color=color > 15 ? 15 : color < 0 ? 0 : color;
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte(color));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String blocks=args[i].replace("String_Node_Str","String_Node_Str");
            String[] blockInfo=blocks.split("String_Node_Str");
            if (blockInfo.length >= 1 && Util.isInt(blockInfo[0]) && BukkitUtil.isValidMaterial(Integer.parseInt(blockInfo[0]))) {
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(Integer.parseInt(blockInfo[0])));
            }
            if (blockInfo.length >= 2 && Util.isInt(blockInfo[1])) {
              int blockData=Integer.parseInt(blockInfo[1]);
              blockData=Math.min(Math.max(0,blockData),15);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(blockData));
            }
          }
 else {
            sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ args[i]+ "String_Node_Str");
          }
        }
      }
      WorldGroup wg=WorldGroup.getGroupByWorld(owner.getWorld().getName());
      inactiveMyPet.setWorldGroup(wg.getName());
      inactiveMyPet.getOwner().setMyPetForWorldGroup(wg.getName(),inactiveMyPet.getUUID());
      MyPetList.addInactiveMyPet(inactiveMyPet);
      MyPet myPet=MyPetList.setMyPetActive(inactiveMyPet);
      if (myPet != null) {
        myPet.createPet();
        sender.sendMessage(Locales.getString("String_Node_Str",sender));
      }
 else {
        sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ newOwner.getName()+ "String_Node_Str");
      }
    }
 else {
      sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ newOwner.getName()+ "String_Node_Str");
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommandOption(CommandSender sender,String[] args){
  if (args.length < 2) {
    return false;
  }
  String lang=BukkitUtil.getCommandSenderLanguage(sender);
  int forceOffset=0;
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    forceOffset=1;
  }
  MyPetType myPetType=MyPetType.getMyPetTypeByName(args[1 + forceOffset]);
  if (myPetType != null) {
    Player owner=Bukkit.getPlayer(args[forceOffset]);
    if (owner == null || !owner.isOnline()) {
      sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ Locales.getString("String_Node_Str",lang));
      return true;
    }
    MyPetPlayer newOwner=MyPetPlayer.getOrCreateMyPetPlayer(owner);
    if (newOwner.hasMyPet() && forceOffset == 1) {
      MyPetList.setMyPetInactive(newOwner);
    }
    if (!newOwner.hasMyPet()) {
      InactiveMyPet inactiveMyPet=new InactiveMyPet(newOwner);
      inactiveMyPet.setPetType(myPetType);
      inactiveMyPet.setPetName(Locales.getString("String_Node_Str" + inactiveMyPet.getPetType().getTypeName(),inactiveMyPet.getOwner().getLanguage()));
      TagCompound TagCompound=inactiveMyPet.getInfo();
      if (args.length > 2 + forceOffset) {
        for (int i=2 + forceOffset; i < args.length; i++) {
          if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].equalsIgnoreCase("String_Node_Str")) {
            TagCompound.getCompoundData().put("String_Node_Str",new TagByte(true));
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String size=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(size)) {
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(Integer.parseInt(size)));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String horseTypeString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(horseTypeString)) {
              int horseType=Integer.parseInt(horseTypeString);
              horseType=Math.min(Math.max(0,horseType),4);
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte((byte)horseType));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String variantString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(variantString)) {
              int variant=Integer.parseInt(variantString);
              if (myPetType == MyPetType.Horse) {
                variant=Math.min(Math.max(0,variant),1030);
                TagCompound.getCompoundData().put("String_Node_Str",new TagInt(variant));
              }
 else               if (myPetType == MyPetType.Rabbit) {
                if (variant != 99 && (variant > 5 || variant < 0)) {
                  variant=0;
                }
                TagCompound.getCompoundData().put("String_Node_Str",new TagByte(variant));
              }
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String catTypeString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(catTypeString)) {
              int catType=Integer.parseInt(catTypeString);
              catType=Math.min(Math.max(0,catType),3);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(catType));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String professionString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isInt(professionString)) {
              int profession=Integer.parseInt(professionString);
              profession=Math.min(Math.max(0,profession),5);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(profession));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String colorString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(colorString)) {
              byte color=Byte.parseByte(colorString);
              color=color > 15 ? 15 : color < 0 ? 0 : color;
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte(color));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String colorString=args[i].replace("String_Node_Str","String_Node_Str");
            if (Util.isByte(colorString)) {
              byte color=Byte.parseByte(colorString);
              color=color > 15 ? 15 : color < 0 ? 0 : color;
              TagCompound.getCompoundData().put("String_Node_Str",new TagByte(color));
            }
          }
 else           if (args[i].startsWith("String_Node_Str")) {
            String blocks=args[i].replace("String_Node_Str","String_Node_Str");
            String[] blockInfo=blocks.split("String_Node_Str");
            if (blockInfo.length >= 1 && Util.isInt(blockInfo[0]) && BukkitUtil.isValidMaterial(Integer.parseInt(blockInfo[0]))) {
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(Integer.parseInt(blockInfo[0])));
            }
            if (blockInfo.length >= 2 && Util.isInt(blockInfo[1])) {
              int blockData=Integer.parseInt(blockInfo[1]);
              blockData=Math.min(Math.max(0,blockData),15);
              TagCompound.getCompoundData().put("String_Node_Str",new TagInt(blockData));
            }
          }
 else {
            sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ args[i]+ "String_Node_Str");
          }
        }
      }
      WorldGroup wg=WorldGroup.getGroupByWorld(owner.getWorld().getName());
      inactiveMyPet.setWorldGroup(wg.getName());
      inactiveMyPet.getOwner().setMyPetForWorldGroup(wg.getName(),inactiveMyPet.getUUID());
      MyPetList.addInactiveMyPet(inactiveMyPet);
      MyPet myPet=MyPetList.setMyPetActive(inactiveMyPet);
      if (myPet != null) {
        myPet.createPet();
        sender.sendMessage(Locales.getString("String_Node_Str",sender));
      }
 else {
        sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ newOwner.getName()+ "String_Node_Str");
      }
    }
 else {
      sender.sendMessage("String_Node_Str" + ChatColor.AQUA + "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ newOwner.getName()+ "String_Node_Str");
    }
  }
  return true;
}