You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Shil Sinha (JIRA)" <ji...@apache.org> on 2015/07/20 16:15:04 UTC

[jira] [Updated] (GROOVY-7510) Static import of a static property causes joint compilation to fail

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

Shil Sinha updated GROOVY-7510:
-------------------------------
    Summary: Static import of a static property causes joint compilation to fail  (was: Statically importing a static property causes joint compilation to fail)

> Static import of a static property causes joint compilation to fail
> -------------------------------------------------------------------
>
>                 Key: GROOVY-7510
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7510
>             Project: Groovy
>          Issue Type: Bug
>          Components: Stub generator / Joint compiler
>    Affects Versions: 2.4.4
>         Environment: JDK 1.8.0_25
>            Reporter: Shil Sinha
>
> Due to the addition of static imports in generated stubs (per https://issues.apache.org/jira/browse/GROOVY-7366), the following test now fails:
> {code}
> package org.codehaus.groovy.tools.stubgenerator
> class ImportStaticPropertyTest extends StringSourcesStubTestCase {
>   @Override
>   Map<String, String> provideSources() {
>       [
>               'A.groovy': '''
>                   package test
>                   class A {
>                       static String aString
>                   }
>               ''',
>               'B.groovy': '''
>                   package test
>                   import static test.A.aString
>                   class B {
>                       String returnAString(){
>                           return aString
>                       }
>                   }
>               ''',
>               'C.java': '''
>                   package test;
>                   public class C {
>                       public static void main(String[] args) {
>                           B b;
>                       }
>                   }
>               '''
>       ]
>   }
>   @Override
>   void verifyStubs() {
>   }
> }
> {code}
> The error produced is:
> {code}
> error: cannot find symbol
> import static test.A.aString;
> ^
>   symbol:   static aString
>   location: class
> {code}
> Adding a {{public}} modifier to aString will cause aString to be included in the generated stub for A, in which case the test will pass.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)