[
https://issues.apache.org/jira/browse/GROOVY-11373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11373.
----------------------------------
Fix Version/s: 5.0.0-alpha-9
Resolution: Fixed
https://github.com/apache/groovy/commit/131992c98e9de226aeac50917b37c4bfff31b21e
> IllegalAccessError writing package-private property of other-package
> map-based type
> -----------------------------------------------------------------------------------
>
> Key: GROOVY-11373
> URL: https://issues.apache.org/jira/browse/GROOVY-11373
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.0-alpha-8, 4.0.21
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-9
>
>
> Consider the following:
> {code:java}
> package p;
> public class C extends java.util.HashMap {
> public void setFoo(Object x) {}
> protected void setBar(Object x) {}
> void setBaz(Object x) {}
> private void setBoo(Object x) {}
> }
> {code}
> {code:groovy}
> @groovy.transform.CompileStatic
> void test(p.C p_c) {
> p_c.foo = null // works
> p_c.bar = null // SC: Method setBar is protected in p.C
> p_c.baz = null // IllegalAccessError
> p_c.boo = null // SC: Cannot call private method p.C#setBoo of class ...
> }
> {code}
> Prior to GROOVY-11319, each of the non-public references produced error
> "Cannot access method setBxx(java.lang.Object) from class: p.C" -- error
> improved by GROOVY-11223.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)