[ 
https://issues.apache.org/jira/browse/GROOVY-8495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King resolved GROOVY-8495.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.5.3
                   3.0.0-alpha-4

These methods are no longer synthetic normally but are instead marked 
@Generated. There was a condition where we didn't add @Generated due to an NPE 
that would occur in that scenario - I believe that would normally only occur 
when creating AST fragments which we do for some of our unit tests. But since I 
am unsure what some AST transformations might do, I left that condition in and 
for that case I leave the methods as synthetic.

there is some code when using the metaclass mixin capability which used to skip 
synthetic methods. It now skips also @Generated methods. We'll need to see 
whether we need to make that condition more specific.

> GroovyObject method implementations are marked with ACC_SYNTHETIC
> -----------------------------------------------------------------
>
>                 Key: GROOVY-8495
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8495
>             Project: Groovy
>          Issue Type: Bug
>          Components: bytecode, class generator, Compiler
>            Reporter: Daniil Ovchinnikov
>            Assignee: Paul King
>            Priority: Critical
>             Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> {code}
> class GroovyClass {}
> {code}
> {noformat:title=javap -v (stripped)}
> ...
> public class com.example.groovylib.GroovyClass implements 
> groovy.lang.GroovyObject
>   flags: ACC_PUBLIC, ACC_SUPER
> ...
> {
>   public static transient boolean __$stMC;
>     descriptor: Z
>     flags: ACC_PUBLIC, ACC_STATIC, ACC_TRANSIENT, ACC_SYNTHETIC
>   public com.example.groovylib.GroovyClass();
>     descriptor: ()V
>     flags: ACC_PUBLIC
>   protected groovy.lang.MetaClass $getStaticMetaClass();
>     descriptor: ()Lgroovy/lang/MetaClass;
>     flags: ACC_PROTECTED, ACC_SYNTHETIC
>   public groovy.lang.MetaClass getMetaClass();
>     descriptor: ()Lgroovy/lang/MetaClass;
>     flags: ACC_PUBLIC, ACC_SYNTHETIC
>   public void setMetaClass(groovy.lang.MetaClass);
>     descriptor: (Lgroovy/lang/MetaClass;)V
>     flags: ACC_PUBLIC, ACC_SYNTHETIC
>     
>   public java.lang.Object invokeMethod(java.lang.String, java.lang.Object);
>     descriptor: (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
>     flags: ACC_PUBLIC, ACC_SYNTHETIC
>     
>   public java.lang.Object getProperty(java.lang.String);
>     descriptor: (Ljava/lang/String;)Ljava/lang/Object;
>     flags: ACC_PUBLIC, ACC_SYNTHETIC
>   public void setProperty(java.lang.String, java.lang.Object);
>     descriptor: (Ljava/lang/String;Ljava/lang/Object;)V
>     flags: ACC_PUBLIC, ACC_SYNTHETIC
> }
> SourceFile: "GroovyClass.groovy"
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to