8181087: Module system implementation refresh (6/2017 update)

Mandy Chung mandy.chung at oracle.com
Thu Jun 15 14:28:33 UTC 2017


> On Jun 15, 2017, at 12:34 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>> 
>> java/lang/Module.java
>>  901     void implAddOpensToAllUnnamed(Iterator<String> iterator) {
>>  902         if (jdk.internal.misc.VM.isModuleSystemInited()) {
>>  903             iterator.forEachRemaining(pn ->
>>  904                 implAddExportsOrOpens(pn, ALL_UNNAMED_MODULE, true, true));
>>  905             return;
>>  906         }
>> 
>> AFAICT this should only be called during module system initialization.
>> When will this method be called after initPhase 2?
> It's for use during startup (initPhase2) only. If called later then it works as if the module somehow reflectively opened the packages to all unnamed modules. I wouldn't object to changing it to throwing an exception (assuming that is what you are thinking) as the JDK doesn't have any use for this after initPhase2.

Yes this is what I am thinking.  This method should catch when it’s called which is not expected.


Mandy


More information about the jigsaw-dev mailing list