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

The runtime must instantiate or avoid the nulled MetaClass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.1
    • 1.5.6, 1.6-beta-1
    • class generator
    • None
    • Windows XP/ Eclipse 3.3.2

    Description

      This is what happens. I use xstream to serliaze an object which contains closures in its graph.. When I convert the xml back to an object, the closure, the metaClass of the closure does not get instantiated and remains null. I cannot execute the closure and get a null Pointer exception. Intrestingly methods of the closure objects, like getMetaClass() and getClass() fail after the closure is deserialized.

      Jochen Theodorou has pointed out that while Objects inheriting from GroovyObject do a null check before accessing the Metaclass, Closures inherit from GroovyObjectSupport and dont do a null check

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            priya.siddharth Siddharth Priya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: