Community
Participate
Working Groups
When using "Open Type Hierarchy" (CTRL+T) on an interface decleration, the window *sometimes* fails to find some anonymous implementations of the interface. The problem usually reproduces like this: 1. Open an interface which is implemented by some standard classes and some anonymous implementations. 2. Select the interface decleration and and press CTRL+T. 3. Select an anonymous implementation - the file where the chosen implementation resides will open in a new editor. 4. Use "Back" (ALT+left) to go back to the interface decleration. 5. Use CTRL+T again on the interface deceleration - it will now list only the standard classes implementing it. If I close all the relevant editors and reopen the interface decleration it sometimes shows all the implementations, sometimes just the standard classes and sometimes it shows all the standard classes and some of the anonymous implementations (the behavior is consistent on the same interface but changes depending on which interface I use and what implements it).
Created attachment 142600 [details] Screenshot showing the problem In the screenshot you can see an editor showing the interface in question, at the bottom view there is a Java search for implementations of the same interface, and in the popup there is a "Type Hierarchy" of the interface. As can be clearly seen, Java Search found 6 implementations of the interface (the first two anonymous implementations and the first two standard classes are seen in the crop), but the "Type Hierarchy" popup only shows the non-anonymous classes.
Strange, I couldn't reproduce. Can you reproduce with a standalone example, or can you attach the source you use to reproduce? Is the Type Hierarchy view (F4) complete?
Created attachment 142751 [details] An standalone eclipse project that reproduces the problem I can see the same issue also in the standard Type Hierarchy view, and this is how to reproduce using the attached project: 1. open "RelatedContentDataSource" 2. position the corsor on the "RelatedContentDataSource" decleration and hit F4 3. Hierarchy view opens with 3 implementations of the interface. 4. Select and double click one of the anonymous implementations. 5. Use "Back" (ALT-Left) to go back to "RelatedContentDataSource". 6. position the corsor on the "RelatedContentDataSource" decleration and hit again F4 The Hierarchy view should now update to show only the standard class that implements this interface.
BTW - I tried to create a new Java project and build a very minimal case that matches my original description, but it wouldn't reproduce the issue. So the attchment includes a project built from the original source classes that produced the problem for me (severly sanitized of course), with some of their dependancies. I checked the the project compiles, though I don't expect anything to work. This project is built for Java 1.6
!ENTRY org.eclipse.ui 4 4 2009-07-30 13:08:38.794 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.setFocusType(HierarchyResolver.java:832) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.reportHierarchy(HierarchyResolver.java:496) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:794) at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:587) at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:115) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:135) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:300) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1255) at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788) at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:726) at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:678) at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:139) at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:91) at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getMethodOverrideTester(SuperTypeHierarchyCache.java:100) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:171) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:136) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:272) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
*** This bug has been marked as a duplicate of bug 254738 ***