title: Using groovy 'super' keyword when referencing properties of a java superclass
body: <p>I've inherited a large groovy/java project and I am stumbling upon a usage pattern that just doesn't seem to work, but I can't figure out why.</p>
  
  <p>My predecessor makes frequent use of a java superclass and 
  many groovy subclasses. In the subclasses, he has getters that perform a 
  lazy initialize and then, through the use of a property, set a value on 
  the super class. Unfortunately, this seems to throw a NoSuchFieldError.</p>
  
  <p>I was able to reproduce this in a small test case, given below. 
  Essentially, referencing a property as "super.property" is throwing a 
  NoSuchFieldError, but referencing it as just "property" works fine.</p>
  
  <p>Here's some Java base classes:</p>
  
  <pre><code>public interface Content {
       public String getValue();
  }
  
  public class HolderJava {
       private Content _content;
       public Content getContent() { return _content; }
       public void setContent(Content value) { _content = value; }
  }
  </code></pre>
  
  <p>And here are some groovy classes that extend them:</p>
  
  <pre><code>class ContentGroovy implements Content {
       def     value
       public String getValue() {
           value
       }
  }
  
  class HolderGroovy extends HolderJava {
       public ContentGroovy getContent() {
           ContentGroovy    newContent = new ContentGroovy()
           newContent.value = "snarf"
  
           // doesn't work, throws NoSuchFieldError
           //super.content = newContent
  
           // works
           content = newContent
  
           newContent
       }
  
       public static void main( String[] args ) {
           println( new HolderGroovy().getContent().getValue() )
       }
  }
  </code></pre>