is ClassLoader.loadClass() supposed to work on module-info classes?

Alan Bateman Alan.Bateman at oracle.com
Thu Dec 3 20:23:57 UTC 2015



On 03/12/2015 19:43, Rafael Winterhalter wrote:
> But then library B needs to find all modules potentially involved. With the
> classical example of a serialization library that traverses a full object
> graph, this would require B to do the same for anytime an object is handed
> to the shaded dependency. To me that appears impractical.
>
I think I've lost you here or maybe the example has teleported.

As I understand the example then code in A (which is in module B) is 
trying to use core reflection to access some type in consumer module C. 
Assuming the C type is public and in a packaged exported by C to B then 
the code in A should be able to access it, it just needs to use 
jlr.Module::addReads as Alex said. It may be that B already reads C, in 
which case this addReads will be a noop. So no walking objects graph or 
anything complicated in this example.

-Alan.


More information about the jigsaw-dev mailing list