Call to ScriptingContainer#callMethod(..., Integer.class) returns java-lang.Long
--------------------------------------------------------------------------------
Key: JRUBY-5937
URL: https://jira.codehaus.org/browse/JRUBY-5937
Project: JRuby
Issue Type: Bug
Components: Embedding, Java Integration
Affects Versions: JRuby 1.6.3
Environment: OS X 10.6.6, Java HotSpot(TM) 64-Bit Server VM 1.6.0_26
Reporter: Uwe Kubosch
The following code should succeed, but it fails:
{noformat}
import org.jruby.RubyInstanceConfig;
import org.jruby.embed.ScriptingContainer;
import org.jruby.runtime.builtin.IRubyObject;
class Test {
public static void main(String[] args) {
ScriptingContainer ruby;
System.setProperty("jruby.interfaces.useProxy", "true");
System.setProperty("jruby.bytecode.version", "1.5");
ruby = new ScriptingContainer();
RubyInstanceConfig config =
ruby.getProvider().getRubyInstanceConfig();
config.setCompileMode(RubyInstanceConfig.CompileMode.OFF);
config.setLoader(Test.class.getClassLoader());
int result;
IRubyObject block = (IRubyObject) ruby.runScriptlet("proc{1}");
result = (Integer) ruby.callMethod(block, "call" , 1, 2, 3,
Integer.class);
}
}
{noformat}
{noformat}
Exception in thread "main" java.lang.ClassCastException: java.lang.Long cannot
be cast to java.lang.Integer
at Test.main(Test.java:16)
{noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email