0

I'm working with a Java API which contains several overloaded functions of the form

class Someclass ...

public static A fun(AInterface,java.lang.String[],java.lang.String[],double[][])

public static A fun(AInterface,java.lang.String[],java.lang.String[],java.lang.String[][])

Pseudocode b/c I don't have the code in front of me. Now, I'm trying to call this function from jruby. My calling code looks something like this:

Someclass::fun(@b, ["foo"], ["bar"], [["baz"], ["qux"]])

@b is an instance of A; A implements the AInterface interface.

Yet I'm getting

NameError: no method 'fun' for arguments (my.thing.A,org.jruby.RubyArray,org.jruby.RubyArray,org.jruby.RubyObject) on Java::mything::A available overloads: (my.thing.AInterface,java.lang.String[],java.lang.String[],double[][]) (my.thing.AInterface,java.lang.String[],java.lang.String[],java.lang.String[][]) ...

Changing the calling code to:

Someclass::fun(@b, [["foo"]].to_java(java.lang.String[]), [["bar"]].to_java(java.lang.String[]), [["baz"], ["qux"]].to_java(java.lang.String[][]))

does not help.

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.