what has changed about groovy class properties after the GINA book? -


i reading groovy in action (gina) book. in chapter 9, there listing:

class myclass {     def first = 1     def getsecond() { first * 2 }     public third = 3  }  obj = new myclass()  keys = ['first', 'second', 'third', 'class', 'metaclass'] assert obj.properties.keyset() == new hashset( keys )  // fail 

however, following assert right one:

keys = ['first', 'second', 'class'] assert obj.properties.keyset() == new hashset( keys ) 

so, has changed groovy class properties after gina book? thank you.

from forum book, looks bit error, or changed , no 1 sure what.

you're better getting access meap second edition of book covers groovy 2


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -