From b5beba3aa15f76967c00c3b2c90b58abd51123bb Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 5 Feb 2024 10:12:04 -0800 Subject: [PATCH] Move the RubyMessage.java JSON "include defaults" to use alwaysPrintFieldsWithNoPresence. This is no different on proto3 but treats proto2-optional differently (to make it consistent with proto3-optional). PiperOrigin-RevId: 604354927 --- ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f8c3950237..2b533dfc45 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java @@ -700,7 +700,7 @@ public class RubyMessage extends RubyObject { options.fastARef(runtime.newSymbol("format_enums_as_integers")); if (emitDefaults != null && emitDefaults.isTrue()) { - printer = printer.includingDefaultValueFields(); + printer = printer.alwaysPrintFieldsWithNoPresence(); } if (preserveNames != null && preserveNames.isTrue()) {