Migrate away from `OneofDescriptor.isSynthetic()`

PiperOrigin-RevId: 544416186
pull/13163/head
Sandy Zhang 1 year ago committed by Copybara-Service
parent b17c4f9e5f
commit 137e9b57a8
  1. 2
      java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java
  2. 3
      java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java

@ -167,7 +167,7 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory {
}
};
}
if (fd.getContainingOneof() != null && !fd.getContainingOneof().isSynthetic()) {
if (fd.getRealContainingOneof() != null) {
// Build a oneof member field for non-synthetic oneofs.
builder.withField(buildOneofMember(messageType, fd, oneofState, enforceUtf8, enumVerifier));
continue;

@ -2460,8 +2460,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri
final Class<? extends Builder<?>> builderClass,
final String containingOneofCamelCaseName) {
isOneofField =
descriptor.getContainingOneof() != null
&& !descriptor.getContainingOneof().isSynthetic();
descriptor.getRealContainingOneof() != null;
hasHasMethod = descriptor.hasPresence();
ReflectionInvoker reflectionInvoker =
new ReflectionInvoker(

Loading…
Cancel
Save