summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-10-15 21:33:29 -0700
committerCole Faust <colefaust@google.com>2022-10-15 21:33:29 -0700
commit7514c9e7b7e7342483d76e0d6e1fed392c025f25 (patch)
tree65070d6055ea00ff43d0b62af8c0ac112a37f311
parent7baedc23dbfc2a4d242d3d1b0f7bf5c7710726d8 (diff)
downloadloganalysis-7514c9e7b7e7342483d76e0d6e1fed392c025f25.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: Ibffb78353bb2ffc669422d6ac58f3a6a34b5ad43
-rw-r--r--src/com/android/loganalysis/item/DvmLockSampleItem.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/com/android/loganalysis/item/DvmLockSampleItem.java b/src/com/android/loganalysis/item/DvmLockSampleItem.java
index 01372a4..10edebc 100644
--- a/src/com/android/loganalysis/item/DvmLockSampleItem.java
+++ b/src/com/android/loganalysis/item/DvmLockSampleItem.java
@@ -17,7 +17,6 @@ package com.android.loganalysis.item;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -43,17 +42,16 @@ public class DvmLockSampleItem extends GenericItem {
OWNER_ACQUIRE_SOURCE_LINE, SAMPLE_PERCENTAGE));
@SuppressWarnings("serial")
- private static final Map<String, Class<?>> TYPES = new HashMap<String, Class<?>>() {{
- put(PROCESS_NAME, String.class);
- put(SENSITIVITY_FLAG, Boolean.class);
- put(WAITING_THREAD_NAME, String.class);
- put(WAIT_TIME, Integer.class);
- put(WAITING_SOURCE_FILE, String.class);
- put(WAITING_SOURCE_LINE, Integer.class);
- put(OWNER_FILE_NAME, String.class);
- put(OWNER_ACQUIRE_SOURCE_LINE, Integer.class);
- put(SAMPLE_PERCENTAGE, Integer.class);
- }};
+ private static final Map<String, Class<?>> TYPES = Map.of(
+ PROCESS_NAME, String.class,
+ SENSITIVITY_FLAG, Boolean.class,
+ WAITING_THREAD_NAME, String.class,
+ WAIT_TIME, Integer.class,
+ WAITING_SOURCE_FILE, String.class,
+ WAITING_SOURCE_LINE, Integer.class,
+ OWNER_FILE_NAME, String.class,
+ OWNER_ACQUIRE_SOURCE_LINE, Integer.class,
+ SAMPLE_PERCENTAGE, Integer.class);
public DvmLockSampleItem() {
super(ATTRIBUTES);