Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.8.3
-
None
Description
(using Groovy 1.8.3, JVM 1.6.0_23 OpenJDK)
Given this class:
Foo.java
package org.test; public class Foo { public static class Bar { String message; public Bar(String message) { this.message = message; } } public static class Cat { Integer amount; public Cat(Integer amount) { this.amount = amount; } } }
Groovy code can import both of these static nested classes like this:
import static org.test.Foo.*
However, in Java they are imported like this:
import org.test.Foo.*;
Using the Groovy compiler to compile any Java files which do the above will result in the following error if any of the static nested classes are used:
App.java: 9: unable to resolve class Bar @ line 9, column 13. Bar bar = new Bar("Hello");
Is this expected? If so, is there a known workaround (or maybe I'm just doing it wrong...)?