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

Alex Buckley alex.buckley at oracle.com
Sat Jun 17 02:32:44 UTC 2023


On 6/16/2023 6:49 PM, Joseph D. Darcy wrote:
> To give more context around the situations where the note appears and 
> the motivation behind it. Using a command line like
> 
>      $ javac --class-path JarFileWithAnnotationProcessor.java Foo.java
> 
> will look for and find the annotation processor inside 
> JarFileWithAnnotationProcessor and run it per the process outlined in 
> the man page, etc. There are no strictly annotation processing related 
> configuration options in this situation; these are the sort of implicit 
> cases where the warning note will be reported under this PR.
> 
> In contrast, none of these other command lines would generate a note:
> 
>      $ javac --processor-path JarFileWithAnnotationProcessor.java Foo.java
>      $ javac --class-path     JarFileWithAnnotationProcessor.java 
> -processor NameOfProcessorInJarFile Foo.java
>      $ javac --class-path     JarFileWithAnnotationProcessor.java 
> -proc:full                          Foo.jav
A new suggestion:

   Annotation processing is enabled because one or more processors
   were found on the class path. A future release of javac may disable
   annotation processing unless at least one processor is specified by
   name (`-processor`), or a search path is specified
   (`--processor-path`, `--processor-module-path`), or annotation
   processing is enabled explicitly (`-proc:only`, `-proc:full`).
   Use -Xlint:-options to suppress this message.

Alex


More information about the compiler-dev mailing list