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

WebAuthenticationDetails#hashCode often returns zero #4133

Closed
murrayw24 opened this issue Nov 15, 2016 · 0 comments
Closed

WebAuthenticationDetails#hashCode often returns zero #4133

murrayw24 opened this issue Nov 15, 2016 · 0 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: breaks-passivity A change that breaks passivity with the previous release type: bug A general bug
Milestone

Comments

@murrayw24
Copy link

murrayw24 commented Nov 15, 2016

Summary

Ideally, the hashCode method defined by a class should return distinct integers for distinct objects. Not doing so impacts performance when the objects are stored in a HashMap

Actual Behavior

The algorithm in WebAuthenticationDetails#hashCode has a 26% chance of returning zero

Expected Behavior

A much broader range of hash codes are returned for distinct objects

Configuration

N/A

Version

4.0.9 and latest

Sample

https://github.com/spring-projects/spring-security/blob/master/web/src/main/java/org/springframework/security/web/authentication/WebAuthenticationDetails.java

@murrayw24 murrayw24 changed the title WebAuthenticationDetails hashCode often returns zero WebAuthenticationDetails#hashCode often returns zero Nov 15, 2016
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 7, 2019
@rwinch rwinch added in: web An issue in web modules (web, webmvc) type: bug A general bug type: breaks-passivity A change that breaks passivity with the previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 8, 2022
@rwinch rwinch added this to the 6.0.x milestone Jun 8, 2022
@jzheaux jzheaux self-assigned this Jul 27, 2022
@jzheaux jzheaux moved this to Todo in Spring Security Team Sep 20, 2022
@jzheaux jzheaux modified the milestones: 6.0.x, 6.0.0-RC1 Sep 20, 2022
Repository owner moved this from Todo to Done in Spring Security Team Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: breaks-passivity A change that breaks passivity with the previous release type: bug A general bug
Projects
Status: Done
Development

No branches or pull requests

4 participants