[
https://issues.apache.org/jira/browse/GROOVY-11764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11764:
---------------------------------
Description:
Consider the following:
{code:groovy}
package p
class A {
public Number getValue() {
42
}
}
class B extends A {
@PackageScope String value = 'xx'
}
// not in package p:
class C extends B {
void test() {
print(super.value)
}
}
{code}
I was expecting this to print "42" since {{C}} does not have access to the
package-private field {{value}} of {{B}}. However, the script throws an
{{IllegalAccessError}}.
was:
Consider the following:
{code:groovy}
package p
class A {
public Number getValue() {
42
}
}
class B extends A {
@PackageScope String value = 'xx'
}
// not package p:
class C extends B {
void test() {
print(super.value)
}
}
{code}
I was expecting this to print "42" since {{C}} does not have access to the
package-private field {{value}} of {{B}}. However, the script throws an
{{IllegalAccessError}}.
> super property resolution
> -------------------------
>
> Key: GROOVY-11764
> URL: https://issues.apache.org/jira/browse/GROOVY-11764
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Priority: Minor
>
> Consider the following:
> {code:groovy}
> package p
> class A {
> public Number getValue() {
> 42
> }
> }
> class B extends A {
> @PackageScope String value = 'xx'
> }
> // not in package p:
> class C extends B {
> void test() {
> print(super.value)
> }
> }
> {code}
> I was expecting this to print "42" since {{C}} does not have access to the
> package-private field {{value}} of {{B}}. However, the script throws an
> {{IllegalAccessError}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)