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

Inner classes of inner classes can't find outer class method names.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.10
    • 1.8-rc-4, 1.7.11
    • None
    • None

    Description

      Jay Ashworth reported a problem that arose between 1.7.6 and 1.7.7. His example used Swing events and requires manual clicking to use. I've reduced it to a simple test case (although not in JUnit form).

      The interesting thing is that it takes two levels of Runnable inner classes for the problem to show up. Turns out threads are not part of the issue.

      Demo script attached. The output for Groovy 1.7.10 is:

      Resolved
      After
      Resolved
      Caught: java.lang.NoSuchMethodError: TestInnerRefs$2.this$dist$invoke$2(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
      at TestInnerRefs$2$3.methodMissing(TestRunner.groovy)
      at TestInnerRefs$2$3.run(TestRunner.groovy:24)
      at TestInnerRefs$2.run(TestRunner.groovy:27)
      at TestInnerRefs.dontEvent(TestRunner.groovy:31)
      at TestRunner.run(TestRunner.groovy:49)

      Attachments

        1. TestRunner.groovy
          0.7 kB
          James P. White

        Activity

          People

            blackdrag Jochen Theodorou
            jimwhite James P. White
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: