diff options
Diffstat (limited to 'tools/BUILD')
-rw-r--r-- | tools/BUILD | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/tools/BUILD b/tools/BUILD index c2b2366c49..c7ec638645 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -17,7 +17,7 @@ default_java_toolchain( default_java_toolchain( name = "error_prone_warnings_toolchain_java17", configuration = dict(), - java_runtime = "@bazel_tools//tools/jdk:remotejdk_17", + java_runtime = "@rules_java//toolchains:remotejdk_17", package_configuration = [ ":error_prone", ], @@ -26,6 +26,18 @@ default_java_toolchain( visibility = ["//visibility:public"], ) +default_java_toolchain( + name = "error_prone_warnings_toolchain_java21", + configuration = dict(), + java_runtime = "@rules_java//toolchains:remotejdk_21", + package_configuration = [ + ":error_prone", + ], + source_version = "21", + target_version = "21", + visibility = ["//visibility:public"], +) + # Error Prone errors enabled by default; see ../.bazelrc for how this is # enabled. This warnings list is originally based on: # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl @@ -62,7 +74,7 @@ java_package_configuration( "-Xep:AutoValueSubclassLeaked:WARN", "-Xep:BadAnnotationImplementation:ERROR", "-Xep:BadComparable:ERROR", - "-Xep:BadImport:WARN", + "-Xep:BadImport:ERROR", "-Xep:BadInstanceof:ERROR", "-Xep:BadShiftAmount:ERROR", "-Xep:BanSerializableRead:ERROR", @@ -75,8 +87,8 @@ java_package_configuration( "-Xep:CacheLoaderNull:ERROR", "-Xep:CannotMockFinalClass:ERROR", "-Xep:CanonicalDuration:ERROR", - "-Xep:CatchAndPrintStackTrace:WARN", - "-Xep:CatchFail:WARN", + "-Xep:CatchAndPrintStackTrace:ERROR", + "-Xep:CatchFail:ERROR", "-Xep:ChainedAssertionLosesContext:ERROR", "-Xep:ChainingConstructorIgnoresParameter:ERROR", "-Xep:CharacterGetNumericValue:ERROR", @@ -158,7 +170,7 @@ java_package_configuration( "-Xep:FromTemporalAccessor:ERROR", "-Xep:FunctionalInterfaceClash:ERROR", "-Xep:FunctionalInterfaceMethodChanged:ERROR", - "-Xep:FutureReturnValueIgnored:WARN", + "-Xep:FutureReturnValueIgnored:ERROR", "-Xep:FuturesGetCheckedIllegalExceptionType:ERROR", "-Xep:GetClassOnAnnotation:ERROR", "-Xep:GetClassOnClass:ERROR", @@ -222,7 +234,7 @@ java_package_configuration( "-Xep:JavaPeriodGetDays:ERROR", "-Xep:JavaTimeDefaultTimeZone:ERROR", "-Xep:JavaUtilDate:WARN", - "-Xep:JdkObsolete:WARN", + "-Xep:JdkObsolete:ERROR", "-Xep:JodaConstructors:ERROR", "-Xep:JodaDateTimeConstants:ERROR", "-Xep:JodaDurationWithMillis:ERROR", @@ -251,7 +263,7 @@ java_package_configuration( "-Xep:LockOnBoxedPrimitive:ERROR", "-Xep:LogicalAssignment:ERROR", "-Xep:LongFloatConversion:ERROR", - "-Xep:LongLiteralLowerCaseSuffix:WARN", + "-Xep:LongLiteralLowerCaseSuffix:ERROR", "-Xep:LoopConditionChecker:ERROR", "-Xep:LoopOverCharArray:ERROR", "-Xep:LossyPrimitiveCompare:ERROR", @@ -270,7 +282,7 @@ java_package_configuration( "-Xep:MixedDescriptors:ERROR", "-Xep:MixedMutabilityReturnType:WARN", "-Xep:MockitoUsage:ERROR", - "-Xep:ModifiedButNotUsed:WARN", + "-Xep:ModifiedButNotUsed:ERROR", "-Xep:ModifyCollectionInEnhancedForLoop:ERROR", "-Xep:ModifyingCollectionWithItself:ERROR", "-Xep:ModifySourceCollectionInStream:ERROR", @@ -323,7 +335,7 @@ java_package_configuration( "-Xep:PreferredInterfaceType:OFF", "-Xep:PrimitiveAtomicReference:ERROR", "-Xep:PrivateSecurityContractProtoAccess:ERROR", - "-Xep:ProtectedMembersInFinalClass:WARN", + "-Xep:ProtectedMembersInFinalClass:ERROR", "-Xep:ProtoBuilderReturnValueIgnored:ERROR", "-Xep:ProtocolBufferOrdinal:ERROR", "-Xep:ProtoDurationGetSecondsGetNano:ERROR", @@ -396,7 +408,7 @@ java_package_configuration( "-Xep:UnnecessaryLambda:ERROR", "-Xep:UnnecessaryMethodInvocationMatcher:ERROR", "-Xep:UnnecessaryMethodReference:ERROR", - "-Xep:UnnecessaryParentheses:WARN", + "-Xep:UnnecessaryParentheses:ERROR", "-Xep:UnnecessaryTypeArgument:ERROR", "-Xep:UnrecognisedJavadocTag:ERROR", "-Xep:UnsafeFinalization:ERROR", @@ -407,10 +419,10 @@ java_package_configuration( "-Xep:UnusedException:ERROR", "-Xep:UnusedMethod:WARN", "-Xep:UnusedNestedClass:ERROR", - "-Xep:UnusedVariable:WARN", + "-Xep:UnusedVariable:ERROR", "-Xep:URLEqualsHashCode:ERROR", "-Xep:UseBinds:ERROR", - "-Xep:UseCorrectAssertInTests:WARN", + "-Xep:UseCorrectAssertInTests:ERROR", "-Xep:VariableNameSameAsType:ERROR", "-Xep:VarTypeName:ERROR", "-Xep:WaitNotInLoop:ERROR", |