WebAuthenticationDetails#hashCode often returns zero #4133
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
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
The text was updated successfully, but these errors were encountered: