Skip to content

Commit

Permalink
Migrate away from examining the syntax of a proto file via reflection.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 511796130
  • Loading branch information
zhangskz authored and copybara-github committed Feb 23, 2023
1 parent 684a3de commit 2a55706
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2407,10 +2407,7 @@ public void clear(final GeneratedMessageV3.Builder<?> builder) {
isOneofField =
descriptor.getContainingOneof() != null
&& !descriptor.getContainingOneof().isSynthetic();
hasHasMethod =
descriptor.getFile().getSyntax() == FileDescriptor.Syntax.PROTO2
|| descriptor.hasOptionalKeyword()
|| (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE);
hasHasMethod = descriptor.hasPresence();
ReflectionInvoker reflectionInvoker =
new ReflectionInvoker(
descriptor,
Expand Down

0 comments on commit 2a55706

Please sign in to comment.