title: Groovy subclass called superclass method that accesses closure
body: <p>I have a groovy superclass that looks like:</p>
  
  <pre><code>class AGroovyClass {
     private String str = "hello"
     void printString(int nTimes) {
       nTimes.times { println str } 
    }        
  }
  </code></pre>
  
  <p>and subclass</p>
  
  <pre><code>class AGroovySubclass extends AGroovyClass {
     // some other subclass methods
  }
  </code></pre>
  
  <p>My client code calls:</p>
  
  <pre><code>new AGroovySubclass().printString(5)
  </code></pre>
  
  <p>And this actually breaks because it says that that there is no such property "str" for AGroovySubclass</p>
  
  <p>I would have thought since the printString method is in AGroovyClass, it should have no problem accessing the "str" property, but clearly I am incorrect. If I wanted to keep "str" private, what is the appropriate way to make this work?</p>