package fitnesse.slim;

import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Proxy;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public abstract class gitJsr223Bridge {

  private ScriptEngine engine;

  public abstract Proxy getStatementExecutor() throws Exception;

  public abstract Object invokeMethod(Object thiz, String name, Object... args)
      throws Exception;

  public ScriptEngine getScriptEngine() {
    if (engine == null) {
      engine = new ScriptEngineManager().getEngineByName(getEngineName());
    }
    return engine;
  }

  public void close() {
    try {
      ((Closeable)getScriptEngine()).close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
  
  public abstract String getEngineName();
}

@@ -32,157 +32,156 @@
 java
-.io.Closeable;%0Aimport java.io.IOException;%0Aimport java.lang.reflect.Proxy;%0A%0Aimport javax.script.ScriptEngine;%0Aimport javax.script.ScriptEngineManager
+x.script.ScriptEngine;%0Aimport javax.script.ScriptEngineManager;%0Aimport java.io.Closeable;%0Aimport java.io.IOException;%0Aimport java.lang.reflect.Proxy
 ;%0A%0Ap
@@ -205,11 +205,8 @@
 ass 
-git
 Jsr2

fix inadvertent typo