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 2022/05/01 15:43:00 UTC

[jira] [Assigned] (GROOVY-10611) Static fields not initialized when accessed from another class

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

Eric Milles reassigned GROOVY-10611:
------------------------------------

    Assignee: Eric Milles

> Static fields not initialized when accessed from another class
> --------------------------------------------------------------
>
>                 Key: GROOVY-10611
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10611
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.10
>            Reporter: Torbjørn G. Dahle
>            Assignee: Eric Milles
>            Priority: Major
>
> Accessing a static field in a Groovy class from a Java class stops working when upgrading from 3.0.9 to 3.0.10.
> I originally encountered this in a Grails project, but I've managed to make this sort of minimal reproduction here: [https://github.com/torbjorn-boost/groovy-static-field]
> When using 3.0.9, I get this:
> {{{}13:55:15: Executing ':JavaFile.main()'...{}}}{{{}> Task :compileJava NO-SOURCE{}}}
> {{> Task :compileGroovy}}
> {{> Task :processResources NO-SOURCE}}
> {{{}> Task :classes{}}}{{{}> Task :JavaFile.main(){}}}
> {{GroovyFile sees 123}}
> {{JavaFile sees 123}}
>  
> But if I bump to 3.0.10 in build.gradle, this happens:
> {{{}13:56:32: Executing ':JavaFile.main()'...{}}}{{{}> Task :compileJava NO-SOURCE{}}}
> {{> Task :compileGroovy}}
> {{> Task :processResources NO-SOURCE}}
> {{{}> Task :classes{}}}{{{}> Task :JavaFile.main(){}}}
> {{JavaFile sees 0}}
> This happens with JREs 8, 11 and 17.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)