Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6994

GroovyScriptEngine does not honor CompilerConfiguration for delegateScriptClass

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              Unassigned Unassigned
              alfredreibenschuh Alfred Reibenschuh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: