| Summary: | [type hierarchy] Type Hierarchies don't show subtypes any more | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||||||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||||
| Severity: | blocker | ||||||||||||||
| Priority: | P3 | CC: | daniel_megert, deepakazad, raksha.vasisht, remy.suen | ||||||||||||
| Version: | 3.7 | ||||||||||||||
| Target Milestone: | 3.7 M2 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows 7 | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Bug Depends on: | |||||||||||||||
| Bug Blocks: | 325159 | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Markus Keller
Was OK in I20100912-2000. Since Ctrl+T is also affected, I assume it's a problem in JDT/Core (not confirmed yet). Problem seems to be in UI: Works fine with I20100912-2000 and jdt.core from HEAD. Broken with I20100914-0100 and jdt.core v_B11. Problem is in TypeHierarchyContentProvider. It works again when I revert to last version (and then fix the compile error). I'll fix this. Created attachment 178922 [details]
Fix1
This got broken with the patch on bug 21417 comment 18 (worked fine with previous patches). Raksha, can you please review the fix? (In reply to comment #5) > This got broken with the patch on bug 21417 comment 18 (worked fine with > previous patches). > > Raksha, can you please review the fix? The fix brings back the issue mentioned in bug 21417 comment 16 :( * Have 2 simple classes: package m; public class A { } package m; public class B extends Exception {} * I don't get the logic when I look at the hierarchy of A and B (compare this to the hierarchy of package m): - Why is 'Serializable' shown? I'm working on an additional fix in TraditionalHierarchyContentProvider#getRootTypes(List). The old assumption was that a hierarchy on a region was in fact a hierarchy on a single package. This is no longer true, so we have to find the right roots ourselves. My first patch restores operation for the normal case (hierarchy on 1 type or 1 package). This will go into M2, but I hope I can fix the issue for multi-element hierarchies as well. Created attachment 178945 [details] Patch for isInHierarchyOfInputElements(..) (In reply to comment #7) > I'm working on an additional fix in > TraditionalHierarchyContentProvider#getRootTypes(List). The old assumption was > that a hierarchy on a region was in fact a hierarchy on a single package. This > is no longer true, so we have to find the right roots ourselves. > > My first patch restores operation for the normal case (hierarchy on 1 type or 1 > package). This will go into M2, but I hope I can fix the issue for > multi-element hierarchies as well. I have a patch for org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyContentProvider.isInHierarchyOfInputElements(IType)which is required to check whether the given type really belongs to the hierarchy of atleast one of the input types. Earlier this method returned true if one of the input elements is a type which is wrong. The check operation might be expensive and works along with the fix in TraditionalHierarchyContentProvider#getRootTypes(List). The TH now shows sub types as well. Markus, could you pls try it out? Comment on attachment 178945 [details] Patch for isInHierarchyOfInputElements(..) This fix is too complicated and too risky for M2. We need a fix with minimal impact on the normal scenario (hierarchy on 1 type or 1 package). It also shows too many types (e.g. shows Serializable in hierarchy on m in comment 6). Could also have problems with logical packages because the name comparison is gone. Comment on attachment 178922 [details]
Fix1
Released Fix1 for I20100915-1300.
This fixes the normal case but shows too many types with mixed inputs (type + package/etc.).
D'oh! We were trying to fix something we can't reasonably fix. JDT/Core has support for 2 kinds of type hierarchies: A.) Type hierarchy on a single type. The result contains all super and subtypes of the focus type. B.) Type hierarchy on a region (collection of Java elements). The result contains all types in the region and necessary supertypes to complete the hierarchy, but does *not* contain any subtypes outside of the region. => We cannot create a "merged" hierarchy from (A)- and (B)-type hierarchies. I'll attach a patch that does not allow the user to create such hierarchies. Created attachment 178976 [details]
Fix2 (action enablement)
Raksha, can you please review?
Created attachment 178978 [details]
Fix3 (external archives)
TypeHierarchyLifeCycle contains obsolete code for ITypes in regions, and a bad check that prevents type hierarchies on external archives (e.g. the JUnit library). Patch removes that code.
Created attachment 178980 [details]
Fix4
Combines Fix2 and Fix3, and fixes action enablement (really).
Released Fix4 to HEAD. Thanks to Raksha for the review and for insisting on the action enablement problem (which was already in the initial multi-hierarchy fix). Verified in I20100915-2024 that TH and QH work again and that action enablement works. |