RFR: JDK-8310061: Note if implicit annotation processing is being used

Alex Buckley alex.buckley at oracle.com
Fri Jun 16 19:20:21 UTC 2023


On 6/16/2023 11:48 AM, Joe Darcy wrote:
> On Thu, 15 Jun 2023 18:16:57 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> 
>> Emit a note warning of the possibility of changing the implicit running of annotation processors in a future release.
> 
> The goal of the change in this PR is to emit a message to users who may be unknowingly relying on default implicit annotation processing that the long-standing default may be changing in a future release. The message is a Note rather than a Warning to avoid running afoul of build setups using configurations like "-Xlint:all -Werror".

I looked at the man page -- 
https://download.java.net/java/early_access/jdk21/docs/specs/man/javac.html#how-annotation-processing-works 
-- to learn about javac's default search path for processors.

(`-proc:full` isn't mentioned, but maybe it's coming soon?)

The title of this mail is about "implicit annotation processing", that 
is, the fact that annotation processing is enabled by default ... but 
the focus of the new message is about a different kind of default, 
namely the default search path for locating annotation processors. I read:

   One or more annotation processors found under the default policy of
   searching the class path or module path for processors.

as saying:

   Let's try to be more specific about where javac should search for
   processors -- look at --processor-path or --processor-module-path

(The man page doesn't mention searching the module path for processors. 
It only searches the "user class path".)


Consider this text, which sidesteps "implicit" in favor of 
"enabled"/"disabled" to align with how the man page starts: "Unless 
annotation processing is disabled with the -proc:none option ..."

   Annotation processing is enabled, and one or more annotation
   processors were found. [Maybe -processorpath was specified, maybe it
   wasn't, but either way, something was found.]

   They will be called [the word from the man page] in this compilation,
   but a future release of javac may choose to disable annotation
   processing by default. It will then be necessary to enable annotation
   processing with `-proc:only` or `-proc:full`.

   Use -Xlint:-options to suppress this message.

Alex


More information about the compiler-dev mailing list