Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.4
-
None
-
Groovy Version: 2.3.4
JVM: 1.7.0_51 Vendor: Oracle Corporation
OS: Mac OS X
Description
Accessing a public final method declared in non public super class will raise IllegalAccessError exception. For example:
Base.java
package acme; class Base { public final void foo() { System.out.println("Hello"); } }
Test.java
package acme; public class Test extends Base { }
Main.groovy
import groovy.transform.* import acme.* @CompileStatic class Main { public static void main(String[] args) { def x = new Test (); x.foo(); } }
Result in the following exception
Caught: java.lang.IllegalAccessError: tried to access class acme.Base from class Main java.lang.IllegalAccessError: tried to access class acme.Base from class Main at Main.main(Main.groovy:9)
Attachments
Issue Links
- is related to
-
GROOVY-9955 IllegalAccessError exception is raised when accessing inherited static field
- Closed