Details
Description
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.
Attachments
Issue Links
- relates to
-
GROOVY-10902 Dynamic constants for primitive types get default value in Java
- Closed