mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 12:32:09 +08:00
对janino的编译级别进行设置
This commit is contained in:
@@ -16,12 +16,11 @@ public class JavaExecutor extends ScriptExecutor {
|
||||
|
||||
private final Map<String, IScriptEvaluator> compiledScriptMap = new CopyOnWriteHashMap<>();
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void load(String nodeId, String script) {
|
||||
try{
|
||||
IScriptEvaluator se = CompilerFactoryFactory.getDefaultCompilerFactory(this.getClass().getClassLoader()).newScriptEvaluator();
|
||||
se.setTargetVersion(8);
|
||||
se.setReturnType(Object.class);
|
||||
se.setParameters(new String[] {"_meta"}, new Class[] {ScriptExecuteWrap.class});
|
||||
se.cook(convertScript(script));
|
||||
@@ -40,7 +39,7 @@ public class JavaExecutor extends ScriptExecutor {
|
||||
throw new ScriptLoadException(errorMsg);
|
||||
}
|
||||
IScriptEvaluator se = compiledScriptMap.get(wrap.getNodeId());
|
||||
return se.evaluate(wrap);
|
||||
return se.evaluate(new Object[]{wrap});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user