[
https://issues.apache.org/jira/browse/GROOVY-7510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-7510.
-----------------------------
> 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
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-beta-2
>
>
> 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
(v8.20.1#820001)