use "proto3_optional" option as signal that a field has presence.

This is technically redundant with the synthetic oneof container, but simplifies some tooling.

PiperOrigin-RevId: 604368850
pull/15713/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 4d23fa068a
commit 986d691d77
  1. 3
      java/core/src/main/java/com/google/protobuf/Descriptors.java

@ -1443,7 +1443,8 @@ public final class Descriptors {
if (isRepeated()) {
return false;
}
return getType() == Type.MESSAGE
return isProto3Optional
|| getType() == Type.MESSAGE
|| getType() == Type.GROUP
|| getContainingOneof() != null
|| this.features.getFieldPresence() != DescriptorProtos.FeatureSet.FieldPresence.IMPLICIT;

Loading…
Cancel
Save