I am reading the Groovy in Action (GINA) book. In chapter 9, there is this 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, the following assert is actually the right one:
keys = ['first', 'second', 'class']
assert obj.properties.keySet() == new HashSet( keys )
So, what has changed about groovy class properties after the GINA book? Thank you.