JDK 22 |
---|
22Resolved |
`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.