Embedded problem with callMethod -------------------------------- Key: JRUBY-4552 URL: http://jira.codehaus.org/browse/JRUBY-4552 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Environment: Windows XP 64, JDK 1.6.0.18 Reporter: Alex K Priority: Blocker Fix For: JRuby 1.4 Attachments: JRubyTest.java
ScriptingContainer l_container = new ScriptingContainer(LocalContextScope.SINGLETON, LocalVariableBehavior.TRANSIENT); l_container.runScriptlet("class Driver \n" + " def test= value \n" + " @test = value \n" + " end \n" + " def test \n" + " @test \n" + " end \n" + "end \n "); RubyObject l_obj1 = (RubyObject)l_container.runScriptlet("Driver.new"); RubyObject l_obj2 = (RubyObject)l_container.runScriptlet("Driver.new"); l_container.callMethod(l_obj1, "test=", "obj1", Object.class ); l_container.callMethod(l_obj2, "test=", "obj2", Object.class ); System.out.println( "1) obj1=" + l_obj1.callMethod("test")); System.out.println( "1) obj2=" + l_obj2.callMethod("test")); System.out.println( "2) obj1=" + l_obj1.callMethod("test")); System.out.println( "2) obj2=" + l_obj2.callMethod("test")); //here it starts to break System.out.println( "3) obj1=" + l_container.callMethod(l_obj1, "test", String.class)); System.out.println( "3) obj2=" + l_container.callMethod(l_obj2, "test", String.class)); System.out.println( "4) obj1=" + l_obj1.callMethod("test")); System.out.println( "4) obj2=" + l_obj2.callMethod("test")); produces 1) obj1=obj1 1) obj2=obj2 2) obj1=obj1 2) obj2=obj2 3) obj1=obj2 <- here it starts to break 3) obj2=obj2 4) obj1=obj2 4) obj2=obj2 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - 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