On Fri, 6 May 2022 08:42:12 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> src/java.base/share/classes/jdk/internal/reflect/Reflection.java line 120:
>> 
>>> 118:         // if there is no caller class, act as if the call came from 
>>> an unnamed module
>>> 119:         Module module = currentClass != null ?
>>> 120:                 currentClass.getModule() : Holder.FALLBACK_MODULE;
>> 
>> This can be simplified to:
>> 
>> Module module = currentClass != null ?
>>                currentClass.getModule() : 
>> ClassLoader::getSystemClassLoader().getUnnamedModule();
>> 
>> 
>> No need to have the Holder class.
>
> gah! I missed that :-)

I've addressed these comments (thanks!) and also added some tests for these 
corner cases.

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

PR: https://git.openjdk.java.net/jdk/pull/7888

Reply via email to