You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/02/01 23:19:06 UTC

[jira] [Closed] (GROOVY-7966) Change in source order changes output in Java+Groovy joint compilation

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

Paul King closed GROOVY-7966.
-----------------------------

> Change in source order changes output in Java+Groovy joint compilation
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-7966
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7966
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.7
>            Reporter: Lóránt Pintér
>            Assignee: Paul King
>             Fix For: 2.4.8
>
>
> When compiling these three classes
> AbstractThing.groovy:
> {code}
> class AbstractThing {}
> {code}
> Thing.groovy:
> {code}
> class Thing extends AbstractThing {}
> {code}
> JavaThing.java:
> {code}
> public class JavaThing {}
> {code}
> Two different results are produced for {{Thing.class}} based on the order of the source files provided to the Groovy compiler:
> {code}
> $ groovyc -d output -j AbstrctThing.groovy Thing.groovy JavaThing.java
> $ javap output/Thing.class
> Compiled from "Thing.groovy"
> public class Thing extends AbstractThing {
>   public static transient boolean __$stMC;
>   public Thing();
>   protected groovy.lang.MetaClass $getStaticMetaClass();
>   public groovy.lang.MetaClass super$2$$getStaticMetaClass();
> }
> $ groovyc -d output -j Thing.groovy AbstrctThing.groovy JavaThing.java
> $ javap output/Thing.class
> Compiled from "Thing.groovy"
> public class Thing extends AbstractThing implements groovy.lang.GroovyObject {
>   public static transient boolean __$stMC;
>   public Thing();
>   protected groovy.lang.MetaClass $getStaticMetaClass();
>   public groovy.lang.MetaClass super$2$$getStaticMetaClass();
> }
> {code}
> Notice that when the source for the abstract superclass follows the source of the concrete class, the concrete class ends up implementing {{GroovyObject}}, but not if the order of the two source files is reversed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)