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
ArgumentError: wrong number of arguments (1 for 2)
in the collect call.
Inspection in irb shows my method:
two_even_squares.java_class.java_instance_methods.map(&:to_s).reject do
|e| e !~ /.*collect.*/ end
=> ["public final java.lang.Object
java.util.stream.ReferencePipeline.collect(java.util.stream.Collector)",
"public final java.lang.Object
java.util.stream.ReferencePipeline.collect(java.util.function.Supplier,java.util.function.BiConsumer,java.util.function.Bi
Consumer)"]
Getting explicit doesn't help:
irb(main):024:0> two_even_squares.java_send :collect,
[java.util.function.Supplier,java.util.function.BiConsumer,java.util.function.BiConsumer],
l1, l2, l3
ArgumentError: wrong number of arguments (1 for 2)
from org/jruby/java/proxies/JavaProxy.java:352:in `java_send'
from (irb):24:in `<eval>'
from org/jruby/RubyKernel.java:978:in `eval'
from org/jruby/RubyKernel.java:1291:in `loop'
from org/jruby/RubyKernel.java:1098:in `catch'
from org/jruby/RubyKernel.java:1098:in `catch'
from C:/languages/jruby/jruby-9.0.4.0/bin/jirb:13:in `<top>'
The text was updated successfully, but these errors were encountered:
hitting conflicts with proc-impl method dispatch using method_missing, this one in particular is due to Predicate#test ending up as Kernel#test - simplified failing test-case would be e.g. :
ArgumentError: wrong number of arguments (1 for 2)
from org/jruby/gen/InterfaceImpl1011617339.gen:13:in `test'
from (irb):6:in `evaluate'
from org/jruby/RubyKernel.java:1079:in `eval'
from org/jruby/RubyKernel.java:1479:in `loop'
from org/jruby/RubyKernel.java:1242:in `catch'
from org/jruby/RubyKernel.java:1242:in `catch'
from /opt/local/rvm/rubies/jruby-1.7.22/bin/jirb:13:in `(root)'
... hooking up methods to be implemented directly should be considered
NOTE: have been dealing with a similar issue where Runnable#run did collide with test-unit 2 being present as it adds a run method (which has just changed lately on 3.1).
kares
changed the title
JRuby doesn't play nice with the new stream api
proc-to-interface dispatch method collision using Java 8 streams
Nov 21, 2015
…impl using a block
we're now add an internal "impl" method for each prescribed abstract interface method
this is expected to resolve conflicting issues (e.g using Java 8 streams) such as jruby#3475
kares
added a commit
to kares/jruby
that referenced
this issue
Apr 18, 2016
…impl using a block
we're now add an internal "impl" method for each prescribed abstract interface method
this is expected to resolve conflicting issues (e.g using Java 8 streams) such as jruby#3475
// cc @Lan5432 if you're interested in understanding the internals - there's a PR that resolves this issue and some more problems under Java 8 with interfaces. (<= 9.0.5 failing) specs are provided part of the PR.
The following java code:
yields:
The ostensibly equivalent JRuby code:
bombs out with:
in the collect call.
Inspection in irb shows my method:
Getting explicit doesn't help:
The text was updated successfully, but these errors were encountered: