Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.6.3
-
None
-
None
Description
Dynamically created static fields don't show up as properties as do non-dynamic static fields. The book authors field shows up and is accessible but the book2 authors does not.
class Book { def name def map = [:] } Book.metaClass.authors = [:] def book = new Book(name: "Groovy") book.metaClass.properties.each(){println it.name} println "**********************************" class Book2 { def name def static staticMap = [:] } Book2.metaClass.static.authors = [:] def book2 = new Book2(name: "Failure") book2.metaClass.properties.each(){println it.name}