Is there any reason why implementations of GroovyObject methods which are 
injected into Groovy classes are marked with ACC_SYNTHETIC? 

This causes all sorts of confusion:

class GroovyClass {}

class JavaClass extends GroovyClass {} // compiles ok

class JavaClass extends GroovyClass implements GroovyObject {} // error: 
JavaClass is not abstract and does not override abstract method 
setMetaClass(MetaClass) in GroovyObject

class JavaClass extends GroovyClass { 
    public Object getProperty(String propertyName) {
        return super.getProperty(propertyName); // error: cannot find symbol: 
method getProperty(String)

class JavaClass {
    void usage() {
        new GroovyClass().getProperty("a”); // error: cannot find symbol: 
method getProperty(String)

This happens because javac ignores ACC_SYNTHETIC members as if they don’t even 


Daniil Ovchinnikov
Software Developer
“Drive to develop”

Reply via email to