JDK-8272042 : java.util.ImmutableCollections$Map1 and MapN should not be @ValueBased
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-08-05
  • Updated: 2021-12-02
  • Resolved: 2021-11-23
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 18
18 b26Fixed
Related Reports
Relates :  
Relates :  
Description
The superclass AbstractMap of java.util.ImmutableCollections$Map1 and MapN is not stateless and contains `keySet` and `values`.   They should not be annotated with `@ValueBased` and they can't be migrated to a primitive class.

The candidate list in https://openjdk.java.net/jeps/390 may need to be updated.
Comments
Changeset: 5e7e2da2 Author: Roger Riggs <rriggs@openjdk.org> Date: 2021-11-23 15:02:48 +0000 URL: https://git.openjdk.java.net/jdk/commit/5e7e2da227cd2b5e2d3d1e2f59fb74ddd1835abb
23-11-2021

ImmutableCollection$AbstractImmutableMap is also not a value based class (because supertype AbstractMap has state.
19-11-2021