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

The runtime must instantiate or avoid the nulled MetaClass

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.6, 1.6-beta-1
    • Component/s: class generator
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: