Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: 1. Create Java project. 2. Create two Java classes p.A and q.A (with the same name 'A' but in different packages 'p' and 'q'). 3. Make class p.A a template by declaring it as public class A<E> {...} 4. Make class q.A a subclass of p.A: public class A extends p.A<Object> {...} Make sure that everything is ok yet. 5. Make a deliberate error in code of class q.A by adding import: import p.A; and save the file. Make sure that builder reports the problem 'The import p.A conflicts with a type defined in the same file', but system works without failures. 6. Make one more deliberate error by changing declaration of q.A as public class A extends A<Object> {...} (that is, as if we expect that the added import is going to work) and save the file. At this moment, system failure may or may not occur. In my case the system still worked ok, and reported one more problem 'Cycle detected'. 7.In file q.A select declaration fragment 'A<Object>', invoke context menu by mouse right click and select 'Open Type Hierarchy' menu action. System either hangs or shows error dialog reporting 'Stack overflow'. Stack trace shows cycling in class org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver More information: When system hangs, it is usually in method getDepth() in class org.eclipse.jdt.internal.ui.typehierarchy.TraditionalHierarchyViewer$TraditionalHierarchyContentProvider infinitely repeating line superType= hierarchy.getSuperclass(superType) in the body of 'while' operator. When 'Stack overflow' is reported, it is usually cycling in class org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver To reproduce the problem it is important to manipulate with two classes (rather than one trying to extend itself) and to make one of them template.
Created attachment 87505 [details] Proposed fix and regression tests
Fix and test released for 3.4M5
Verified for 3.4M5 using I20080204-0010