From 85d04c1dd46e0e9d348cb4c5e20d7874160c5d2c Mon Sep 17 00:00:00 2001 From: Charles Guo Date: Wed, 25 Jan 2023 19:31:27 -0500 Subject: [PATCH] In JRuby, respond to hazzer --- .../main/java/com/google/protobuf/jruby/RubyMessage.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java index 301b957982..7ecc80b2cc 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java @@ -306,11 +306,7 @@ public class RubyMessage extends RubyObject { if (methodName.startsWith(HAS_PREFIX) && methodName.endsWith(QUESTION_MARK)) { String strippedMethodName = methodName.substring(4, methodName.length() - 1); FieldDescriptor fieldDescriptor = descriptor.findFieldByName(strippedMethodName); - if (fieldDescriptor != null - && (!proto3 - || fieldDescriptor.getContainingOneof() == null - || fieldDescriptor.getContainingOneof().isSynthetic()) - && fieldDescriptor.hasPresence()) { + if (fieldDescriptor != null && fieldDescriptor.hasPresence()) { return context.runtime.getTrue(); } oneofDescriptor =