some basic questions about the module system concept

Jochen Theodorou blackdrag at
Tue Sep 22 07:32:27 UTC 2015

Hi all,

I am still not sure this is the right list to ask those things, but I 
guess you guys will tell me if there is a better place.

First of all I was looking for a graph or something alike that shows 
what modules are supposed to be visible to applications. Couldn't easily 
find that. But I would assume anything in com.sun is not.

There are of course "special cases"... I am thinking here about the 
visibility of the internal javac classes from and 
things like "hackish" annotation processors and Project Lombok. They use 
those internal classes, basically extending javac through annotations. 
Are those supposed to be possible with jigsaw? It is no official API and 
as such I would assume the javac classes are not made accessible outside 
the javac module.

The bigger part of course is about a scripting language on the JVM. So 
let us assume the following scenario... I write an application in Groovy 
and the application will be a module A, with large parts not accessible 
to the outside. Let us further assume, that Groovy will make method 
calls with reflection from its runtime.

 From what I understood about Jigsaw so far, this can work only, if 
Groovy has its own module and the application allows Groovy accessing 
the module.

Now, assume there is another application with module B, written in 
Groovy as well and working on the classes of A. Now, since method calls 
are done through the runtime and since the Groovy runtime is supposed to 
have access to module A, doesn't that mean, module B can have full 
access to module A through the Groovy runtime?

Extending this... Groovy can compile and execute scripts at runtime... 
as far as I understand this, those scripts would normally end up in an 
unnamed module. And this package has no access rights to internal module 
classes. If I am right then this means that module A cannot use scripts 
to operate on internal classes. If I am wrong, any arbitrary script can 
access any class/method in module A.

There are cases when you want access and cases when not. But I have not 
seen anything yet, explaining how to control this. Is there anything in 
the concept for this?

I think I may have seen that the runtime generated class is added to the 
module with the same package in the same classloader... Or I should say 
has access to those. But this does not really matter to use, because in 
the above scenario we normally have no access to the classloader loading 
the application and per default a runtime compiled script has its own 
classloader altogether.

bye Jochen

Jochen "blackdrag" Theodorou

More information about the jpms-spec-observers mailing list