You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Keegan Witt (JIRA)" <ji...@apache.org> on 2015/07/30 15:31:04 UTC
[jira] [Closed] (GROOVY-7531) Aliased static imports wrong in stubs
[ https://issues.apache.org/jira/browse/GROOVY-7531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keegan Witt closed GROOVY-7531.
-------------------------------
Resolution: Duplicate
Sorry about the dupe, didn't see this in my search results.
> Aliased static imports wrong in stubs
> -------------------------------------
>
> Key: GROOVY-7531
> URL: https://issues.apache.org/jira/browse/GROOVY-7531
> Project: Groovy
> Issue Type: Bug
> Components: Stub generator / Joint compiler
> Affects Versions: 2.4.4
> Reporter: Keegan Witt
>
> I believe GROOVY-7366 didn't account for aliasing in imports. For example, if I have
> {code:java|title=Application.groovy}
> import static Util.hello as hi
> class Application {
> static void main(def args) {
> hi
> }
> }
> {code}
> {code:java|title=Util.groovy}
> class Util {
> static void sayHello() {
> println "Hello"
> }
> }
> {code}
> The generated stub looks like
> {code:java|title=Application.java}
> import java.lang.*;
> import java.io.*;
> import java.net.*;
> import java.util.*;
> import groovy.lang.*;
> import groovy.util.*;
> import static Util.hi;
> public class Application
> extends java.lang.Object implements
> groovy.lang.GroovyObject {
> ;
> public groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
> public void setMetaClass(groovy.lang.MetaClass mc) { }
> public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;}
> public java.lang.Object getProperty(java.lang.String property) { return null;}
> public void setProperty(java.lang.String property, java.lang.Object value) { }
> public static void main(java.lang.String... args) { }
> }
> {code}
> When it should be like
> {code:java|title=Application.java}
> import java.lang.*;
> import java.io.*;
> import java.net.*;
> import java.util.*;
> import groovy.lang.*;
> import groovy.util.*;
> import static Util.hello;
> public class Application
> extends java.lang.Object implements
> groovy.lang.GroovyObject {
> ;
> public groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
> public void setMetaClass(groovy.lang.MetaClass mc) { }
> public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;}
> public java.lang.Object getProperty(java.lang.String property) { return null;}
> public void setProperty(java.lang.String property, java.lang.Object value) { }
> public static void main(java.lang.String... args) { }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)