Description
While working on GROOVY-10077 I found out, that there is actual a use case for allowing static variables in a script when executed in the same JVM instance.
One can always have a workaround like this:
class Static { static staticProperty = 'I am static' }
For example groovy.console.ui.view.MacOSXMenuBar.groovy had orgininally this code:
static handler = false if (!handler) {
...which was replaced with GROOVY-3768 by this code (and made the variable useless for the originally intented purpose):
def handler = false if (!handler) {
Attachments
Issue Links
- Discovered while testing
-
GROOVY-10077 Groovy Console: Support JDKs without macOS Runtime Support for Java
- Closed
- relates to
-
GROOVY-3768 Groovy compiler allows local variables to be marked static
- Closed
-
GROOVY-5364 Static property reference from static context in script does not compile
- Closed