XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.3
    • None
    • groovy-runtime
    • 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}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            wcherry William Cherry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: