-
Notifications
You must be signed in to change notification settings - Fork 682
Tighten the contract of PersistentPropertyPath
regarding nullability
#2813
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
Comments
odrotbohm
added a commit
to spring-projects/spring-data-mongodb
that referenced
this issue
Apr 4, 2023
…yPathAccessor. In preparation of spring-projects/spring-data-commons#2813 we're moving off the implementation of PersistentPropertyPathAccessor and rather only implement PersistenPropertyAccessor. Fixes #4354.
odrotbohm
added a commit
that referenced
this issue
Apr 4, 2023
Nullable annotations and Objects.equals(…) and Objects.hash(…)/Objects.hashCode(…). Records for internal cache key. Related issue: #2813.
odrotbohm
added a commit
that referenced
this issue
Apr 4, 2023
We should change the definition of `PersistentPropertyPath` to — in its public API — not allow empty instances anymore. Those violate the concept and bleed into the concept's API by having to make all methods nullable (returning null in exactly that "empty" case). An empty property path doesn't make any actual sense as you cannot reasonably answer the methods declared on the interface except by returning null, which then causes client code having to verify the returned values all the time. This is now changed into only making `PersistentPropertyPath.getParentPath()` nullable and letting it return null for single segment paths. Adapted client code accordingly. `….getRequiredLeadProperty()` is now deprecated in favour of `….getLeafProperty()` not returning null anymore. Fixes #2813.
odrotbohm
added a commit
that referenced
this issue
Apr 4, 2023
Nullable annotations and Objects.equals(…) and Objects.hash(…)/Objects.hashCode(…). Records for internal cache key. Related issue: #2813.
odrotbohm
added a commit
to spring-projects/spring-data-relational
that referenced
this issue
Apr 4, 2023
…cessor. Fixes #1477. Related ticket: spring-projects/spring-data-commons#2813.
odrotbohm
added a commit
to spring-projects/spring-data-cassandra
that referenced
this issue
Apr 4, 2023
…yPathAccessor. Fixes: #1368 Related issue: spring-projects/spring-data-commons#2813
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should change the definition of
PersistentPropertyPath
to — in its public API — not allow empty instances anymore. Those violate the concept and bleed into the concept's API by having to make all methods nullable (returning null in exactly that "empty" case). An empty property path doesn't make any actual sense as you cannot reasonably answer the methods declared on the interface except by returning null, which then causes client code having to verify the returned values all the time.This is now changed into only making
PersistentPropertyPath.getParentPath()
nullable and letting it return null for single segment paths. Adapted client code accordingly.….getRequiredLeadProperty()
is now deprecated in favour of….getLeafProperty()
not returning null anymore.The text was updated successfully, but these errors were encountered: