Details

    • Type: Sub-task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.8.6
    • Fix Version/s: None
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      If a class defines a private field and a method that uses a closures referencing this private field, then a groovy.lang.MissingPropertyException is thrown any time this method is called from a subclass.

      It can be reproduced in the groovy console with the script in attachment. If "iterate" is called on the parent it works (text is appended to stdout - no exception), but if it is called from the subclass it fails (only the text from outside the closure is displayed and then an exception is thrown).

      This issue come from a deeper investigation on http://groovy.329449.n5.nabble.com/Exception-when-extending-ASTTransformationCustomizer-td5630073.html

      1. reproduce.groovy
        0.3 kB
        Mathieu Bruyen

        Activity

        Hide
        bummer Jan Šmucr added a comment - - edited

        Just came across this issue as well (Groovy 2.4.7). It also makes threads with their body defined in superclass being unable to access superclass' private properties.

        Show
        bummer Jan Šmucr added a comment - - edited Just came across this issue as well (Groovy 2.4.7). It also makes threads with their body defined in superclass being unable to access superclass' private properties.
        Hide
        blackdrag Jochen Theodorou added a comment -

        this extends to inner classes

        Show
        blackdrag Jochen Theodorou added a comment - this extends to inner classes
        Hide
        roadrunner Fergal Monaghan added a comment -

        I think this is the same as GROOVY-4692.

        Show
        roadrunner Fergal Monaghan added a comment - I think this is the same as GROOVY-4692 .

          People

          • Assignee:
            Unassigned
            Reporter:
            mathbruyen Mathieu Bruyen
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development