Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jrubyscripting] Remove Compilable implementation #17960

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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