On 01.06.2016 21:07, Alex Buckley wrote:
Pretend you never heard of Module::addReads, it's for a use case that doesn't matter here (generation of bytecode with constant pool references to classes in other modules).
good advice, that I will follow ;)
Core Reflection is still bound by the Java language's notion of accessibility, so calling newInstance() on a Class or get() on a Field or invoke() on a Method will perform an access check in SE 9 just like in SE 8. The access check has two parts, as previously discussed, but by policy the first part (X-reads-Y) is a "yes" for these reflective operations ... that leaves second part where the underlying class/field/method must be exported to the code calling newInstance()/get()/invoke(). That's why setAccessible has been @CallerSensitive since the module system implementation was merged into JDK 9.
which is much less of a problem for us bye Jochen