groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shil Sinha (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-7510) Static import of a static property causes joint compilation to fail
Date Mon, 20 Jul 2015 14:15:04 GMT

     [ 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)

Mime
View raw message