I haven't managed to reproduce this in a simple example, but as I'm upgrading my application from groovy 3 to 4 I have run into this situation. I have a class that defines a public static final string like this:
Its java stub fails to compile with:
I can remove the "public" from the declaration and the class/stub will compile, but now any java class that references that field will fail to compile with:
The only way I know to fix this is to convert the java class to groovy.