Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 284672 - [navigation] Quick Type Hierarchy window fails to find some anonymous implementations
Summary: [navigation] Quick Type Hierarchy window fails to find some anonymous impleme...
Status: RESOLVED DUPLICATE of bug 254738
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-26 09:01 EDT by Oded Arbel CLA
Modified: 2009-07-30 07:10 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot showing the problem (105.58 KB, image/png)
2009-07-26 09:04 EDT, Oded Arbel CLA
no flags Details
An standalone eclipse project that reproduces the problem (26.61 KB, application/octet-stream)
2009-07-28 06:23 EDT, Oded Arbel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel CLA 2009-07-26 09:01:06 EDT
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).
Comment 1 Oded Arbel CLA 2009-07-26 09:04:40 EDT
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.
Comment 2 Markus Keller CLA 2009-07-27 11:05:30 EDT
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?
Comment 3 Oded Arbel CLA 2009-07-28 06:23:01 EDT
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.
Comment 4 Oded Arbel CLA 2009-07-28 06:25:49 EDT
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
Comment 5 Dani Megert CLA 2009-07-30 07:09:43 EDT
!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)
Comment 6 Dani Megert CLA 2009-07-30 07:10:01 EDT

*** This bug has been marked as a duplicate of bug 254738 ***