[ https://issues.apache.org/jira/browse/GROOVY-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381387#comment-15381387 ]
ASF GitHub Bot commented on GROOVY-7862: ---------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/351 > 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 > > 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.4#6332)