-
Enhancement
-
Resolution: Fixed
-
P4
-
None
FULL PRODUCT VERSION :
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.16299.248]
A DESCRIPTION OF THE PROBLEM :
java.util.AbstractMap.SimpleImmutableEntry is not actually immutable so methods receiving a SimpleImmutableEntry are forced to make defensive copies, defeating the entire purpose of this class.
The fact that the class is not final allows malicious sub-classes to declare mutable key2 and value2 and redirect calls to them.
Please make SimpleImmutableEntry final, or deprecate it and provide an immutable replacement.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.16299.248]
A DESCRIPTION OF THE PROBLEM :
java.util.AbstractMap.SimpleImmutableEntry is not actually immutable so methods receiving a SimpleImmutableEntry are forced to make defensive copies, defeating the entire purpose of this class.
The fact that the class is not final allows malicious sub-classes to declare mutable key2 and value2 and redirect calls to them.
Please make SimpleImmutableEntry final, or deprecate it and provide an immutable replacement.
REPRODUCIBILITY :
This bug can be reproduced always.
- csr for
-
JDK-8268134 add idempotent copy operation for Map.Entry
-
- Closed
-
- relates to
-
JDK-8038146 Clarify Map.Entry's connection to the underlying map
-
- Resolved
-