From e7fc5ee635dd7ac90be6e4b17e94317842f87112 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Mon, 26 Aug 2019 11:44:03 +0200 Subject: [PATCH] Disable ImmutableAnnotationChecker ErrorProne error to fix build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tools/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/BUILD b/tools/BUILD index 89ce558286..f4718e1c88 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -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",