Created
October 12, 2009 11:51
-
-
Save bluescreen303/208347 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a java method that requires one or more classes: | |
public class FlagBinder { | |
public static Module parseFlags(String[] args, Class<?>... flagSettings) throws ParseException { | |
I tried different kinds of combinations of .java_class, .to_java but couldn't get it working. | |
Java code that uses this class does this: | |
Module flags = FlagBinder.parseFlags(args, FlagSettings.class); | |
Now in ruby I tried: | |
flags = FlagBinder.parseFlags(args, FlagSettings.java_class) | |
and I get this error: | |
method FlagBinder.parseFlags expected [class [Ljava.lang.String;, class [Ljava.lang.Class;]; got: [[Ljava.lang.String;,java.lang.Class]; error: argument type mismatch (TypeError) | |
how can I get the expected (Ljava.lang.Class) object to pass? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment