On Wed, 6 Sep 2023 19:47:19 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 3534:
>> 
>>> 3532:          * This method is only used to implement the unsupported
>>> 3533:          * 
>>> sun.reflect.ReflectionFactory::newConstructorForSerialization API.
>>> 3534:          */
>> 
>> The following is probably more correct:
>> Suggestion:
>> 
>>         /**
>>          * Produces a method handle that is capable of creating instances of 
>> the given class
>>          * and instantiated by the given constructor.  No security manager 
>> check.
>>          *
>>          * This method is used to implement serialization and the unsupported
>>          * sun.reflect.ReflectionFactory::newConstructorForSerialization API.
>>          */
>
> What are you referring to "to implement serialization"?   It's only used by 
> ReflectionFactory.

It’s called from the implementation of 
`JavaLangInvokeAccess::serializableConstructor`, which is called by 
`jdk.internal.reflect.ReflectionFactory::newConstructorForSerialization`, which 
is called by `java.io.ObjectStreamClass::getSerializableConstructor`:
https://github.com/openjdk/jdk/blob/86a18f5e2e0825dddb77656b2f43f64684f1464c/src/java.base/share/classes/java/io/ObjectStreamClass.java#L1444-L1446

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15600#discussion_r1317753943

Reply via email to