groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniil Ovchinnikov <daniil.ovchinni...@jetbrains.com>
Subject Re: Synthetic GroovyObject methods
Date Wed, 07 Mar 2018 08:12:00 GMT
I’ve created https://issues.apache.org/jira/browse/GROOVY-8495 <https://issues.apache.org/jira/browse/GROOVY-8495>
to track this.

—

Daniil Ovchinnikov
Software Developer
JetBrains
jetbrains.com
“Drive to develop”



> On 6 Mar 2018, at 18:39, Daniil Ovchinnikov <daniil.ovchinnikov@jetbrains.com>
wrote:
> 
> 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 { 
>    @Override
>    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 exist.
> 
> —
> 
> Daniil Ovchinnikov
> Software Developer
> JetBrains
> jetbrains.com
> “Drive to develop”
> 


Mime
View raw message