We have a lot of methods accepting CharSequence instead of String.
Inline::Java says "Can't convert /whatever/ to object
java.lang.CharSequence" when trying to invoke such methods.
Can it be fixed?
#!/usr/bin/perl -w
use Inline Java => <<'END_OF_JAVA_CODE', STUDY => ['java.lang.CharSequence'],
AUTOSTUDY => 1;
public class Foo {
public String csToString(CharSequence cs) {
return cs.toString();
}
public CharSequence stringToCs(String str) {
return str;
}
}
END_OF_JAVA_CODE
my $foo = new Foo();
# This should work but doesn't.
die if $foo->csToString('bar') ne 'bar';
# This doesn't work either.
die if $foo->csToString($foo->stringToCs('bar')) ne 'bar';