Request for feedback on annotation processing API changes made in JDK 9

Dawid Weiss dawid.weiss at
Sat Apr 8 07:54:57 UTC 2017

> Basically the same issue as "Using
> java.awt.Toolkit.getDefaultToolkit().getScreenSize() reflectively causes
> InaccessibleObjectException" [1].

Thanks for the pointer, Alex. I followed up on that discussion. So my
intuition was basically correct (Method from the module-private class
instead of the exported API). Still, I fail to see how this can be
ever backward compatible and even fixable for many libraries that just
accept arbitrary Object instances and try to perform some reflective
operations on their public properties (or methods). Peter's advice
[1], while applicable, requires major changes to any scripting engine
out there to make it work.

Don't get me wrong, I understand it's a much better module isolation
sandbox and the concept is right. But speaking of backward
compatibility it's going to be a major one for existing scripting
engines. Consider Velocity -- those issues you pointed to are fairly
dated. In fact, last Velocity release was 7 years ago and somehow I
don't think tracking return types to get the right call methods is
going to be an easy fix...

Joe asked for feedback on the update, not the general module
compatibility, so this isn't really the same thread. Just wanted to
point out that this still leaves us in a situation where we have to
stick to Java8 or rewrite/fix the underlying scripting engine to make
it work with Java9 (command line switches cannot be considered if we
redistribute the annotation processor and expect it to work with
vanilla javac).



More information about the compiler-dev mailing list