Skip to content
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

ConvertibleType declaration in IdentifierToPrimitivesConverter overly specific #246

Closed
odrotbohm opened this issue Jul 8, 2024 · 0 comments
Assignees
Labels
module: spring Spring runtime integration type: bug Bug
Milestone

Comments

@odrotbohm
Copy link
Member

The detailed declaration of both UUID and String as target conversion types in IdentifierToPrimitivesConverter.getConvertibleTypes() causes problems in Spring Data's CustomConversions as it uses the pairs here to allow clients to detect the target type that will ultimately be handed into the convert(…) method.

This causes issues if the UUID type is returned first, as Identifiers using a sole String will try to be erroneously coerced into a UUID as reported here. Using String as the first value will always cause UUIDs to be rendered as String, even though a store might be able to persist UUIDs directly.

We should rather only return new ConvertiblePair(Identifier.class, Object.class) to delay the decision of which type to use to the actual conversion step.

Related tickets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: spring Spring runtime integration type: bug Bug
Projects
None yet
Development

No branches or pull requests

1 participant