[ https://issues.apache.org/jira/browse/GROOVY-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15333048#comment-15333048 ]
ASF GitHub Bot commented on GROOVY-7862: ---------------------------------------- GitHub user shils opened a pull request: https://github.com/apache/groovy/pull/351 GROOVY-7862: Statically compiled calls to protected methods of an out… …erclass' superclass result in IllegalAccessErrors You can merge this pull request into a Git repository by running: $ git pull https://github.com/shils/groovy GROOVY-7862 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/351.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #351 ---- commit daa0c34d6261d0bbc98f9edbf5814da3dd5200e6 Author: Shil Sinha <shil.si...@gmail.com> Date: 2016-06-15T23:16:34Z GROOVY-7862: Statically compiled calls to protected methods of an outerclass' superclass result in IllegalAccessErrors ---- > 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)