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

Alex Buckley alex.buckley at oracle.com
Fri Apr 7 21:46:46 UTC 2017


On 4/5/2017 4:31 PM, Joseph D. Darcy wrote:
> http://cr.openjdk.java.net/~darcy/JDK-9-JSR-269-Changes/specdiff-2017-04-05/

- ModulePrefix in Processor::getSupportedAnnotationTypes would benefit 
from using ModuleName (JLS9 6.5, 6.5.3) rather than TypeName.

- I was surprised that ModuleElement.Directive says "Represents a 
***"module statement"*** within the declaration of this module." because 
the whole point of adopting "directive" was to avoid reusing the term 
"statement". Please consider borrowing terminology from JLS9 7.7 [1], 
such as "The directives of a module declaration configure the module in 
the Java Platform Module System."

- ModuleElement provides access to "information about the module, ***its 
directives***, and its members."

- Semantically, ModuleElement::getSimpleName makes even less sense than 
PackageElement::getSimpleName. At least for the latter, two 
PackageElements having different simple names is a meta-level guarantee 
that code in one package can't access package-access types in the other 
package. But for the former, two ModuleElements having different simple 
names tells you nothing about anything.

Alex

[1] 
http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jls-pr-diffs.pdf -- 
obviously not the Final Release, but 7.7 is a stable section number.


More information about the compiler-dev mailing list