Update Java generated code to call new resolveAllFeatures() runtime method stub.

This method stub was already added in a previous change. A followup change will make runtime changes implementing and relying on this method.

PiperOrigin-RevId: 597650170
pull/15402/head
Sandy Zhang 1 year ago committed by Copybara-Service
parent 8812654500
commit 81ce69985a
  1. 4
      src/google/protobuf/compiler/java/file.cc
  2. 1
      src/google/protobuf/compiler/java/shared_code_generator.cc

@ -424,6 +424,10 @@ void FileGenerator::GenerateDescriptorInitializationCodeForImmutable(
"_clinit_autosplit_dinit_$method_num$();\n",
"private static void _clinit_autosplit_dinit_$method_num$() {\n");
}
// Feature resolution for Java features uses extension registry
// which must happen after internalInit() from
// GenerateNonNestedInitializationCode
printer->Print("descriptor.resolveAllFeatures();\n");
// Proto compiler builds a DescriptorPool, which holds all the descriptors to
// generate, when processing the ".proto" files. We call this DescriptorPool

@ -86,6 +86,7 @@ void SharedCodeGenerator::Generate(
" * an incomplete descriptor for internal use only. */\n"
" public static com.google.protobuf.Descriptors.FileDescriptor "
"getDescriptor() {\n"
" descriptor.resolveAllFeatures();\n"
" return descriptor;\n"
" }\n"
" static {\n",

Loading…
Cancel
Save