Skip to content

Conversation

@dreis2211
Copy link
Contributor

@dreis2211 dreis2211 commented Mar 28, 2017

Hey,

while working on https://jira.spring.io/browse/SPR-15395 I noticed that Spring-Boot is creating some hash codes for primitives on its own as well. So this PR replaces those with calling Spring's ObjectUtils.hashCode() variants. Seemed more consistent than using the JDK ones, but I'd be happy to use them if you tell me to.

I hope you don't mind that I changed to ObjectUtils.nullSafeEquals/hashCode() in FileSnapshot for the one none-primitive field while being on this one.

This is a second PR ( #8766 ) as I screwed with the history in the first one. Sorry for that.

Cheers,
Christoph

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 28, 2017
@dreis2211
Copy link
Contributor Author

dreis2211 commented Mar 28, 2017

As https://jira.spring.io/browse/SPR-15395 might trigger the deprecation of those methods, I'd wait until merging this.

@snicoll snicoll added status: on-hold We can't start working on this issue yet and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 29, 2017
@dreis2211 dreis2211 changed the title Use ObjectUtils.hashCode() for primitives Use JDK hashCode() variants for primitives Apr 3, 2017
@dreis2211
Copy link
Contributor Author

Just renamed this to reflect the new intention of this PR. Which is to use the JDK variants for primitive types.

Cheers,
Christoph

@dreis2211
Copy link
Contributor Author

Test failure seems to be unrelated

@philwebb
Copy link
Member

philwebb commented Apr 4, 2017

Looks like SPR-15395 is in. The nullSafe changes to FileSnapshot are not necessary since the file can never be null.

@philwebb philwebb added priority: low type: enhancement A general enhancement and removed status: on-hold We can't start working on this issue yet labels Apr 4, 2017
@philwebb philwebb added this to the 2.0.0.M1 milestone Apr 4, 2017
@dreis2211
Copy link
Contributor Author

Thanks for looking into this. Removed the nullSafe calls in FileSnapshot again

@snicoll snicoll self-assigned this Apr 12, 2017
snicoll pushed a commit that referenced this pull request Apr 12, 2017
@snicoll snicoll closed this in 036157a Apr 12, 2017
snicoll added a commit that referenced this pull request Apr 12, 2017
* pr/8768:
  Polish "Use JDK hashCode() variants for primitives"
  Use JDK hashCode() variants for primitives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants