Add-Reads and Add-Modules manifest attributes?

Alan Bateman Alan.Bateman at oracle.com
Thu May 18 14:27:15 UTC 2017


On 18/05/2017 15:14, Andrew Guibert wrote:

> :
>
> Regarding Add-Reads:
> You're reading it backwards I'm afraid =) This example is saying 
> "java.base needs to read ALL-UNNAMED modules"
> But regardless of what example was given, it is a valid use case right?
>
I assumed you had transposed them in your mail :-)

In any case, it's not clear that you need this, at least not for the 
platform modules. Core reflection assumes readability so there shouldn't 
be any issues with code in either module reflecting into code on the 
class path. Maybe you are spinning bytecode? If so then you have a 
visibility issue as the types on the class path are not visible to boot 
or platform loaders. At a stretch then maybe are spinning bytecode that 
uses method handles, that's the only scenario that I can think of where 
you might need to add a read edge at runtime, in which case you can just 
call the reflective APIs. So maybe you could help by giving a specific 
example where you need this.

-Alan



More information about the jigsaw-dev mailing list