aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-10-15 21:33:30 -0700
committerCole Faust <colefaust@google.com>2022-10-25 10:50:49 -0700
commitbcdb92ea775eca7ab92be7fada6d4b4fc82aa161 (patch)
tree825fb5d61409683d8142eff658a8d63d2e2bc65d
parenta3a480f6a9fc36629e573c3ecd5df599c5fd35e6 (diff)
downloaddagger2-bcdb92ea775eca7ab92be7fada6d4b4fc82aa161.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: I88e21af764848c227954612a4ea39a9cdaf2b53d
-rw-r--r--Android.bp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index e00faa7af..b48468020 100644
--- a/Android.bp
+++ b/Android.bp
@@ -81,6 +81,13 @@ java_library {
],
sdk_version: "core_current",
+
+ errorprone: {
+ javacflags: [
+ "-Xep:FormatStringAnnotation:WARN",
+ "-Xep:NoCanIgnoreReturnValueOnClasses:WARN",
+ ],
+ },
}
// build dagger2 producers library
@@ -199,6 +206,13 @@ java_library_host {
"--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
],
+
+ errorprone: {
+ javacflags: [
+ "-Xep:FormatStringAnnotation:WARN",
+ "-Xep:NoCanIgnoreReturnValueOnClasses:WARN",
+ ],
+ },
}
// Compile dummy implementations of annotations used by dagger2 but not