提交 8f02d1a8 authored 作者: sylvain-ilm's avatar sylvain-ilm

removed unused invoke() method

上级 67eb291e
...@@ -26,12 +26,10 @@ import java.util.ArrayList; ...@@ -26,12 +26,10 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.script.Bindings;
import javax.script.Compilable; import javax.script.Compilable;
import javax.script.CompiledScript; import javax.script.CompiledScript;
import javax.script.ScriptEngineManager; import javax.script.ScriptEngineManager;
import javax.script.ScriptException; import javax.script.ScriptException;
import javax.script.SimpleBindings;
import javax.tools.FileObject; import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager; import javax.tools.ForwardingJavaFileManager;
import javax.tools.JavaCompiler; import javax.tools.JavaCompiler;
...@@ -240,24 +238,6 @@ public class SourceCompiler { ...@@ -240,24 +238,6 @@ public class SourceCompiler {
return null; return null;
} }
public Object invoke(String className, final Object... args) throws Exception {
String source = sources.get(className);
if (isJavaxScriptSource(source)) {
final Bindings bindings = new SimpleBindings();
int i = 0;
for (final Object arg : args) {
bindings.put("arg" + i, arg);
i++;
}
return this.getCompiledScript(className).eval(bindings);
} else {
final Method m = this.getMethod(className);
if (m.getParameterTypes().length != args.length)
throw new IllegalStateException("Wrong number of parameters, " + args.length + " were pased but " + m.getParameterTypes().length + " were needed");
return m.invoke(null, args);
}
}
/** /**
* Compile the given class. This method tries to use the class * Compile the given class. This method tries to use the class
* "com.sun.tools.javac.Main" if available. If not, it tries to run "javac" * "com.sun.tools.javac.Main" if available. If not, it tries to run "javac"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论