Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created August 20, 2013 10:05
Show Gist options
  • Save mkristian/6279638 to your computer and use it in GitHub Desktop.
Save mkristian/6279638 to your computer and use it in GitHub Desktop.
calling overloaded method from jruby
public class C {
public void m( String[] args, Object f ) {
System.out.println( "asd" );
}
public void m( String[] args ) {
System.out.println( args.length );
}
}
irb(main)> C.new.m ['a'].to_java, 'a'.to_java
NameError: no method 'm' for arguments (org.jruby.java.proxies.ArrayJavaProxy,java.lang.String) on Java::Default::C
from (irb):12:in `evaluate'
from org/jruby/RubyKernel.java:1093:in `eval'
from org/jruby/RubyKernel.java:1489:in `loop'
from org/jruby/RubyKernel.java:1254:in `catch'
from org/jruby/RubyKernel.java:1254:in `catch'
from /home/christian/install/jruby/bin/jirb:13:in `(root)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment