First script engine call can incorrectly report error as in a builtin, 
subsequent identical calls do not
--------------------------------------------------------------------------------------------------------

                 Key: JRUBY-3113
                 URL: http://jira.codehaus.org/browse/JRUBY-3113
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.1.5
         Environment: Linux clevo 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 
EDT 2008 i686 i686 i386 GNU/Linux

            Reporter: David Campbell
            Priority: Minor


from #jruby:
CaneToad: it seems the first time you invoke the script engine, it can report 
the error to be in the builtins when it isn't...doesn't happens on subsequent 
calls to the script engine
headius: hmmm
...
headius: I'd say go ahead and file it

Java code to reproduce:
////////////////////////////////////////////////////////////////////

import javax.script.*;
public class jruby2 {
  public static void run(ScriptEngine engine, String msg) {
    System.err.println(msg);
    try {
      engine.eval("a=Hello");
    } catch(ScriptException e) {
      e.getCause().printStackTrace(System.err);
    }
  }
  public static void main(String [] args) throws Exception {
    ScriptEngineManager manager = new ScriptEngineManager(); 
    ScriptEngine engine = manager.getEngineByName("jruby");
    run(engine, "------------ first");
    run(engine, "------------ second");
  }
}

////////////////////////////////////////////////////////////////////

Here's what it gives:

[EMAIL PROTECTED] ~]$ javac -classpath .:jruby.jar:jruby-engine.jar jruby2.java
[EMAIL PROTECTED] ~]$ java -classpath .:jruby.jar:jruby-engine.jar jruby2
------------ first
/builtin/javasupport.rb:49:in `const_missing': uninitialized constant Hello 
(NameError)
        from <unknown>:1
        ...internal jruby stack elided...
        from Module.const_missing(<unknown>:1)
        from (unknown).(unknown)(:1)
------------ second
null:1:in `const_missing': uninitialized constant Hello (NameError)
        from <unknown>:1
        ...internal jruby stack elided...
        from Module.const_missing(<unknown>:1)
        from (unknown).(unknown)(:1)


Notice that the first call reports the error in a builtin, while the second 
identical call does not


-- 
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


Reply via email to