Immutable java: Use new lower-allocation extension serialization APIs from gencode

This requires the new methods to be present in the runtime.

PiperOrigin-RevId: 644182132
pull/17168/head
Mark Hansen 5 months ago committed by Copybara-Service
parent 0812bbfcf5
commit 41514865eb
  1. 10
      src/google/protobuf/compiler/java/full/message.cc

@ -587,15 +587,13 @@ void ImmutableMessageGenerator::GenerateMessageSerializationMethods(
if (descriptor_->options().message_set_wire_format()) { if (descriptor_->options().message_set_wire_format()) {
printer->Print( printer->Print(
"com.google.protobuf.GeneratedMessage\n" "com.google.protobuf.GeneratedMessage\n"
" .ExtendableMessage<$classname$>.ExtensionWriter\n" " .ExtendableMessage.ExtensionSerializer\n"
" extensionWriter = newMessageSetExtensionWriter();\n", " extensionWriter = newMessageSetExtensionSerializer();\n");
"classname", name_resolver_->GetImmutableClassName(descriptor_));
} else { } else {
printer->Print( printer->Print(
"com.google.protobuf.GeneratedMessage\n" "com.google.protobuf.GeneratedMessage\n"
" .ExtendableMessage<$classname$>.ExtensionWriter\n" " .ExtendableMessage.ExtensionSerializer\n"
" extensionWriter = newExtensionWriter();\n", " extensionWriter = newExtensionSerializer();\n");
"classname", name_resolver_->GetImmutableClassName(descriptor_));
} }
} }

Loading…
Cancel
Save