[ 
https://issues.apache.org/jira/browse/GROOVY-10962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17697262#comment-17697262
 ] 

Philip Markus commented on GROOVY-10962:
----------------------------------------

Thank you for the feedback.

Sadly, I don't think @CompileStatic will help us, as we are interfacing mostly 
with Java-Classes, where the behavior is the same. If that makes any 
difference, I'm sorry for not specifying this earlier.

> Instance "isser" prevents resolving of static "getter"
> ------------------------------------------------------
>
>                 Key: GROOVY-10962
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10962
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 4.0.9
>            Reporter: Philip Markus
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.10
>
>
> While upgrading the Groovy-Version in our application, we noticed, like 
> others, that the priority of issers and getters have changed. This has 
> already been confirmed as intended behavior, but there seems to be some odd 
> behavior with static and instance accessors.
> When having a class with a static get-method that also has an instance 
> is-method, trying to access the static property via the class name an 
> exception is raised: *groovy.lang.MissingPropertyException: No such property: 
> x for class: mypackage.MyClass  Possible solutions: x*
> You can recreate this rather easily:
>  
> {code:java}
> class Test
> {
>   static String getTestProperty { "test" }
>   boolean isTestProperty { true }
> }
> Test.testProperty // => groovy.lang.MissingPropertyException
> {code}
>  
> Given that the property is called from a static context, one would assume, 
> that the instance method isTestProperty would not be in the way. However it 
> is. Removing the method, makes that static getTestProperty available again 
> via Test.testProperty.
> Is this also intended behavior?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to