31 package com.google.protobuf;
33 import java.util.Collections;
34 import java.util.HashMap;
80 @SuppressWarnings(
"JavaOptionalSuggestions")
87 static Class<?> resolveExtensionClass() {
89 return Class.forName(EXTENSION_CLASS_NAME);
90 }
catch (ClassNotFoundException e) {
115 ? ExtensionRegistryFactory.create()
127 if (result ==
null) {
130 if (result ==
null) {
134 ? ExtensionRegistryFactory.createEmpty()
135 : EMPTY_REGISTRY_LITE;
153 @SuppressWarnings(
"unchecked")
156 final ContainingType containingTypeDefaultInstance, final
int fieldNumber) {
158 extensionsByNumber.get(
new ObjectIntPair(containingTypeDefaultInstance, fieldNumber));
179 }
catch (Exception e) {
180 throw new IllegalArgumentException(
181 String.format(
"Could not invoke ExtensionRegistry#add for %s",
extension), e);
197 static final ExtensionRegistryLite EMPTY_REGISTRY_LITE =
new ExtensionRegistryLite(
true);
199 ExtensionRegistryLite(ExtensionRegistryLite other) {
200 if (other == EMPTY_REGISTRY_LITE) {
207 private final Map<ObjectIntPair, GeneratedMessageLite.GeneratedExtension<?, ?>>
226 return System.identityHashCode(
object) * ((1 << 16) - 1) +
number;