From ea15988dbe02542d589adb37838d8cc719268d95 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 17 Feb 2022 16:54:58 +0100 Subject: [PATCH 1/3] `TypesWithUndefinedEquality`: sort enum --- .../TypesWithUndefinedEquality.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java index 6d9eb9d6acb..287bf434dd3 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java @@ -24,25 +24,25 @@ /** Enumerates types which have poorly-defined behaviour for equals. */ public enum TypesWithUndefinedEquality { + CHAR_SEQUENCE("CharSequence", "java.lang.CharSequence"), + COLLECTION("Collection", "java.util.Collection"), + DATE("Date", "java.util.Date"), + IMMUTABLE_COLLECTION("ImmutableCollection", "com.google.common.collect.ImmutableCollection"), + IMMUTABLE_MULTIMAP("ImmutableMultimap", "com.google.common.collect.ImmutableMultimap"), + ITERABLE("Iterable", "java.lang.Iterable", "com.google.common.collect.FluentIterable"), LONG_SPARSE_ARRAY( "LongSparseArray", "android.util.LongSparseArray", "android.support.v4.util.LongSparseArrayCompat", "androidx.core.util.LongSparseArrayCompat", "androidx.collection.LongSparseArrayCompat"), + MULTIMAP("Multimap", "com.google.common.collect.Multimap"), + QUEUE("Queue", "java.util.Queue"), SPARSE_ARRAY( "SparseArray", "android.util.SparseArray", "androidx.collection.SparseArrayCompat", - "androidx.collection.SparseArrayCompat"), - MULTIMAP("Multimap", "com.google.common.collect.Multimap"), - IMMUTABLE_MULTIMAP("ImmutableMultimap", "com.google.common.collect.ImmutableMultimap"), - CHAR_SEQUENCE("CharSequence", "java.lang.CharSequence"), - ITERABLE("Iterable", "java.lang.Iterable", "com.google.common.collect.FluentIterable"), - COLLECTION("Collection", "java.util.Collection"), - IMMUTABLE_COLLECTION("ImmutableCollection", "com.google.common.collect.ImmutableCollection"), - QUEUE("Queue", "java.util.Queue"), - DATE("Date", "java.util.Date"); + "androidx.collection.SparseArrayCompat"); private final String shortName; private final ImmutableSet typeNames; From a0ae26af6251be9db14ecbbeae39ca185df0d054 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 17 Feb 2022 16:57:50 +0100 Subject: [PATCH 2/3] `TypesWithUndefinedEquality#SPARSE_ARRAY`: remove duplicate entry --- .../errorprone/bugpatterns/TypesWithUndefinedEquality.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java index 287bf434dd3..722edb501ef 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java @@ -38,11 +38,7 @@ public enum TypesWithUndefinedEquality { "androidx.collection.LongSparseArrayCompat"), MULTIMAP("Multimap", "com.google.common.collect.Multimap"), QUEUE("Queue", "java.util.Queue"), - SPARSE_ARRAY( - "SparseArray", - "android.util.SparseArray", - "androidx.collection.SparseArrayCompat", - "androidx.collection.SparseArrayCompat"); + SPARSE_ARRAY("SparseArray", "android.util.SparseArray", "androidx.collection.SparseArrayCompat"); private final String shortName; private final ImmutableSet typeNames; From c6979849a7c92ec10f019cf3358d06ff5ccc122c Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Thu, 17 Feb 2022 16:58:43 +0100 Subject: [PATCH 3/3] `TypesWithUndefinedEquality`: sort typenames of enum --- .../bugpatterns/TypesWithUndefinedEquality.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java index 722edb501ef..c14cfbb5ff1 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/TypesWithUndefinedEquality.java @@ -29,13 +29,13 @@ public enum TypesWithUndefinedEquality { DATE("Date", "java.util.Date"), IMMUTABLE_COLLECTION("ImmutableCollection", "com.google.common.collect.ImmutableCollection"), IMMUTABLE_MULTIMAP("ImmutableMultimap", "com.google.common.collect.ImmutableMultimap"), - ITERABLE("Iterable", "java.lang.Iterable", "com.google.common.collect.FluentIterable"), + ITERABLE("Iterable", "com.google.common.collect.FluentIterable", "java.lang.Iterable"), LONG_SPARSE_ARRAY( "LongSparseArray", - "android.util.LongSparseArray", "android.support.v4.util.LongSparseArrayCompat", - "androidx.core.util.LongSparseArrayCompat", - "androidx.collection.LongSparseArrayCompat"), + "android.util.LongSparseArray", + "androidx.collection.LongSparseArrayCompat", + "androidx.core.util.LongSparseArrayCompat"), MULTIMAP("Multimap", "com.google.common.collect.Multimap"), QUEUE("Queue", "java.util.Queue"), SPARSE_ARRAY("SparseArray", "android.util.SparseArray", "androidx.collection.SparseArrayCompat");