[ 
https://issues.apache.org/jira/browse/GROOVY-6898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-6898:
------------------------------
    Fix Version/s:     (was: 3.x)
                   4.x

> Changes to metaclasses should not leak into subsequent script executions
> ------------------------------------------------------------------------
>
>                 Key: GROOVY-6898
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6898
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.3.2
>            Reporter: Jochen Kemnade
>            Priority: Major
>             Fix For: 4.x
>
>
> This is roughly related to GROOVY-5786.
> When executing a script in the Groovy ScriptEngine (the JSR223 one) and that 
> script makes changes to the metaclass registry, the modification will be 
> available to the next script.
> For example, If I execute
> {code}
> String.metaClass {
>   foobar ={ 
>     delegate
>   }
> }
> print("Hello".foobar())
> {code}
> the script prints {{"Hello"}}.
> If I execute
> {code}
> print("Hello".foobar())
> {code}
> in the same engine again, it prints {{"Hello"}} again. I think it should 
> throw a {{MissingMethodException}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to