Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Working with inner java classes, there are two different issues which I feel belong together.
Consider this java class which I will reference from a groovy script:
package foogroovy;
public class Outer
{
public Outer() {}
public static class Inner
{
public Inner() {}
}
}
Problem #1: making the script compile
The following script does not compile due to a MissingClassException.
It ONLY works when the inner class is referenced and imported as Outer$Inner.
//--------------------------------------------------------------------
import foogroovy.Outer;
// import foogroovy.Outer$Inner;
// this is the only way to make at least case 2 compile
class UseInner1
{
static void main( String[] args )
}
Problem #2: getting the correct class
Problem #1 can be solved by importing foogroovy.*;. This leads to another issue. Outer.Inner.class seems to be a java.lang.class!!
//--------------------------------------------------------------------
import foogroovy.*;
class UseInner2
{
static void main( String[] args )
}