Bug 101387

Summary: [1.5][compiler] Incorrect Cycle detected in type hierarchy error
Product: [Eclipse Project] JDT Reporter: Carl Quinn <cquinn>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mlists
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: All   
OS: All   
Whiteboard:

Description Carl Quinn CLA 2005-06-22 21:05:58 EDT
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"
Comment 1 Philipe Mulet CLA 2005-06-23 03:39:36 EDT
Reproduced in RC3
Comment 2 Kent Johnson CLA 2005-06-23 10:55:14 EDT
Simpler testcase:

class X<I, C extends I> {}

class Y extends X<Y.M, Y.N> {
	static class M {}
	static class N extends M {}
}
Comment 3 Kent Johnson CLA 2005-07-05 14:45:49 EDT
Released into the 3.1.1 branch
Comment 4 Kent Johnson CLA 2005-07-05 14:46:14 EDT
Added GenericTypeTest test050b
Comment 5 Olivier Thomann CLA 2005-08-09 10:53:06 EDT
Verified in 3.2M1 (I20050808-2000)
Comment 6 Olivier Thomann CLA 2005-09-26 11:01:27 EDT
Verified for 3.1.1 using M20050923-1430.