JDK-8317113 : Release Note: Reimplement `sun.reflect.ReflectionFactory::newConstructorForSerialization` with Method Handles
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-09-27
  • Updated: 2023-09-27
  • Resolved: 2023-09-27
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 22
22Resolved
Description
`sun.reflect.ReflectionFactory::newConstructorForSerialization` is reimplemented with method handles.

When `newConstructorForSerialization(C.class, ctor)` is called with a constructor whose declaring class is not a superclass of `C`, the old implementation returned an ill-formed constructor such that if `newInstance` is invoked, the behavior is unspecified.  The new implementation will throw an `UnsupportedOperationException` instead, to fail fast.