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

The inner class representing a closure has a bad constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-4
    • 1.0
    • class generator
    • None

    Description

      for a oneliner script like this:

      c = {}

      The Groovy compier generates an inner class like this (as decompiled with JAD):

      public class _cls1 extends Closure
      {

      public Object doCall(Object obj)

      { return null; }

      private FuncLoose owner;

      public _cls1(Object obj)

      { // implicit call to Closure(), which does not exist owner = (FuncLoose)FuncLoose.this; }

      }

      The constructor does not call the super with the delegate.

      Somehow it manages to run... amazing!

      Attachments

        Issue Links

          Activity

            People

              guillaume Guillaume Sauthier
              bingran Bing Ran
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: