Some suggested patches and improvements

David M. Lloyd david.lloyd at redhat.com
Fri May 12 13:31:50 UTC 2017


On 05/12/2017 03:22 AM, Alan Bateman wrote:
> On 12/05/2017 01:43, David M. Lloyd wrote:
> 
>> I've proposed five patches to the jpms-spec-experts list [1..5] for 
>> discussion.  The patches are as follows:
>>
>> 1. Layer primitive: addExports() - mirrors the existing 
>> Module.addExports() method for ModuleLayer.Controllers
>> 2. Layer primitive: addUses() - mirrors the existing Module.addUses() 
>> method for ModuleLayer.Controllers
>> 3. Layer primitive: addPackage() - allows ModuleLayer.Controllers to 
>> add packages to a module after it has been defined
>> 4. Make run-time cycle checking optional
>> 5. Add optional class loader isolation for modules on the module path
 >
> #1-#3 are a subset of issue #LayerPrimitives in the JSR. I don't wish to 
> comment on whether these make sense or not.

No problem, I'm just looking for technical feedback here.

> However for #3 then you've 
> missed several important error cases, e.g. illegal package names, or the 
> package is already in another module defined to the class loader. There 
> is impact in other areas too.

I can look into these two items; can you expand on the other impacts?

> #4 seems to be working around the outcome of issue #CyclicDependences in 
> the JSR. I also don't wish to comment on that except to say that 
> introducing system properties to skip specified checks is highly 
> problematic from a conformance perspective.

Can you explain what you mean by that?  I'm more than happy to convert 
these into -X type arguments to the runtime (or, of course, to simply 
make this the standard behavior), but I thought this would be a simpler 
and safer approach (at least for a first pass).

The only other place where I found run time cycles to be relevant is 
jlink and a couple of other tools, which I am in the process of 
developing a similar patch for.

> There is a lot more to #5, something that will become clear when you 
> work through all the scenarios. The JSR and spec part are minor though 
> but I'd prefer to hold off until there is more discussion on this topic 
> in the JSR.

I'd rather not hold off as the JSR essentially only has a couple of 
weeks left to live if there is not a revised PR.  Could you please 
explain what you mean?  Are you referring to jlink, jaotc, or something 
else?

-- 
- DML


More information about the jigsaw-dev mailing list