From 565154af78c01c0424833022179dbfbe43fb081c Mon Sep 17 00:00:00 2001 From: Mike Moore Date: Wed, 22 May 2019 13:21:51 -0600 Subject: [PATCH] Remove Ruby to_hash methods --- ruby/ext/google/protobuf_c/map.c | 1 - ruby/ext/google/protobuf_c/message.c | 1 - ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java | 2 +- ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ruby/ext/google/protobuf_c/map.c b/ruby/ext/google/protobuf_c/map.c index 55b7be4c66b3..cf1d6e377167 100644 --- a/ruby/ext/google/protobuf_c/map.c +++ b/ruby/ext/google/protobuf_c/map.c @@ -847,7 +847,6 @@ void Map_register(VALUE module) { rb_define_method(klass, "dup", Map_dup, 0); rb_define_method(klass, "==", Map_eq, 1); rb_define_method(klass, "hash", Map_hash, 0); - rb_define_method(klass, "to_hash", Map_to_h, 0); rb_define_method(klass, "to_h", Map_to_h, 0); rb_define_method(klass, "inspect", Map_inspect, 0); rb_define_method(klass, "merge", Map_merge, 1); diff --git a/ruby/ext/google/protobuf_c/message.c b/ruby/ext/google/protobuf_c/message.c index 850ab0eb5d8c..2f02c35445f3 100644 --- a/ruby/ext/google/protobuf_c/message.c +++ b/ruby/ext/google/protobuf_c/message.c @@ -737,7 +737,6 @@ VALUE build_class_from_descriptor(Descriptor* desc) { rb_define_method(klass, "eql?", Message_eq, 1); rb_define_method(klass, "hash", Message_hash, 0); rb_define_method(klass, "to_h", Message_to_h, 0); - rb_define_method(klass, "to_hash", Message_to_h, 0); rb_define_method(klass, "inspect", Message_inspect, 0); rb_define_method(klass, "to_s", Message_inspect, 0); rb_define_method(klass, "[]", Message_index, 1); diff --git a/ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java b/ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java index 3adaa2a8bdc1..89738624b85e 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java @@ -338,7 +338,7 @@ public IRubyObject dup(ThreadContext context) { return newMap; } - @JRubyMethod(name = {"to_h", "to_hash"}) + @JRubyMethod(name = "to_h") public RubyHash toHash(ThreadContext context) { return RubyHash.newHash(context.runtime, table, context.runtime.getNil()); } 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 c3a0d81c14a6..774db65a1292 100644 --- a/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java +++ b/ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java @@ -368,7 +368,7 @@ public static IRubyObject decodeJson(ThreadContext context, IRubyObject recv, IR return ret; } - @JRubyMethod(name = {"to_h", "to_hash"}) + @JRubyMethod(name = "to_h") public IRubyObject toHash(ThreadContext context) { Ruby runtime = context.runtime; RubyHash ret = RubyHash.newHash(runtime);