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

Paul King updated GROOVY-3358:
------------------------------
    Fix Version/s:     (was: 4.x)

> static imports don't work for statically defined getters (property access)
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-3358
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3358
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: Compiler
>            Reporter: Graeme Rocher
>            Priority: Major
>
> So I have a class that defines:
> {code}
> public static Environment getCurrentEnvironment()
> {code}
> I use this class like:
> {code}
> import static grails.util.Environment.*
> {code}
> However this throws a MPE:
> {code}
> println currentEnvironment
> {code}
> whilst this works
> {code}
> println getCurrentEnvironment()
> {code}
> Seems wrong that propery notation should work for a static getter when it 
> works when used directly:
> {code}
> import grails.util.Environment
> println Environment.currentEnvironment
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to