aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-10-15 21:33:31 -0700
committerCole Faust <colefaust@google.com>2022-10-15 21:33:31 -0700
commit055c7440c2b94af83d5e4646a43c6ca63107ac52 (patch)
tree2cc676ed354f730f128a810ebafb5b88630d0457
parent5397de607f68e3e267ece571bfb8fad3eb9cf204 (diff)
downloadguava-055c7440c2b94af83d5e4646a43c6ca63107ac52.tar.gz
Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone errors that have been downgraded to warnings in the android source tree, so that they can be promoted to errors again. The full list of changes include the following, but not all will be present in any one individual commit: BadAnnotationImplementation BadShiftAmount BanJNDI BoxedPrimitiveEquality ComparableType ComplexBooleanConstant CollectionToArraySafeParameter ConditionalExpressionNumericPromotion DangerousLiteralNull DoubleBraceInitialization DurationFrom DurationTemporalUnit EmptyTopLevelDeclaration EqualsNull EqualsReference FormatString FromTemporalAccessor GetClassOnAnnotation GetClassOnClass HashtableContains IdentityBinaryExpression IdentityHashMapBoxing InstantTemporalUnit InvalidTimeZoneID InvalidZoneId IsInstanceIncompatibleType JUnitParameterMethodNotFound LockOnBoxedPrimitive MathRoundIntLong MislabeledAndroidString MisusedDayOfYear MissingSuperCall MisusedWeekYear ModifyingCollectionWithItself NoCanIgnoreReturnValueOnClasses NonRuntimeAnnotation NullableOnContainingClass NullTernary OverridesJavaxInjectableMethod ParcelableCreator PeriodFrom PreconditionsInvalidPlaceholder ProtoBuilderReturnValueIgnored ProtoFieldNullComparison RandomModInteger RectIntersectReturnValueIgnored ReturnValueIgnored SelfAssignment SelfComparison SelfEquals SizeGreaterThanOrEqualsZero StringBuilderInitWithChar TreeToString TryFailThrowable UnnecessaryCheckNotNull UnusedCollectionModifiedInPlace XorPower See https://errorprone.info/bugpatterns for more information on the checks. Bug: 253827323 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I400f730889458642d5c12b06adea03279fb908da
-rw-r--r--Android.bp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index c4a3be8e2..d6d95cfb2 100644
--- a/Android.bp
+++ b/Android.bp
@@ -108,6 +108,11 @@ java_library_host {
"error_prone_annotations",
],
java_version: "1.8",
+ errorprone: {
+ javacflags: [
+ "-Xep:NoCanIgnoreReturnValueOnClasses:WARN",
+ ],
+ },
}
java_library_host {
@@ -121,6 +126,11 @@ java_library_host {
"junit",
],
java_version: "1.8",
+ errorprone: {
+ javacflags: [
+ "-Xep:ReturnValueIgnored:WARN",
+ ],
+ },
}
// Guava for Android can't compile against an Android bootclasspath, compile
@@ -135,6 +145,11 @@ java_library_host {
"error_prone_annotations",
],
java_version: "1.8",
+ errorprone: {
+ javacflags: [
+ "-Xep:NoCanIgnoreReturnValueOnClasses:WARN",
+ ],
+ },
}
java_host_for_device {
@@ -161,4 +176,9 @@ java_library {
"guava-android-annotation-stubs",
"junit",
],
+ errorprone: {
+ javacflags: [
+ "-Xep:ReturnValueIgnored:WARN",
+ ],
+ },
}