mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-31 05:24:24 +02:00
[jrubyscripting] Implement AutoCloseable on JRubyEngineWrapper (#18560)
This now possible since JRuby 10 implements it. Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
+6
-1
@@ -35,7 +35,7 @@ import org.jruby.embed.jsr223.JRubyEngine;
|
||||
* @author Jimmy Tanagra - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class JRubyEngineWrapper implements Invocable, ScriptEngine {
|
||||
public class JRubyEngineWrapper implements Invocable, ScriptEngine, AutoCloseable {
|
||||
// Don't implement Compilable because there is a bug
|
||||
// in JRuby's compiled scripts: https://github.com/jruby/jruby/issues/8346
|
||||
|
||||
@@ -205,4 +205,9 @@ public class JRubyEngineWrapper implements Invocable, ScriptEngine {
|
||||
public <T> T getInterface(@Nullable Object receiver, @Nullable Class<T> returnType) {
|
||||
return engine.getInterface(receiver, returnType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
engine.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user