You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JRuby version: 9.2.0.0 jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.171-b11 on 1.8.0_171-b11 +jit [darwin-x86_64]
Operating system and platform: Darwin inpranavb.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
Expected Behavior
With the JRuby/Java interop, I'd expect that it should be possible to merge a java java.util.HashMap object with a ruby Hash object. Esp because the java.util.HashMap seems to implement a merge method.
Actual Behavior
$ java -jar jruby-complete-9.2.0.0.jar -e 'java.util.HashMap.new.merge({})'
ArgumentError: wrong number of arguments (1 for 3)
<main> at -e:1
The text was updated successfully, but these errors were encountered:
a won't fix - with JI its always Java methods first. here there's a collision with java.util.Map's merge
... which did not exist until Java 8, however JRuby provides a work-around by setting up conflicting methods with a ruby_ prefix, thus: java.util.HashMap.new.ruby_merge({}) ... works as expected
Environment
Provide at least:
jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.171-b11 on 1.8.0_171-b11 +jit [darwin-x86_64]
Darwin inpranavb.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
Expected Behavior
With the JRuby/Java interop, I'd expect that it should be possible to merge a java
java.util.HashMap
object with a rubyHash
object. Esp because thejava.util.HashMap
seems to implement amerge
method.Actual Behavior
The text was updated successfully, but these errors were encountered: