$ mvn clean compile
...
[WARNING] /private/tmp/annotate-format-repro/src/main/java/com/example/Example.java:[7,21] [AnnotateFormatMethod] This method uses a pair of parameters as a format string and its arguments, but the enclosing method wasn't annotated. Doing so gives compile-time rather than run-time protection against malformed format strings.
(see https://errorprone.info/bugpattern/AnnotateFormatMethod)
Did you mean 'public static void helloWorld(int arg1, @LenientFormatString String template, Object... args) {'?
...
$ mvn clean compile -Ppatch > /dev/null
$ mvn clean compile
...
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /private/tmp/annotate-format-repro/src/main/java/com/example/Example.java:[5,40] error: cannot find symbol
symbol: class LenientFormatString
location: package com.google.errorprone.annotations
[ERROR] /private/tmp/annotate-format-repro/src/main/java/com/example/Example.java:[9,43] error: cannot find symbol
symbol: class LenientFormatString
location: class Example
...
The AnnotateFormatMethod check was updated in #5025 to add support for
@LenientFormatString, but that annotation does not seem to exist. I've attached a minimal example to reproduceLenientFormatString.zip
Output: