diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java index 15d135620db3..e236fa945d2e 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java @@ -299,7 +299,7 @@ private static ImmutableMap buildImmutableClasses( .build(); } - private static ImmutableSet buildMutableClasses(List knownMutables) { + public static ImmutableSet buildMutableClasses(List knownMutables) { return ImmutableSet.builder() .addAll(knownMutables) .addAll(ImmutableCollections.MUTABLE_TO_IMMUTABLE_CLASS_NAME_MAP.keySet()) @@ -308,7 +308,8 @@ private static ImmutableSet buildMutableClasses(List knownMutabl .add(java.util.BitSet.class.getName()) .add(java.util.Calendar.class.getName()) .add(java.lang.Iterable.class.getName()) - .add(java.lang.Object.class.getName()) + // Everything is a subtype of Object so hack remove it + // .add(java.lang.Object.class.getName()) .add("java.text.DateFormat") .add(java.util.ArrayList.class.getName()) .add(java.util.Collection.class.getName())