Menu

#332 bsh.engine.BshScriptEngine impls Compilable, throws Error

None
closed
nobody
General (151)
5
2018-08-02
2010-01-16
No

bsh.engine.BshScriptEngine (JSR-223 javax.script support) implements Compilable, indicating to script hosts that the engine currently supports compilation. I believe that a runtime instanceof Compilable and cast is the main way of determining whether pre-compilation to a CompiledScript is supported by the current ScriptEngine.

In BeanShell 2.0b4 the ScriptEngine class bsh.engine.BshScriptEngine implements Compilable, but then goes on to:

public CompiledScript compile( Reader script ) throws
ScriptException
{
// todo
throw new Error("unimplemented");
}

See http://ikayzo.org/svn/beanshell/BeanShell/engine/src/bsh/engine/BshScriptEngine.java

This is unfortunate for clients with pluggable ScriptEngine-s, of which BeanShell may be one, as they can expect to be able to pre-compile scripts due to the presence of the interface, but will always receive the thrown error.

Recommend that the Compilable interface is removed until BeanShell and the BshScriptEngine support compilation.

Discussion

  • Anonymous

    Anonymous - 2011-02-27

    Status of http://jcp.org/en/jsr/detail?id=274 is "inactive"

    Support of JSR-223 became never an official released feature (as far as i can see at www.beanshell.org - it was part of 2.0 beta 5 which was never released).

    Nevertheless, because beanshell is now dormant there is a fork at http://code.google.com/p/beanshell2

    For jsr-223 support in the fork please comment on http://code.google.com/p/beanshell2/issues/detail?id=43

     

    Last edit: Anonymous 2015-08-11
  • nickl-

    nickl- - 2018-08-02
    • status: open --> closed
    • Group: -->
     
  • nickl-

    nickl- - 2018-08-02

    Ticket has been migrated to github.
    Please follow up on this over here: https://github.com/beanshell/beanshell/issues/470

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.