Quality Outreach Heads-up - Annotation Processing Change
Joe Darcy on July 29, 2023The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.
JDK 21 & JDK 22: Note if implicit annotation processing is being used
Annotation processing by javac is enabled by default, including when no annotation processing configuration options are present. We are considering disabling implicit annotation processing by default in a future release, possibly as early as JDK 22 (JDK-8306819: Consider disabling the compiler’s default active annotation processing). To alert javac users of this possibility, as of JDK 21 b29 and JDK 22 b04, javac prints a note if implicit annotation processing is being used (JDK-8310061: Note if implicit annotation processing is being used). The reported note is:
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. Use-proc:none
to disable annotation processing.
Good build hygiene includes explicitly configuring annotation processing. To ease the transition to a different default policy in the future, the new-in-JDK-21 -proc:full
javac option requests the current default behavior of looking for annotation processors on the class path.