We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4baf96 commit b9cf19bCopy full SHA for b9cf19b
java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java
@@ -2461,7 +2461,10 @@ public void clear(final GeneratedMessageV3.Builder<?> builder) {
2461
final String containingOneofCamelCaseName) {
2462
isOneofField =
2463
descriptor.getRealContainingOneof() != null;
2464
- hasHasMethod = descriptor.hasPresence();
+ hasHasMethod =
2465
+ descriptor.getFile().getSyntax() == FileDescriptor.Syntax.PROTO2
2466
+ || descriptor.hasOptionalKeyword()
2467
+ || (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE);
2468
ReflectionInvoker reflectionInvoker =
2469
new ReflectionInvoker(
2470
descriptor,
0 commit comments