Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2925

ExpandoMetaClass sometimes, but sometimes MetaClassImpl

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.6-beta-1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The type of a new instance of a class depends on whether the metaClass property on its class has been accessed before. That is just not right.

      groovy> class A {}
      groovy> println A.metaClass
      groovy> def a = new A ()
      groovy> println a.metaClass
      groovy> println A.metaClass

      groovy.lang.ExpandoMetaClass@b05c54[class A]
      groovy.lang.ExpandoMetaClass@b05c54[class A]
      groovy.lang.ExpandoMetaClass@b05c54[class A]
      groovy> class A {}
      groovy> //println A.metaClass
      groovy> def a = new A ()
      groovy> println a.metaClass
      groovy> println A.metaClass

      groovy.lang.MetaClassImpl@a7eb57[class A]
      groovy.lang.ExpandoMetaClass@2e22ed[class A]

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              robertfischer Robert Fischer
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: