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-15 21:33:28 -0700
commitf1e533cff71fcf3ef8e523fffae28b958c21a727 (patch)
treea824a9a3285a92106908640a150f46be648e9a4f
parentdb13f770454eb57e18ebffa7e3c1a126b6116f21 (diff)
downloadsmali-f1e533cff71fcf3ef8e523fffae28b958c21a727.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: Ib03e311818c39aabb42f4286fb44a210321c940a
-rw-r--r--dexlib2/Android.bp12
1 files changed, 12 insertions, 0 deletions
diff --git a/dexlib2/Android.bp b/dexlib2/Android.bp
index e8eb04d5..2afbe173 100644
--- a/dexlib2/Android.bp
+++ b/dexlib2/Android.bp
@@ -25,8 +25,18 @@ package {
default_applicable_licenses: ["external_smali_license"],
}
+java_defaults {
+ name: "dexlib2_defaults",
+ errorprone: {
+ javacflags: [
+ "-Xep:ComparableType:WARN",
+ ],
+ },
+}
+
java_library_host {
name: "dexlib2",
+ defaults: ["dexlib2_defaults"],
srcs: [
"src/main/java/**/*.java",
@@ -42,6 +52,7 @@ java_library_host {
java_library_host {
name: "dexlib2-no-guava",
+ defaults: ["dexlib2_defaults"],
srcs: [
"src/main/java/**/*.java",
@@ -60,6 +71,7 @@ java_library_host {
java_library_host {
name: "dexlib2-no-guava-no-cli",
+ defaults: ["dexlib2_defaults"],
srcs: [
"src/main/java/**/*.java",