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

Enclosing method is not set for anonymous inner classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 1.8.8, 2.0.2
    • None
    • None

    Description

      The enclosing method is not set for anonymous inner classes. AST transformations may rely on that information (actually, GROOVY-5647 has a workaround for this).

      For example:

      class A {
         void enclosingMethod() {
             Runnable r = new Runnable() { void run() {} }
         }
      }
      

      If you inspect the AST, you will see that encoding method for the anonymous runnable is null.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: