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

Paul King updated GROOVY-9615:
------------------------------
    Fix Version/s: 2.5.13

> super.method() can trigger method on outer class in case of missing method
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-9615
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9615
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.19, 3.0.4, 2.5.12
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-alpha-1, 3.0.5, 2.5.13
>
>
> Consider the following:
> {code:groovy}
> class Outer {
>     class Inner {
>         void test() {
>             super.whatever()
>         }
>     }
>     void whatever() {
>         assert false : 'should not have been called!'
>     }
> }
> new Outer.Inner(new Outer()).test()
> {code}
> When method in Inner is called, instead of method missing exception, the 
> method on Outer is called.  This is because 
> ScriptBytecodeAdapter.invokeMethodOnSuper triggers 
> MetaClassImpl.invokeMissingMethod, which calls its missingMethod reference 
> regardless of isCallToSuper setting.



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

Reply via email to