Skip to content

Commit d253e2c

Browse files
authored
[jrubyscripting] Remove Compilable implementation (openhab#17960)
due to a bug in JRuby jruby/jruby#8346 Signed-off-by: Jimmy Tanagra <[email protected]>
1 parent 5eb47a0 commit d253e2c

File tree

1 file changed

+3
-13
lines changed
  • bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal

1 file changed

+3
-13
lines changed

bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyEngineWrapper.java

+3-13
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import java.util.Objects;
1717

1818
import javax.script.Bindings;
19-
import javax.script.Compilable;
20-
import javax.script.CompiledScript;
2119
import javax.script.Invocable;
2220
import javax.script.ScriptContext;
2321
import javax.script.ScriptEngine;
@@ -37,7 +35,9 @@
3735
* @author Jimmy Tanagra - Initial contribution
3836
*/
3937
@NonNullByDefault
40-
public class JRubyEngineWrapper implements Compilable, Invocable, ScriptEngine {
38+
public class JRubyEngineWrapper implements Invocable, ScriptEngine {
39+
// Don't implement Compilable because there is a bug
40+
// in JRuby's compiled scripts: https://github.com/jruby/jruby/issues/8346
4141

4242
private final JRubyEngine engine;
4343

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

51-
@Override
52-
public CompiledScript compile(@Nullable String script) throws ScriptException {
53-
return new JRubyCompiledScriptWrapper(engine.compile(script));
54-
}
55-
56-
@Override
57-
public CompiledScript compile(@Nullable Reader reader) throws ScriptException {
58-
return new JRubyCompiledScriptWrapper(engine.compile(reader));
59-
}
60-
6151
@Override
6252
public Object eval(@Nullable String script, @Nullable ScriptContext context) throws ScriptException {
6353
Object ctx = Objects.requireNonNull(context).getBindings(ScriptContext.ENGINE_SCOPE).get(CONTEXT_VAR_NAME);

0 commit comments

Comments
 (0)