On Fri, 26 May 2023 21:06:36 GMT, Chen Liang <li...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line 
>> 209:
>> 
>>> 207:         if (intfc.isHidden())
>>> 208:             throw newIllegalArgumentException("a hidden interface", 
>>> intfc.getName());
>>> 209:         if (!VM.isModuleSystemInited())
>> 
>> I don't expect this is needed.  I assume you are thinking for LMF to use 
>> this API?
>
> Proxy-based impl had this check, so I'd assume MHP might want to defend 
> against the same kind of improper usage.

Proxy is used by annotation implementation.   I suspect that's why that check 
was there.

For `MHP::asInterfaceInstance`, I would drop the `isModuleSystemInitied` check 
until the API is being used during early startup.   I don't expect it be called 
before module system is initialized.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1207391651

Reply via email to