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

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: groovy-runtime
    • Labels:
      None
    • Environment:
      OS: Gentoo Linux; Groovy Version: 1.5.0; JVM: 1.6.0-b105; Hardware: Dual Core HP Laptop

      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.

      1. testcase.zip
        0.5 kB
        David Clark

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              David Clark
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development