[
https://issues.apache.org/jira/browse/GROOVY-12570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun resolved GROOVY-12570.
---------------------------------
Fix Version/s: 7.0.0-alpha-1
6.0.1
Assignee: Daniel Sun
Resolution: Fixed
Fixed on master in eab0cfcee192d2a9a000eb4487bc3ac6b8799cde
(https://github.com/apache/groovy/commit/eab0cfcee192d2a9a000eb4487bc3ac6b8799cde,
#3099) and on the GROOVY_6_0_X branch in
864dfe6ac59f1c7d231ea65b0313594b98d462b7
(https://github.com/apache/groovy/commit/864dfe6ac59f1c7d231ea65b0313594b98d462b7).
> super.m() cannot reach a package-private method of a superclass defined by
> another class loader
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-12570
> URL: https://issues.apache.org/jira/browse/GROOVY-12570
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> {code:groovy}
> def shell = new GroovyShell()
> shell.evaluate '''package p
> class M { @groovy.transform.PackageScope String pm() { 'M' } }
> true
> '''
> shell.evaluate '''package p
> class B extends M { // same package name as M, but another class loader
> String pm() { 'B>' + super.pm() }
> }
> new B().pm()
> ''' // MissingMethodException; expected 'B>M'
> {code}
> The JVM does not let {{B.pm()}} override a package-private method of another
> run-time package, so no {{super$}} method can call it, and the meta-class
> drops the method from the methods for super calls without keeping the
> superclass method. Expected: in dynamic and {{@TypeChecked}} code,
> {{super.pm()}} calls {{M.pm()}}, and no {{super$}} method is generated for
> such a method, as it could only fail with {{IllegalAccessError}}. Under
> {{@CompileStatic}} it is reported with
> {{CompilerConfiguration.RUNTIME_PACKAGE_CHECK}} (GROOVY-12568).
> PR: https://github.com/apache/groovy/pull/3099
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)