Skip to content

Commit

Permalink
[jrubyscripting] Remove Compilable implementation (openhab#17960)
Browse files Browse the repository at this point in the history
due to a bug in JRuby jruby/jruby#8346

Signed-off-by: Jimmy Tanagra <[email protected]>
  • Loading branch information
jimtng authored Dec 23, 2024
1 parent 5eb47a0 commit d253e2c
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import java.util.Objects;

import javax.script.Bindings;
import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.Invocable;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
Expand All @@ -37,7 +35,9 @@
* @author Jimmy Tanagra - Initial contribution
*/
@NonNullByDefault
public class JRubyEngineWrapper implements Compilable, Invocable, ScriptEngine {
public class JRubyEngineWrapper implements Invocable, ScriptEngine {
// Don't implement Compilable because there is a bug
// in JRuby's compiled scripts: https://github.com/jruby/jruby/issues/8346

private final JRubyEngine engine;

Expand All @@ -48,16 +48,6 @@ public class JRubyEngineWrapper implements Compilable, Invocable, ScriptEngine {
this.engine = Objects.requireNonNull(engine);
}

@Override
public CompiledScript compile(@Nullable String script) throws ScriptException {
return new JRubyCompiledScriptWrapper(engine.compile(script));
}

@Override
public CompiledScript compile(@Nullable Reader reader) throws ScriptException {
return new JRubyCompiledScriptWrapper(engine.compile(reader));
}

@Override
public Object eval(@Nullable String script, @Nullable ScriptContext context) throws ScriptException {
Object ctx = Objects.requireNonNull(context).getBindings(ScriptContext.ENGINE_SCOPE).get(CONTEXT_VAR_NAME);
Expand Down

0 comments on commit d253e2c

Please sign in to comment.