Skip to content

Commit b9cf19b

Browse files
authored
Automated rollback of commit 2a55706. (#14246)
* Automated rollback of commit 2a55706. PiperOrigin-RevId: 569253919 * Remove editions handling not relevant in 24.x
1 parent e4baf96 commit b9cf19b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,10 @@ public void clear(final GeneratedMessageV3.Builder<?> builder) {
24612461
final String containingOneofCamelCaseName) {
24622462
isOneofField =
24632463
descriptor.getRealContainingOneof() != null;
2464-
hasHasMethod = descriptor.hasPresence();
2464+
hasHasMethod =
2465+
descriptor.getFile().getSyntax() == FileDescriptor.Syntax.PROTO2
2466+
|| descriptor.hasOptionalKeyword()
2467+
|| (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE);
24652468
ReflectionInvoker reflectionInvoker =
24662469
new ReflectionInvoker(
24672470
descriptor,

0 commit comments

Comments
 (0)