You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/02 02:04:20 UTC
[jira] [Closed] (GROOVY-7862) Statically compiled calls to
protected methods of an outerclass' superclass result in
IllegalAccessErrors
[ https://issues.apache.org/jira/browse/GROOVY-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-7862.
-----------------------------
> Statically compiled calls to protected methods of an outerclass' superclass result in IllegalAccessErrors
> ---------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-7862
> URL: https://issues.apache.org/jira/browse/GROOVY-7862
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.4.7
> Reporter: Shil Sinha
> Assignee: Shil Sinha
> Fix For: 2.5.0-alpha-1
>
>
> Example:
> {code}
> package one;
> public class Base {
> protected int foo() {
> 123
> }
> }
> {code}
> {code}
> package two;
> class SubBase extends Base {
> class Inner {
> int test() {
> foo()
> }
> }
>
> int innerTest() {
> new Inner().test()
> }
> }
> assert new SubBase().innerTest() == 123
> {code}
> The code above will fail with the following error:
> {code}
> java.lang.IllegalAccessError: tried to access method one.Base.foo()I from class two.SubBase$Inner
> {code}
> This is due to bridge methods for protected methods not being correctly generated (and subsequently used when writing protected method invocations.)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)