JDK-8172720 : Collections.SingletonList::hashCode not spec-compliant
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-01-12
  • Updated: 2021-03-03
  • Resolved: 2017-01-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b153Fixed
Related Reports
Duplicate :  
Relates :  
Description
JDK-8037325 implemented SingletonList as 

return Objects.hashCode(element);

but it needs to be 

return 31 + Objects.hashCode(element);

to be compliant with specification.
Comments
Fixes bug introduced in JDK-8166365
12-01-2017