Tighten type bounds on GeneratedMessageLite.defaultInstanceMap.

Just a cleanup I noticed while looking at optimising this code.

PiperOrigin-RevId: 662234161
pull/17784/head
Mark Hansen 4 months ago committed by Copybara-Service
parent 6739739ade
commit b71e5ee2d5
  1. 4
      java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java

@ -360,8 +360,8 @@ public abstract class GeneratedMessageLite<
return dynamicMethod(MethodToInvoke.BUILD_MESSAGE_INFO); return dynamicMethod(MethodToInvoke.BUILD_MESSAGE_INFO);
} }
private static Map<Object, GeneratedMessageLite<?, ?>> defaultInstanceMap = private static Map<Class<?>, GeneratedMessageLite<?, ?>> defaultInstanceMap =
new ConcurrentHashMap<Object, GeneratedMessageLite<?, ?>>(); new ConcurrentHashMap<>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
static <T extends GeneratedMessageLite<?, ?>> T getDefaultInstance(Class<T> clazz) { static <T extends GeneratedMessageLite<?, ?>> T getDefaultInstance(Class<T> clazz) {

Loading…
Cancel
Save