Skip to content

Use Arrays.hashCode(...) in ObjectUtils #29051

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
j3graham opened this issue Aug 31, 2022 · 2 comments
Closed

Use Arrays.hashCode(...) in ObjectUtils #29051

j3graham opened this issue Aug 31, 2022 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@j3graham
Copy link
Contributor

j3graham commented Aug 31, 2022

java.util.Arrays has methods for hashCode generation on primitive arrays that are equivalent to nullSafeHashCode

They do however calculate different hash values. If this was tolerable, then the JDK methods could be used.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 31, 2022
@j3graham
Copy link
Contributor Author

j3graham commented Sep 1, 2022

Found an existing pr - #25594

@j3graham j3graham closed this as completed Sep 1, 2022
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 2, 2022
@snicoll
Copy link
Member

snicoll commented Aug 25, 2023

The PR has been declined so let's reconsider this particular change.

@snicoll snicoll reopened this Aug 25, 2023
@snicoll snicoll added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed status: duplicate A duplicate of another issue labels Aug 25, 2023
@snicoll snicoll added this to the 6.1.0-RC1 milestone Aug 25, 2023
@snicoll snicoll self-assigned this Aug 25, 2023
snicoll added a commit to snicoll/spring-framework that referenced this issue Sep 13, 2023
@sbrannen sbrannen changed the title Use methods from JDK to implement array hash methods in ObjectUtils Use Arrays.hashCode(...) in ObjectUtils Sep 13, 2023
sbrannen added a commit that referenced this issue Sep 13, 2023
In light of the refinements to ObjectUtils, this commit updates
SynthesizedMergedAnnotationInvocationHandler to use
ObjectUtils.nullSafeHashCode() and removes the now obsolete code in
SynthesizedMergedAnnotationInvocationHandler.

See gh-29051
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants