Skip to content

Commit

Permalink
Immutable java: Use new lower-allocation extension serialization APIs…
Browse files Browse the repository at this point in the history
… from gencode

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

PiperOrigin-RevId: 644182132
  • Loading branch information
mhansen authored and copybara-github committed Jun 18, 2024
1 parent 0812bbf commit 4151486
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/google/protobuf/compiler/java/full/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit 4151486

Please sign in to comment.