On Sat, 6 May 2023 16:55:16 GMT, Chen Liang <li...@openjdk.org> wrote:

> Apparently method handle linking doesn't impose extra checks on constructor 
> invocation, so the special logic for the serialization constructor to call 
> superclass constructor in MagicAccessorImpl can be removed altogether with 
> old core reflection implementation.
> 
> Serialization and sun.reflect.ReflectionFactory tests pass. May be worth to 
> think about the long-term treatment of 
> ReflectionFactory.newConstructorForSerialization, as creating partial object 
> is inherently unsafe, and behavior of 
> `newConstructorForSerialization(ArrayList.class, 
> String.class.getDeclaredConstructor(String.class))` etc. (which is accepted 
> for now) may have unpredictable side effects.
> 
> #1830 has a similar patch; this one doesn't touch proxies and updates to the 
> new post-JEP 416 reflection implementation.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/13853

Reply via email to