From 37cfdc7536471cc3510720ed35037068ce6e3323 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 18 Nov 2022 22:18:46 -0800 Subject: [PATCH] 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 Merged-In: I21aa58ebc02327849ed2161dbbafcdc806c007f2 Change-Id: I2fbc9701a4ad1caa264e0b22e02fd0dab310eabd --- .../settings/fuelgauge/BatteryChartPreferenceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java index 02248c9af51..8b2bf6b484a 100644 --- a/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java +++ b/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java @@ -629,7 +629,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll if (batteryHistoryMap == null || batteryHistoryMap.isEmpty()) { return null; } - Log.d(TAG, String.format("getBatteryLast24HrData() size=%d time=&d/ms", + Log.d(TAG, String.format("getBatteryLast24HrData() size=%d time=%d/ms", batteryHistoryMap.size(), (System.currentTimeMillis() - start))); final Map> batteryIndexedMap = ConvertUtils.getIndexedUsageMap(