JDK-8285098 : (ref) Reference object should not support cloning
  • Type: Backport
  • Backport of: JDK-8201793
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-04-19
  • Updated: 2022-04-28
  • Resolved: 2022-04-28
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 11 JDK 8
11Fixed 8u42 masterFixed
Description
Backport to 8u42 as proposed in [1] to improve java.lang.ref processing in Java SE 8 and JDK 8

[1] https://mail.openjdk.java.net/pipermail/jdk8u-dev/2022-April/014783.html
Comments
Changeset: 58ec25de Author: Poonam Bajaj <poonam@openjdk.org> Date: 2022-04-28 20:42:08 +0000 URL: https://git.openjdk.java.net/jdk8u-ri/commit/58ec25de2f383144417eb000efacecb78b30395c
28-04-2022

Fix Request This is a critical issue required in Java SE 8 Maintenance Relase 4. Refer to the MR 4 proposal for details [1]. PR: https://github.com/openjdk/jdk8u-ri/pull/6 CSR: https://bugs.openjdk.java.net/browse/JDK-8285099 It has been reviewed and approved. A new test is included in the PR. The change is exact match with the original fix except `@since 8` plus `@apiNote` to state that this method is defined in Java SE 8 MR 4. The compatibility risk is low. This change only impacts subclasses of `java.lang.ref.Reference` that rely on `Reference::clone` to return a cloned instance. For example, a custom `Reference` subclass that implements `Cloneable` and overrides the `clone` method which should be rare. [1] https://mail.openjdk.java.net/pipermail/jdk8u-dev/2022-April/014783.html
21-04-2022