Internal change.

PiperOrigin-RevId: 659698170
pull/17689/head
Cong Liu 8 months ago committed by Copybara-Service
parent 9bcd5a3ca2
commit 69698c123a
  1. 17
      src/google/protobuf/generated_message_reflection.cc
  2. 2
      src/google/protobuf/unittest.proto

@ -346,17 +346,20 @@ bool Reflection::IsLazyExtension(const Message& message,
}
bool Reflection::IsLazilyVerifiedLazyField(const FieldDescriptor* field) const {
if (field->options().unverified_lazy()) return true;
// Message fields with [lazy=true] will be eagerly verified
// (go/verified-lazy).
return field->options().lazy() && !IsEagerlyVerifiedLazyField(field);
if (field->type() != FieldDescriptor::TYPE_MESSAGE || field->is_repeated()) {
return false;
}
return field->options().unverified_lazy();
}
bool Reflection::IsEagerlyVerifiedLazyField(
const FieldDescriptor* field) const {
return (field->type() == FieldDescriptor::TYPE_MESSAGE &&
schema_.IsEagerlyVerifiedLazyField(field));
if (field->type() != FieldDescriptor::TYPE_MESSAGE) return false;
// Message fields with [lazy=true] will be eagerly verified
// (go/verified-lazy).
if (field->options().lazy() && !field->is_repeated()) return true;
return schema_.IsEagerlyVerifiedLazyField(field);
}
internal::field_layout::TransformValidation Reflection::GetLazyStyle(

@ -124,7 +124,7 @@ message TestAllTypes {
repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
repeated string repeated_cord = 55 [ctype=CORD];
repeated NestedMessage repeated_lazy_message = 57 ;
repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
// Singular with defaults
optional int32 default_int32 = 61 [default = 41 ];

Loading…
Cancel
Save