Disable ImmutableAnnotationChecker ErrorProne error to fix build

On my Mac notebook building gerrit fails due to
ImmutableAnnotationChecker errors reported by ErrorProne. Downgrade this
check to warning level while the code doesn’t conform with this check
yet.

INFO: Analyzed target //:gerrit (127 packages loaded, 2033 targets configured).
INFO: Found 1 target...
ERROR: /Users/ekempin/git/gerrit/java/com/google/gerrit/util/cli/BUILD:1:1: Building java/com/google/gerrit/util/cli/libcli.jar (9 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor) failed (Exit 1)
bazel-out/darwin-fastbuild/bin/java/com/google/gerrit/util/cli/_javac/cli/libcli_sourcegenfiles/com/google/gerrit/util/cli/AutoAnnotation_OptionUtil_newOption.java:12: error: [ImmutableAnnotationChecker] annotations should be immutable: 'AutoAnnotation_OptionUtil_newOption' has field 'aliases' of type 'java.lang.String[]', arrays are mutable
  private final String[] aliases;
                         ^
    (see https://errorprone.info/bugpattern/ImmutableAnnotationChecker)
bazel-out/darwin-fastbuild/bin/java/com/google/gerrit/util/cli/_javac/cli/libcli_sourcegenfiles/com/google/gerrit/util/cli/AutoAnnotation_OptionUtil_newOption.java:26: error: [ImmutableAnnotationChecker] annotations should be immutable: 'AutoAnnotation_OptionUtil_newOption' has field 'depends' of type 'java.lang.String[]', arrays are mutable
  private final String[] depends;
                         ^
    (see https://errorprone.info/bugpattern/ImmutableAnnotationChecker)
bazel-out/darwin-fastbuild/bin/java/com/google/gerrit/util/cli/_javac/cli/libcli_sourcegenfiles/com/google/gerrit/util/cli/AutoAnnotation_OptionUtil_newOption.java:28: error: [ImmutableAnnotationChecker] annotations should be immutable: 'AutoAnnotation_OptionUtil_newOption' has field 'forbids' of type 'java.lang.String[]', arrays are mutable
  private final String[] forbids;
                         ^
    (see https://errorprone.info/bugpattern/ImmutableAnnotationChecker)
Target //:gerrit failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 28.821s, Critical Path: 13.18s
INFO: 15 processes: 14 darwin-sandbox, 1 worker.
FAILED: Build did NOT complete successfully

Change-Id: Id7911fb6dd88dd2abdb03010096ee64d4a4d37ec
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2019-08-26 11:44:03 +02:00
parent 283ac230a4
commit e7fc5ee635

View File

@@ -55,7 +55,7 @@ java_package_configuration(
"-Xep:FunctionalInterfaceClash:ERROR",
"-Xep:FutureReturnValueIgnored:ERROR",
"-Xep:GetClassOnEnum:ERROR",
"-Xep:ImmutableAnnotationChecker:ERROR",
"-Xep:ImmutableAnnotationChecker:WARN",
"-Xep:ImmutableEnumChecker:ERROR",
"-Xep:IncompatibleModifiers:ERROR",
"-Xep:InjectOnConstructorOfAbstractClass:ERROR",