Skip to content

Change the usage of ExtensionRegistry to ExtensionRegistryLite in a f… #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public static void internalBuildGeneratedFileFrom(
"Invalid embedded descriptor for \"" + proto.getName() + "\".", e);
}

final ExtensionRegistry registry = descriptorAssigner.assignDescriptors(result);
final ExtensionRegistryLite registry = descriptorAssigner.assignDescriptors(result);

if (registry != null) {
// We must re-parse the proto using the registry.
Expand Down Expand Up @@ -478,7 +478,7 @@ public static FileDescriptor internalBuildGeneratedFileFrom(
* needed to recognize custom options.
*/
public static void internalUpdateFileDescriptor(
FileDescriptor descriptor, ExtensionRegistry registry) {
FileDescriptor descriptor, ExtensionRegistryLite registry) {
ByteString bytes = descriptor.proto.toByteString();
try {
FileDescriptorProto proto = FileDescriptorProto.parseFrom(bytes, registry);
Expand All @@ -504,7 +504,7 @@ public static void internalUpdateFileDescriptor(
*/
@Deprecated
public interface InternalDescriptorAssigner {
ExtensionRegistry assignDescriptors(FileDescriptor root);
ExtensionRegistryLite assignDescriptors(FileDescriptor root);
}

private FileDescriptorProto proto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static DynamicMessage parseFrom(Descriptor type, CodedInputStream input)

/** Parse a message of the given type from the given input stream. */
public static DynamicMessage parseFrom(
Descriptor type, CodedInputStream input, ExtensionRegistry extensionRegistry)
Descriptor type, CodedInputStream input, ExtensionRegistryLite extensionRegistry)
throws IOException {
return newBuilder(type).mergeFrom(input, extensionRegistry).buildParsed();
}
Expand All @@ -84,7 +84,7 @@ public static DynamicMessage parseFrom(Descriptor type, ByteString data)

/** Parse {@code data} as a message of the given type and return it. */
public static DynamicMessage parseFrom(
Descriptor type, ByteString data, ExtensionRegistry extensionRegistry)
Descriptor type, ByteString data, ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
return newBuilder(type).mergeFrom(data, extensionRegistry).buildParsed();
}
Expand All @@ -97,7 +97,7 @@ public static DynamicMessage parseFrom(Descriptor type, byte[] data)

/** Parse {@code data} as a message of the given type and return it. */
public static DynamicMessage parseFrom(
Descriptor type, byte[] data, ExtensionRegistry extensionRegistry)
Descriptor type, byte[] data, ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
return newBuilder(type).mergeFrom(data, extensionRegistry).buildParsed();
}
Expand All @@ -109,7 +109,7 @@ public static DynamicMessage parseFrom(Descriptor type, InputStream input) throw

/** Parse a message of the given type from {@code input} and return it. */
public static DynamicMessage parseFrom(
Descriptor type, InputStream input, ExtensionRegistry extensionRegistry) throws IOException {
Descriptor type, InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException {
return newBuilder(type).mergeFrom(input, extensionRegistry).buildParsed();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ BuilderType mergeFrom(final Message other, Map<FieldDescriptor, Object> allField

@Override
public BuilderType mergeFrom(final CodedInputStream input) throws IOException {
return mergeFrom(input, ExtensionRegistry.getEmptyRegistry());
return mergeFrom(input, ExtensionRegistryLite.getEmptyRegistry());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ BuilderT mergeFrom(final Message other, Map<FieldDescriptor, Object> allFields)

@Override
public BuilderT mergeFrom(final CodedInputStream input) throws IOException {
return mergeFrom(input, ExtensionRegistry.getEmptyRegistry());
return mergeFrom(input, ExtensionRegistryLite.getEmptyRegistry());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ MapEntry.Builder<K,V> mergeFrom(final Message other, Map<FieldDescriptor, Object

@Override
public MapEntry.Builder<K,V> mergeFrom(final CodedInputStream input) throws IOException {
return mergeFrom(input, ExtensionRegistry.getEmptyRegistry());
return mergeFrom(input, ExtensionRegistryLite.getEmptyRegistry());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public boolean mergeFieldFrom(int tag, CodedInputStream input) throws IOExceptio
return true;
case WireFormat.WIRETYPE_START_GROUP:
Builder subBuilder = newBuilder();
input.readGroup(number, subBuilder, ExtensionRegistry.getEmptyRegistry());
input.readGroup(number, subBuilder, ExtensionRegistryLite.getEmptyRegistry());
getFieldBuilder(number).addGroup(subBuilder.build());
return true;
case WireFormat.WIRETYPE_END_GROUP:
Expand Down