Skip to content

Instantly share code, notes, and snippets.

@bluescreen303
Created October 12, 2009 11:51
Show Gist options
  • Save bluescreen303/208347 to your computer and use it in GitHub Desktop.
Save bluescreen303/208347 to your computer and use it in GitHub Desktop.
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