groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: Groovy doesn't follow java beans specification on certain edge cases?
Date Fri, 29 May 2015 13:39:47 GMT
Am 29.05.2015 15:32, schrieb Miro Bezjak:
[...]
> As far as I can see, this only affects java.beans. The following example
> works without any problem:
> --------------------------------------
> class Foo {
>      String cName
> }
>
> def f = new Foo()
> f.cName = 'abc'
> println f.cName // abc
> --------------------------------------
>
>
> One workaround is to define proper getter and setter:
> --------------------------------------
> class Foo {
>      String cName
>
>      String getCName() { cName }
>      void setCName(String cName) { this.cName = cName }
> }
>
> new java.beans.PropertyDescriptor('cName', Foo) // ok now
> --------------------------------------

that would mean the isCName method missing is a false flag and really 
this is about capitalization of property names

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/


Mime
View raw message