Groovy
  1. Groovy
  2. GROOVY-5095

MetaClassRegistryChangeEventListener doesn't provide a way to get a reference to the old meta class

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: 1.8.4, 2.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      There is currently no way to know what the previous meta class was in the case of listening for meta class registry change events. This is because you only get a reference to the class and the new meta class in the event. The event is fired after the meta class is changed as well so you can't even use the class to lookup the old meta class. Please provide a way to get hold of the old meta class.

        Activity

        Hide
        Cédric Champeau added a comment -

        MetaClassRegistryChangeEvent now has new getters :

        • getOldMetaClass which returns the old metaclass as needed
        • isPerInstanceMetaClassChange which tells if the change is per-instance
        • getInstance which returns the object on which a per-instance metaclass change has been triggered
        Show
        Cédric Champeau added a comment - MetaClassRegistryChangeEvent now has new getters : getOldMetaClass which returns the old metaclass as needed isPerInstanceMetaClassChange which tells if the change is per-instance getInstance which returns the object on which a per-instance metaclass change has been triggered

          People

          • Assignee:
            Cédric Champeau
            Reporter:
            Graeme Rocher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development