You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/03/03 20:14:00 UTC

[jira] [Updated] (GROOVY-9955) IllegalAccessError exception is raised when accessing inherited static field

     [ https://issues.apache.org/jira/browse/GROOVY-9955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-9955:
--------------------------------
    Fix Version/s: 3.0.8

> IllegalAccessError exception is raised when accessing inherited static field
> ----------------------------------------------------------------------------
>
>                 Key: GROOVY-9955
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9955
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.5.14, 3.0.7, 4.0.0-alpha-2
>            Reporter: Basil Peace
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 3.0.8, 4.0.0-alpha-3
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The same problem as in related issue but with static fields.
> a/b/PackageScopedParent.java:
> {code:java}
> package a.b;
> class PackageScopedParent {
>   public static final String TEST = "test";
> }
> {code}
> a/b/PublicChildren.java:
> {code:java}
> package a.b;
> public class PublicChildren extends PackageScopedParent {
> }
> {code}
> c/Usage.groovy:
> {code:java}
> package c
> import a.b.PublicChildren
> import groovy.transform.CompileStatic
> @CompileStatic
> class Usage {
>   static void main(String[] args) {
>     println PublicChildren.TEST
>   }
> }
> {code}
> error:
> {noformat}
> java.lang.IllegalAccessError: failed to access class a.b.PackageScopedParent from class c.Usage (a.b.PackageScopedParent and c.Usage are in unnamed module of loader 'app')
>   at c.Usage.main(Usage.groovy:9){noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)