Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.3.2
-
None
Description
java-fragment:
-----------------------------------------------------
GroovyScriptEngine groovyScriptEngine = new GroovyScriptEngine(resourceConnector);
CompilerConfiguration cc = new CompilerConfiguration();
cc.setScriptBaseClass(DelegatingScript.class.getName());
groovyScriptEngine.setConfig(cc);
DelegatingScript delegatingScript = (DelegatingScript)groovyScriptEngine.createScript(scriptPath, groovyBinding);
delegatingScript.setDelegate(delegate);
Object returnValue = delegatingScript.run();
-----------------------------------------------------
the error is that createScript() will not create a DelegatingScript and will cause a classcastexception
Attachments
Issue Links
- duplicates
-
GROOVY-6203 GroovyScriptEngine does not take script base class into account
- Closed