Migrate away from examining the syntax of a proto file via reflection.

PiperOrigin-RevId: 511796130
pull/12023/head
Sandy Zhang 2 years ago committed by Copybara-Service
parent 684a3dedf6
commit 2a55706f9d
  1. 5
      java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java

@ -2407,10 +2407,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri
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,

Loading…
Cancel
Save