Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java

Issue 2600753002: Reverts third_party/protobuf: Update to HEAD (f52e188fe4) (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java
diff --git a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java
index a22a74a03caeebacfaaca6705a87c53522274e62..0067392fa6058b48ea26e18d9d54323e12399596 100644
--- a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java
+++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java
@@ -32,6 +32,7 @@ package com.google.protobuf;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
+
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -100,7 +101,7 @@ public class ExtensionRegistry extends ExtensionRegistryLite {
/** Get the unmodifiable singleton empty instance. */
public static ExtensionRegistry getEmptyRegistry() {
- return EMPTY_REGISTRY;
+ return EMPTY;
}
@@ -242,11 +243,6 @@ public class ExtensionRegistry extends ExtensionRegistryLite {
add(newExtensionInfo(extension), extension.getExtensionType());
}
- /** Add an extension from a generated file to the registry. */
- public void add(final GeneratedMessage.GeneratedExtension<?, ?> extension) {
- add((Extension<?, ?>) extension);
- }
-
static ExtensionInfo newExtensionInfo(final Extension<?, ?> extension) {
if (extension.getDescriptor().getJavaType() ==
FieldDescriptor.JavaType.MESSAGE) {
@@ -315,7 +311,7 @@ public class ExtensionRegistry extends ExtensionRegistryLite {
private final Map<DescriptorIntPair, ExtensionInfo> mutableExtensionsByNumber;
ExtensionRegistry(boolean empty) {
- super(EMPTY_REGISTRY_LITE);
+ super(ExtensionRegistryLite.getEmptyRegistry());
this.immutableExtensionsByName =
Collections.<String, ExtensionInfo>emptyMap();
this.mutableExtensionsByName =
@@ -325,7 +321,7 @@ public class ExtensionRegistry extends ExtensionRegistryLite {
this.mutableExtensionsByNumber =
Collections.<DescriptorIntPair, ExtensionInfo>emptyMap();
}
- static final ExtensionRegistry EMPTY_REGISTRY = new ExtensionRegistry(true);
+ private static final ExtensionRegistry EMPTY = new ExtensionRegistry(true);
private void add(
final ExtensionInfo extension,

Powered by Google App Engine
This is Rietveld 408576698