groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-7862) Statically compiled calls to protected methods of an outerclass' superclass result in IllegalAccessErrors
Date Tue, 02 May 2017 02:04:20 GMT

     [ 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)

Mime
View raw message