[
https://issues.apache.org/jira/browse/GROOVY-9587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-9587.
-----------------------------
> Scope of method call changed from non-static to static 2.4->2.5
> ---------------------------------------------------------------
>
> Key: GROOVY-9587
> URL: https://issues.apache.org/jira/browse/GROOVY-9587
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.12
> Reporter: Eric Helgeson
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-1, 3.0.5, 2.5.13
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
>
> {code:java}
> class Foo {
> static storageProvider
> def getStorageProvider(Boolean a) {
> return storageProvider
> }
> def getStorageProvider() {
> if(!storageProvider) {
> getStorageProvider(true) // <-- Attempts to call statically in 2.5
> }
> return storageProvider
> }
> }
> new Foo().getStorageProvider()
> {code}
> In groovy 2.5+ it seems it gets confused if you have a static variable in a
> class, say static storageProvider, and a non-static method def
> getStorageProvider(Boolean x) it tries to call the getStorageProvider(true)
> statically, which does not exist.
>
> In the groovyConsole you can see the change happen between conversion and
> semantic analysis - it changes from non-static to static.
>
> Unsure this is intended or not. I couldn't find mention of it in any changes.
> It would be nice to document/know why the change happened between 2.4/2.5.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)