aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-10-15 21:33:28 -0700
committerCole Faust <colefaust@google.com>2022-10-25 10:44:59 -0700
commit4d1c1645506aad06ba0ba5e4427e52a4a94f9db7 (patch)
treec3cc153b0be9c5d44b4fdf780b3dfc9246a5c0e4
parent619c303eb98b3c2d74b3169a1673124c3ebd45bd (diff)
downloadtestng-4d1c1645506aad06ba0ba5e4427e52a4a94f9db7.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: I5d329a8c86c460ec34fe0dedd39f7ea7717066c0
-rw-r--r--Android.bp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index bc1b1a92..8047a81c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -102,6 +102,18 @@ java_library {
"guice",
],
libs: ["junit"],
+
+ errorprone: {
+ javacflags: [
+ "-Xep:ComparableType:WARN",
+ "-Xep:NonRuntimeAnnotation:WARN",
+ "-Xep:GetClassOnAnnotation:WARN",
+ "-Xep:RandomModInteger:WARN",
+ "-Xep:FormatString:WARN",
+ "-Xep:DoubleBraceInitialization:WARN",
+ "-Xep:UnusedCollectionModifiedInPlace:WARN",
+ ],
+ },
}
// TODO: also add the tests once we have testng working.