Program: 45018
Project: 45018
Buggy source:
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed() && wolf.getOwner().equals(player)) {
        Material item=player.getItemInHand().getType();
        if (item.equals(Material.BONE)) {
          if (plugin.hasPermissions(player,"String_Node_Str")) {
            if (!wolfManager.hasWolf(wolf.getUniqueId())) {
              wolfManager.addWolf(wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getUniqueId()));
              player.sendMessage("String_Node_Str" + wolf.getUniqueId() + "String_Node_Str"+ wolfManager.getWolfTable(wolf.getUniqueId()).getId());
            }
            selectedWolfManager.addSelectedWolf(player.getName(),wolf);
            player.sendMessage(ChatColor.GREEN + "String_Node_Str");
          }
        }
 else         if (item.equals(Material.CHEST)) {
          if (plugin.hasPermissions(player,"String_Node_Str")) {
            if (wolfManager.hasWolf(wolf.getUniqueId())) {
              if (wolfManager.hasInventory(wolf.getUniqueId())) {
                WolfTable wt=wolfManager.getWolfTable(wolf.getUniqueId());
                EntityPlayer entityPlayer=((CraftPlayer)player).getHandle();
                entityPlayer.a(plugin.getWolfInventoryManager().getWolfInventory(wt.getId()).getInventory());
                wolf.setSitting(true);
              }
 else {
                player.getInventory().remove(new ItemStack(Material.CHEST,1));
              }
            }
 else {
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed() && wolf.getOwner().equals(player)) {
        Material item=player.getItemInHand().getType();
        if (item.equals(Material.BONE)) {
          if (plugin.hasPermissions(player,"String_Node_Str")) {
            if (!wolfManager.hasWolf(wolf.getUniqueId())) {
              wolfManager.addWolf(wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getUniqueId()));
              player.sendMessage("String_Node_Str" + wolf.getUniqueId() + "String_Node_Str"+ wolfManager.getWolfTable(wolf.getUniqueId()).getId());
            }
            selectedWolfManager.addSelectedWolf(player.getName(),wolf);
            player.sendMessage(ChatColor.GREEN + "String_Node_Str");
          }
        }
 else         if (item.equals(Material.CHEST)) {
          if (plugin.hasPermissions(player,"String_Node_Str")) {
            if (wolfManager.hasWolf(wolf.getUniqueId())) {
              if (wolfManager.hasInventory(wolf.getUniqueId())) {
                WolfTable wt=wolfManager.getWolfTable(wolf.getUniqueId());
                EntityPlayer entityPlayer=((CraftPlayer)player).getHandle();
                entityPlayer.a(plugin.getWolfInventoryManager().getWolfInventory(wt.getId()).getInventory());
                wolf.setSitting(!wolf.isSitting());
              }
 else {
                wolfManager.addInventory(wolf.getUniqueId());
                player.getInventory().remove(new ItemStack(Material.CHEST,1));
              }
            }
 else {
            }
          }
        }
      }
    }
  }
}