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 2016/12/09 12:13:58 UTC

[jira] [Resolved] (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 resolved GROOVY-7966.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.8

Proposed PR merged. This doesn't alter what is in the Java stub which is still impacted by ordering (i.e. different ordering can produce an equivalent but slightly differently defined class) but any final Groovy class is no longer impacted. I am assuming this meets the original intent for this issue.

> 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.4#6332)