3737#include " extensions/protobuf/internal/map_reflection.h"
3838#include " internal/json.h"
3939#include " internal/number.h"
40+ #include " internal/reflection_get_message.h"
4041#include " internal/status_macros.h"
4142#include " internal/well_known_types.h"
4243#include " google/protobuf/arena.h"
@@ -436,7 +437,8 @@ absl::StatusOr<EquatableValue> AsEquatableValue(
436437 return well_known_types::GetStringField (message, field, scratch);
437438 case FieldDescriptor::CPPTYPE_MESSAGE :
438439 return AsEquatableValue (
439- reflection, message.GetReflection ()->GetMessage (message, field),
440+ reflection,
441+ ReflectionGetMessage (message.GetReflection (), message, field),
440442 field->message_type (), scratch);
441443 default :
442444 return absl::InternalError (
@@ -1008,11 +1010,12 @@ class MessageEqualsState final {
10081010 Unique<Message> lhs_unpacked;
10091011 Unique<Message> rhs_unpacked;
10101012 if (lhs_field != nullptr && IsAnyField (lhs_field)) {
1011- CEL_ASSIGN_OR_RETURN (lhs_unpacked,
1012- well_known_types::UnpackAnyIfResolveable (
1013- &arena_, lhs_reflection_.any_reflection ,
1014- lhs.GetReflection ()->GetMessage (lhs, lhs_field),
1015- pool_, factory_));
1013+ CEL_ASSIGN_OR_RETURN (
1014+ lhs_unpacked,
1015+ well_known_types::UnpackAnyIfResolveable (
1016+ &arena_, lhs_reflection_.any_reflection ,
1017+ ReflectionGetMessage (lhs.GetReflection (), lhs, lhs_field), pool_,
1018+ factory_));
10161019 if (lhs_unpacked) {
10171020 lhs_ptr = cel::to_address (lhs_unpacked);
10181021 lhs_field = nullptr ;
@@ -1027,11 +1030,12 @@ class MessageEqualsState final {
10271030 }
10281031 }
10291032 if (rhs_field != nullptr && IsAnyField (rhs_field)) {
1030- CEL_ASSIGN_OR_RETURN (rhs_unpacked,
1031- well_known_types::UnpackAnyIfResolveable (
1032- &arena_, rhs_reflection_.any_reflection ,
1033- rhs.GetReflection ()->GetMessage (rhs, rhs_field),
1034- pool_, factory_));
1033+ CEL_ASSIGN_OR_RETURN (
1034+ rhs_unpacked,
1035+ well_known_types::UnpackAnyIfResolveable (
1036+ &arena_, rhs_reflection_.any_reflection ,
1037+ ReflectionGetMessage (rhs.GetReflection (), rhs, rhs_field), pool_,
1038+ factory_));
10351039 if (rhs_unpacked) {
10361040 rhs_ptr = cel::to_address (rhs_unpacked);
10371041 rhs_field = nullptr ;
@@ -1093,7 +1097,7 @@ class MessageEqualsState final {
10931097 const Message* absl_nullable rhs_packed = nullptr ;
10941098 Unique<Message> rhs_unpacked;
10951099 if (rhs_field != nullptr && IsAnyField (rhs_field)) {
1096- rhs_packed = &rhs.GetReflection ()-> GetMessage ( rhs, rhs_field);
1100+ rhs_packed = &ReflectionGetMessage ( rhs.GetReflection (), rhs, rhs_field);
10971101 } else if (rhs_field == nullptr && IsAny (rhs)) {
10981102 rhs_packed = &rhs;
10991103 }
@@ -1121,7 +1125,7 @@ class MessageEqualsState final {
11211125 }
11221126 const Message* absl_nonnull rhs_message =
11231127 rhs_field != nullptr
1124- ? &rhs.GetReflection ()-> GetMessage ( rhs, rhs_field)
1128+ ? &ReflectionGetMessage ( rhs.GetReflection (), rhs, rhs_field)
11251129 : rhs_unpacked != nullptr ? cel::to_address (rhs_unpacked)
11261130 : &rhs;
11271131 const auto * rhs_descriptor = rhs_message->GetDescriptor ();
@@ -1174,7 +1178,7 @@ class MessageEqualsState final {
11741178 const Message* absl_nullable lhs_packed = nullptr ;
11751179 Unique<Message> lhs_unpacked;
11761180 if (lhs_field != nullptr && IsAnyField (lhs_field)) {
1177- lhs_packed = &lhs.GetReflection ()-> GetMessage ( lhs, lhs_field);
1181+ lhs_packed = &ReflectionGetMessage ( lhs.GetReflection (), lhs, lhs_field);
11781182 } else if (lhs_field == nullptr && IsAny (lhs)) {
11791183 lhs_packed = &lhs;
11801184 }
@@ -1202,7 +1206,7 @@ class MessageEqualsState final {
12021206 }
12031207 const Message* absl_nonnull lhs_message =
12041208 lhs_field != nullptr
1205- ? &lhs.GetReflection ()-> GetMessage ( lhs, lhs_field)
1209+ ? &ReflectionGetMessage ( lhs.GetReflection (), lhs, lhs_field)
12061210 : lhs_unpacked != nullptr ? cel::to_address (lhs_unpacked)
12071211 : &lhs;
12081212 const auto * lhs_descriptor = lhs_message->GetDescriptor ();
@@ -1262,7 +1266,7 @@ class MessageEqualsState final {
12621266 const Message* absl_nullable rhs_packed = nullptr ;
12631267 Unique<Message> rhs_unpacked;
12641268 if (rhs_field != nullptr && IsAnyField (rhs_field)) {
1265- rhs_packed = &rhs.GetReflection ()-> GetMessage ( rhs, rhs_field);
1269+ rhs_packed = &ReflectionGetMessage ( rhs.GetReflection (), rhs, rhs_field);
12661270 } else if (rhs_field == nullptr && IsAny (rhs)) {
12671271 rhs_packed = &rhs;
12681272 }
@@ -1290,7 +1294,7 @@ class MessageEqualsState final {
12901294 }
12911295 const Message* absl_nonnull rhs_message =
12921296 rhs_field != nullptr
1293- ? &rhs.GetReflection ()-> GetMessage ( rhs, rhs_field)
1297+ ? &ReflectionGetMessage ( rhs.GetReflection (), rhs, rhs_field)
12941298 : rhs_unpacked != nullptr ? cel::to_address (rhs_unpacked)
12951299 : &rhs;
12961300 const auto * rhs_descriptor = rhs_message->GetDescriptor ();
@@ -1342,7 +1346,7 @@ class MessageEqualsState final {
13421346 const Message* absl_nullable lhs_packed = nullptr ;
13431347 Unique<Message> lhs_unpacked;
13441348 if (lhs_field != nullptr && IsAnyField (lhs_field)) {
1345- lhs_packed = &lhs.GetReflection ()-> GetMessage ( lhs, lhs_field);
1349+ lhs_packed = &ReflectionGetMessage ( lhs.GetReflection (), lhs, lhs_field);
13461350 } else if (lhs_field == nullptr && IsAny (lhs)) {
13471351 lhs_packed = &lhs;
13481352 }
@@ -1370,7 +1374,7 @@ class MessageEqualsState final {
13701374 }
13711375 const Message* absl_nonnull lhs_message =
13721376 lhs_field != nullptr
1373- ? &lhs.GetReflection ()-> GetMessage ( lhs, lhs_field)
1377+ ? &ReflectionGetMessage ( lhs.GetReflection (), lhs, lhs_field)
13741378 : lhs_unpacked != nullptr ? cel::to_address (lhs_unpacked)
13751379 : &lhs;
13761380 const auto * lhs_descriptor = lhs_message->GetDescriptor ();
0 commit comments