From dfe7d71167885a331e2634cd46112256fafd6ef6 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Sat, 14 Sep 2019 09:43:13 +0200 Subject: [PATCH] Bazel: Disable ImmutableAnnotationChecker error prone check The severity of this check was demoted to WARN in Id7911fb6dd8. But then was promoted again to ERROR in I72d6044a4d5. However, the root cause of the compilation breakage is the Error Prone false positive error reporting for ImmutableAnnotationChecker check on Java 11 and later: [1], [2]. Disable the check for now, and consider to re-enable it again, when the breakage is fixed upstream. This is needed to support building Gerrit on Java 11 and newer Java versions. [1] https://github.com/bazelbuild/bazel/issues/9378 [2] https://github.com/google/error-prone/issues/1348 Change-Id: Ib1778629fef5e2f61891ff0a176e4b5c74f2aa8a --- tools/BUILD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/BUILD b/tools/BUILD index 29626d9991e..5531c3ef780 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -29,6 +29,9 @@ default_java_toolchain( # enabled. This warnings list is originally based on: # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl # However, feel free to add any additional errors. Thus far they have all been pretty useful. +# TODO(davido): Enable ImmutableAnnotationChecker again when these issues are fixed: +# https://github.com/google/error-prone/issues/1348 +# https://github.com/bazelbuild/bazel/issues/9378 java_package_configuration( name = "error_prone", javacopts = [ @@ -55,7 +58,7 @@ java_package_configuration( "-Xep:FunctionalInterfaceClash:ERROR", "-Xep:FutureReturnValueIgnored:ERROR", "-Xep:GetClassOnEnum:ERROR", - "-Xep:ImmutableAnnotationChecker:ERROR", + "-Xep:ImmutableAnnotationChecker:OFF", "-Xep:ImmutableEnumChecker:ERROR", "-Xep:IncompatibleModifiers:ERROR", "-Xep:InjectOnConstructorOfAbstractClass:ERROR",