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

Jonathan Gibbons jjg at openjdk.org
Wed Jun 28 17:27:02 UTC 2023


On Wed, 21 Jun 2023 23:09:14 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.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Expand cases where an annotation processor path is detected.

Approved, with some optional suggestions for stylistic improvement

src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 1778:

> 1776:     path is specified (--processor-path, --processor-module-path), or annotation\n\
> 1777:     processing is enabled explicitly (-proc:only, -proc:full).\n\
> 1778:     Use -Xlint:-options to suppress this message.

You ought to be able to suppress the message by addressing the underlying cause, not just by disabling the check.
For example, I would expect `-proc:none` to disable the message as well.

test/langtools/tools/javac/diags/examples.not-yet.txt line 217:

> 215: 
> 216: # this one needs a forged class file to be reproduced
> 217: compiler.err.annotation.unrecognized.attribute.name

Is it just me? I cannot see any difference in these lines...  Is there a difference in trailing whitespace?

test/langtools/tools/javac/processing/options/TestNoteOnImplicitProcessing.java line 106:

> 104: 
> 105:         // write out processor source file
> 106:         tb.writeFile(processorName + ".java",

If you use `writeJavaFiles`, it will infer the filename from the source code.

test/langtools/tools/javac/processing/options/TestNoteOnImplicitProcessing.java line 135:

> 133:         // Compile the processor
> 134:         new JavacTask(tb)
> 135:             .files(processorName + ".java")

there's a utility method `ToolBox.findJavaFiles` which is generally useful in this sort of context

-------------

Marked as reviewed by jjg (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14499#pullrequestreview-1503625527
PR Review Comment: https://git.openjdk.org/jdk/pull/14499#discussion_r1245535349
PR Review Comment: https://git.openjdk.org/jdk/pull/14499#discussion_r1245537258
PR Review Comment: https://git.openjdk.org/jdk/pull/14499#discussion_r1245540576
PR Review Comment: https://git.openjdk.org/jdk/pull/14499#discussion_r1245541629


More information about the compiler-dev mailing list