Skip to content

Fix IllegalStateException in OwnerController.getOwnerPetsMap-created-by-agentic #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

shaykeren
Copy link

This PR fixes the IllegalStateException occurring in the OwnerController.getOwnerPetsMap method by properly handling cases where an owner has multiple pets.

Changes made:

  • Modified the stream collection operation to use Collectors.groupingBy instead of toMap
  • Updated the collection logic to properly handle multiple pets per owner by collecting pet IDs into a List
  • This change allows the method to work correctly when an owner has multiple pets

The fix addresses the root cause of the IllegalStateException by properly handling the one-to-many relationship between owners and their pets.

Related Error ID: 18552480-4449-11f0-ac74-0242ac160004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants