Community
Participate
Working Groups
The compiler is incorrectly reporting a problem with parameterized classes when their parameters are populated using nested classes more than one level deep. The code in question compiles & runs fine under javac. Greatly simplified test case (which I think should compile): abstract class ObjectInput {} abstract class Factory<O, I extends ObjectInput, C extends I> {} class Foo {} public class FooFactory extends Factory<Foo, FooFactory.Input, FooFactory.CreateInput> { static class Input extends ObjectInput {} static class CreateInput extends Input {} } There are then errors reported on the "Input" near the end, on the "FooFactory.CreateInput" in the FooFactory parameter population, and on "FooFactory" itself. I think the primal error is the one on "Input", which is: "Cycle detected: a cycle exists in the type hierarchy between FooFactory.CreateInput and FooFactory"
Reproduced in RC3
Simpler testcase: class X<I, C extends I> {} class Y extends X<Y.M, Y.N> { static class M {} static class N extends M {} }
Released into the 3.1.1 branch
Added GenericTypeTest test050b
Verified in 3.2M1 (I20050808-2000)
Verified for 3.1.1 using M20050923-1430.