Skip to content

Improve duplicate Id with different associated object error message #293

Description

@moutyque

Hello,
Working with Jackson I fell upon this exception:

throw new IllegalStateException("Already had POJO for id (" + id.key.getClass().getName() + ") [" + id

It gave me a hard time to understand the issue until I look into the code.
IMO the exception message is unclear. The issue is that we Already had POJO for id and the new and old object are different (the second part is no explicit in the exception hence can be tricky to debug.

Propostion:

throw new IllegalStateException("Different POJO share the same id (" + id.key.getClass().getName() + ") [" + id
                        + "]");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions