Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.4
-
None
-
JDK 1.8.0_25
Description
Due to the addition of static imports in generated stubs (per https://issues.apache.org/jira/browse/GROOVY-7366), the following test now fails:
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() { } }
The error produced is:
error: cannot find symbol import static test.A.aString; ^ symbol: static aString location: class
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.