@ -402,6 +402,16 @@ void FileGenerator::GenerateDescriptorInitializationCodeForImmutable(
" final " , options_ . opensource_runtime ? " " : " final " ) ;
" final " , options_ . opensource_runtime ? " " : " final " ) ;
printer - > Indent ( ) ;
printer - > Indent ( ) ;
// Force descriptor initialization of all dependencies.
for ( int i = 0 ; i < file_ - > dependency_count ( ) ; i + + ) {
if ( ShouldIncludeDependency ( file_ - > dependency ( i ) , true ) ) {
std : : string dependency =
name_resolver_ - > GetImmutableClassName ( file_ - > dependency ( i ) ) ;
printer - > Print ( " $dependency$.getDescriptor(); \n " , " dependency " ,
dependency ) ;
}
}
if ( options_ . opensource_runtime ) {
if ( options_ . opensource_runtime ) {
SharedCodeGenerator shared_code_generator ( file_ , options_ ) ;
SharedCodeGenerator shared_code_generator ( file_ , options_ ) ;
shared_code_generator . GenerateDescriptors ( printer ) ;
shared_code_generator . GenerateDescriptors ( printer ) ;
@ -461,16 +471,6 @@ void FileGenerator::GenerateDescriptorInitializationCodeForImmutable(
} ) ;
} ) ;
}
}
// Force descriptor initialization of all dependencies.
for ( int i = 0 ; i < file_ - > dependency_count ( ) ; i + + ) {
if ( ShouldIncludeDependency ( file_ - > dependency ( i ) , true ) ) {
std : : string dependency =
name_resolver_ - > GetImmutableClassName ( file_ - > dependency ( i ) ) ;
printer - > Print ( " $dependency$.getDescriptor(); \n " , " dependency " ,
dependency ) ;
}
}
if ( ! extensions . empty ( ) ) {
if ( ! extensions . empty ( ) ) {
// Must construct an ExtensionRegistry containing all existing extensions
// Must construct an ExtensionRegistry containing all existing extensions
// and use it to parse the descriptor data again to recognize extensions.
// and use it to parse the descriptor data again to recognize extensions.