Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.9
-
None
Description
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:
class Test { static String getTestProperty { "test" } boolean isTestProperty { true } } Test.testProperty // => groovy.lang.MissingPropertyException
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?