Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2503 MOP 2.0 design inflluencing issues
  3. GROOVY-2433

Closure in base class unable to call private methods when invoked from derived class

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-1
    • groovy-runtime
    • None

    Description

      Closures defined in base classes are not able to access private methods in the same base class, when invoked from a derived class. Java visibility rules imply that this should not happen. When the private methods are made public, the error disappears. Also, when the closure is converted to a method the problem also disappears. Compiling and running the TestCase class included (along with Base class) should reproduce the problem. It's easier to see the problem than to try and describe it.

      Attachments

        1. testcase.zip
          0.5 kB
          David Clark

        Issue Links

          Activity

            People

              emilles Eric Milles
              davidclark David Clark
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: