Program: 187492
Project: 187492
Buggy source:
@EventHandler public void onPlayerJoin(final PlayerJoinEvent event){
  PlayerList.onlinePlayerUUIDList.add(event.getPlayer().getUniqueId());
  MyPetPlugin.getPlugin().getRepository().getMyPetPlayer(event.getPlayer(),new RepositoryCallback<MyPetPlayer>(){
    @Override public void callback(    final MyPetPlayer joinedPlayer){
      PlayerList.setOnline(joinedPlayer);
      if (BukkitUtil.isInOnlineMode()) {
        if (joinedPlayer instanceof OnlineMyPetPlayer) {
          ((OnlineMyPetPlayer)joinedPlayer).setLastKnownName(event.getPlayer().getName());
        }
      }
      final WorldGroup joinGroup=WorldGroup.getGroupByWorld(event.getPlayer().getWorld().getName());
      if (joinedPlayer.hasMyPet()) {
        MyPet myPet=joinedPlayer.getMyPet();
        if (!myPet.getWorldGroup().equals(joinGroup.getName())) {
          MyPetList.deactivateMyPet(joinedPlayer);
        }
      }
      if (joinGroup != null && !joinedPlayer.hasMyPet() && joinedPlayer.hasMyPetInWorldGroup(joinGroup.getName())) {
        final UUID groupMyPetUUID=joinedPlayer.getMyPetForWorldGroup(joinGroup.getName());
        joinedPlayer.getInactiveMyPets(new RepositoryCallback<List<InactiveMyPet>>(){
          @Override public void callback(          List<InactiveMyPet> value){
            for (            InactiveMyPet inactiveMyPet : value) {
              if (inactiveMyPet.getUUID().equals(groupMyPetUUID)) {
                MyPetList.activateMyPet(inactiveMyPet);
                MyPet activeMyPet=joinedPlayer.getMyPet();
                activeMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",joinedPlayer),activeMyPet.getPetName()));
                break;
              }
            }
            if (!joinedPlayer.hasMyPet() && value.size() > 0) {
              joinedPlayer.getPlayer().sendMessage(Locales.getString("String_Node_Str",joinedPlayer));
              joinedPlayer.setMyPetForWorldGroup(joinGroup.getName(),null);
            }
          }
        }
);
      }
      if (joinedPlayer.hasMyPet()) {
        final MyPet myPet=joinedPlayer.getMyPet();
        final MyPetPlayer myPetPlayer=myPet.getOwner();
        if (myPet.wantToRespawn()) {
          if (myPetPlayer.hasMyPet()) {
            MyPet runMyPet=myPetPlayer.getMyPet();
switch (runMyPet.createPet()) {
case Canceled:
              runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),runMyPet.getPetName()));
            break;
case NoSpace:
          runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),runMyPet.getPetName()));
        break;
case NotAllowed:
      runMyPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner()).replace("String_Node_Str",myPet.getPetName()));
    break;
case Dead:
  runMyPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner()).replace("String_Node_Str",myPet.getPetName()).replace("String_Node_Str","String_Node_Str" + myPet.getRespawnTime()));
break;
case Flying:
runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),myPet.getPetName()));
break;
case Success:
runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),runMyPet.getPetName()));
break;
}
}
}
 else {
myPet.setStatus(PetState.Despawned);
}
}
joinedPlayer.checkForDonation();
}
}
);
}

Fixed version (ground truth):
@EventHandler public void onPlayerJoin(final PlayerJoinEvent event){
  PlayerList.onlinePlayerUUIDList.add(event.getPlayer().getUniqueId());
  MyPetPlugin.getPlugin().getRepository().getMyPetPlayer(event.getPlayer(),new RepositoryCallback<MyPetPlayer>(){
    @Override public void callback(    final MyPetPlayer joinedPlayer){
      PlayerList.setOnline(joinedPlayer);
      if (BukkitUtil.isInOnlineMode()) {
        if (joinedPlayer instanceof OnlineMyPetPlayer) {
          ((OnlineMyPetPlayer)joinedPlayer).setLastKnownName(event.getPlayer().getName());
        }
      }
      final WorldGroup joinGroup=WorldGroup.getGroupByWorld(event.getPlayer().getWorld().getName());
      if (joinedPlayer.hasMyPet()) {
        MyPet myPet=joinedPlayer.getMyPet();
        if (!myPet.getWorldGroup().equals(joinGroup.getName())) {
          MyPetList.deactivateMyPet(joinedPlayer);
        }
      }
      if (joinGroup != null && !joinedPlayer.hasMyPet() && joinedPlayer.hasMyPetInWorldGroup(joinGroup.getName())) {
        final UUID groupMyPetUUID=joinedPlayer.getMyPetForWorldGroup(joinGroup.getName());
        joinedPlayer.getInactiveMyPet(groupMyPetUUID,new RepositoryCallback<InactiveMyPet>(){
          @Override public void callback(          InactiveMyPet inactiveMyPet){
            MyPetList.activateMyPet(inactiveMyPet);
            if (joinedPlayer.hasMyPet()) {
              final MyPet myPet=joinedPlayer.getMyPet();
              final MyPetPlayer myPetPlayer=myPet.getOwner();
              if (myPet.wantToRespawn()) {
                if (myPetPlayer.hasMyPet()) {
                  MyPet runMyPet=myPetPlayer.getMyPet();
switch (runMyPet.createPet()) {
case Canceled:
                    runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),runMyPet.getPetName()));
                  break;
case NoSpace:
                runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),runMyPet.getPetName()));
              break;
case NotAllowed:
            runMyPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner()).replace("String_Node_Str",myPet.getPetName()));
          break;
case Dead:
        runMyPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner()).replace("String_Node_Str",myPet.getPetName()).replace("String_Node_Str","String_Node_Str" + myPet.getRespawnTime()));
      break;
case Flying:
    runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),myPet.getPetName()));
  break;
case Success:
runMyPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),myPet.getPetName()));
break;
}
}
}
 else {
myPet.setStatus(PetState.Despawned);
}
}
}
}
);
}
joinedPlayer.checkForDonation();
}
}
);
}