Review request on the optional modules support

Roger Riggs Roger.Riggs at oracle.com
Thu Aug 11 13:24:04 PDT 2011


ok, I'll bite...   about the compiler being able (or not) to flag 
potentially
faulty references to classes in optional modules.

When the compiler is using the module info to compile a module,
it will know that another module is optional respect to the module
being compiled.  For those references, it would seem to be knowable
how the reference is being used and be able to flag the same kinds
of conditions that the verifier would.

What am I missing?

Thanks, Roger



>
>> One of the questions posed is whether the compiler can use the 
>> RequireOptionalModule annotations but I would have thought that if 
>> there are any references to types in optional modules then it will 
>> require that they be present at compile time. Maybe this question is 
>> only for the case that reflection is used?
>>
>
> Roger posted this question in our previous discussion.  At compile 
> time, the optional module must be present if there is any reference to 
> types in the optional module.   If the optional method is not 
> carefully written, at class loading time, the verifier might load 
> types in optional modules for verification regardless of whether the 
> optional module is called or not.  The question really comes to 
> whether the compiler can detect such potential verification error 
> during compilation.  I talked with Jon Gibbons another day.  The 
> compiler can't detect that.  Jon and Alex can chime in and explain 
> further.




More information about the jigsaw-dev mailing list