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

joe darcy joe.darcy at
Fri Apr 7 22:01:42 UTC 2017

Hi Gunnar,

On 4/7/2017 5:50 AM, Gunnar Morling wrote:
> Hi Joe,
>> The new type javax.annotation.processing.Generated is intended to be a drop-in replacement for javax.annotation.Generated
> A @Generated annotation is useful for any kind of code generator,
> whether implemented as an annotation processor or not. Having it in
> javax.annotation.processing ties it to annotation processing, though.
> Of course other non-AP generators may still use it, but it'd feel not
> quite right.

More specifically, the new Generated annotation type is tied to the 
java.compiler module rather than the module which 
houses the old Generated.

> When discussing the case of @Generated earlier this year on
> jigsaw-dev, a proposal was to have java.lang.annotation.Generated, and
> Mark expressed support for this [1]. I still think that'd be the
> better place, or was there anything speaking against it?

After additional discussion, it seemed preferable to put the generated 
annotation in a module related to code generation of some sort, 
java.compiler, rather than the universally imported module java.base.



More information about the compiler-dev mailing list