[
https://issues.apache.org/jira/browse/GROOVY-10985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17705375#comment-17705375
]
Eric Milles edited comment on GROOVY-10985 at 3/27/23 1:59 PM:
---------------------------------------------------------------
This is one of the test cases fixed near the release of Groovy 2.5:
https://github.com/apache/groovy/pull/724/files#diff-ea23dca162b35aacc0659dd540fa803d9c6b1e01d697927d49082ad6b43c639d
was (Author: emilles):
This is one of the test cases fixed near the release of Groovy 2.5:
https://github.com/apache/groovy/pull/724
> Precedence of self property over outer class field
> --------------------------------------------------
>
> Key: GROOVY-10985
> URL: https://issues.apache.org/jira/browse/GROOVY-10985
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> class Outer {
> private static int VALUE = 1
> static class Inner {
> def getProperty(String name) {
> if (name == "VALUE") return 2
> }
> void test() {
> print VALUE
> }
> }
> }
> new Outer.Inner().test()
> {code}
> Expecting "2" but prints "1". If {{Inner}} provides a "generic" property via
> getProperty, get or via a Map interface it is not used.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)