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()) {
printer->Print(
"com.google.protobuf.GeneratedMessage\n"
" .ExtendableMessage<$classname$>.ExtensionWriter\n"
" extensionWriter = newMessageSetExtensionWriter();\n",
"classname", name_resolver_->GetImmutableClassName(descriptor_));
" .ExtendableMessage.ExtensionSerializer\n"
" extensionWriter = newMessageSetExtensionSerializer();\n");
} else {
printer->Print(
"com.google.protobuf.GeneratedMessage\n"
" .ExtendableMessage<$classname$>.ExtensionWriter\n"
" extensionWriter = newExtensionWriter();\n",
"classname", name_resolver_->GetImmutableClassName(descriptor_));
" .ExtendableMessage.ExtensionSerializer\n"
" extensionWriter = newExtensionSerializer();\n");
}
}

Loading…
Cancel
Save