[
https://issues.apache.org/jira/browse/GROOVY-10611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10611:
---------------------------------
Fix Version/s: 2.5.22
> 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
> Components: Stub generator / Joint compiler
> Affects Versions: 3.0.10
> Reporter: Torbjørn G. Dahle
> Assignee: Eric Milles
> Priority: Major
> Fix For: 3.0.11, 4.0.3, 2.5.22
>
>
> 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.10#820010)