You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/05/19 10:33:12 UTC

[jira] [Commented] (GROOVY-6203) GroovyScriptEngine does not take script base class into account

    [ https://issues.apache.org/jira/browse/GROOVY-6203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15290871#comment-15290871 ] 

ASF GitHub Bot commented on GROOVY-6203:
----------------------------------------

GitHub user roded opened a pull request:

    https://github.com/apache/groovy/pull/335

    GROOVY-6203: GroovyScriptEngine does not take script base class into …

    …account
    
    https://issues.apache.org/jira/browse/GROOVY-6203
    
    The alternative as I see it was to remove the config's setter and add it to the constructors. 
    Comments welcome.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/roded/groovy master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/335.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #335
    
----
commit a4b91d623024717d4a4ffb1f9f726b7386e0dea3
Author: Roded Bahat <ro...@gmail.com>
Date:   2016-05-19T10:30:27Z

    GROOVY-6203: GroovyScriptEngine does not take script base class into account

----


> GroovyScriptEngine does not take script base class into account
> ---------------------------------------------------------------
>
>                 Key: GROOVY-6203
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6203
>             Project: Groovy
>          Issue Type: Bug
>          Components: GroovyScriptEngine
>    Affects Versions: 2.0.5
>            Reporter: Julien Nicoulaud
>              Labels: contrib
>
> When configuring GroovyScriptEngine with a custom script base class, the script engine does not take it account:
> {code}
> CompilerConfiguration cc = new CompilerConfiguration();
> cc.setScriptBaseClass(ScriptBase.class.getName());
> GroovyScriptEngine engine = new GroovyScriptEngine("file://.");
> engine.setConfig(cc);
> Script script = engine.createScript("test.groovy", new Binding());
> assertTrue(script instanceof ScriptBase); // fails
> {code}
> This has been discussed here: http://groovy.329449.n5.nabble.com/setScriptBaseClass-does-not-work-for-GroovyScriptEngine-td5710646.html
> The workaround with setting the CompilerConfiguration on the GroovyClassLoader works.
> Also related: GROOVY-3281



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)