Bug 80487 - [hierarchy] Call hierarchy not producing correct results
Summary: [hierarchy] Call hierarchy not producing correct results
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-08 12:11 EST by Khaled Agrama CLA
Modified: 2005-01-05 06:56 EST (History)
2 users (show)

See Also:


Attachments
demonstrates bug (234 bytes, text/plain)
2004-12-14 04:52 EST, Neil Swingler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khaled Agrama CLA 2004-12-08 12:11:28 EST
build I20041207-0800:
Lately while working on my Java project I've been running into several instances
where invoking call heirarchy (ctrl+alt+h).  There are particular methods in my
project that always produce incorrect results, but I haven't managed to create a
simple reproducible test case yet.  However, I did notice that after opening one
problematic file I got the following exception in the error log:

java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromConstantPoolName(LookupEnvironment.java:627)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:353)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:463)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:269)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:332)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:315)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:146)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:99)
	at
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:43)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveUnresolvedType(BinaryTypeBinding.java:92)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superclass(BinaryTypeBinding.java:769)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:973)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:983)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:935)
	at
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:42)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1067)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:725)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:862)
	at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:243)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:249)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:688)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:521)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:119)
	at
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:137)
	at
org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:319)
	at
org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1243)
	at
org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:739)
	at
org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:652)
	at
org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:604)
	at
org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:88)
	at
org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:78)
	at
org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:160)
	at
org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:128)
	at
org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:239)
	at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:145)
	at
org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:65)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at
org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:259)
	at
org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:244)
	at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:303)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

BTW, I also have encountered this behavior with the previous integration build:
I20041201.
Comment 1 Khaled Agrama CLA 2004-12-08 12:15:48 EST
First sentence should end with "produces incorrect results." :-).  BTW The
methods in question actually produce no results, yet there are definitely usages
of the methods.  I know this because if I change the name of one of the methods
and save, a bunch of probems show up referring to usages of the method that
cannot be resolved.
Comment 2 Jerome Lanneluc CLA 2004-12-09 07:36:46 EST
A reproducible test case would be most welcome.
Comment 3 Neil Swingler CLA 2004-12-10 06:05:18 EST
Ditto.

I'm using I200412081200

Call heirarchy never seems to find usages outside my current class any more.
Search for references works just fine though.
Comment 4 Philipe Mulet CLA 2004-12-10 07:34:45 EST
Please provide steps to reproduce, and then reopen.
Comment 5 Neil Swingler CLA 2004-12-14 04:52:13 EST
Created attachment 16577 [details]
demonstrates bug

Call heirarhcy of Server.server is empty
Search references correctly finds the call in Client.client
Comment 6 Neil Swingler CLA 2004-12-20 07:18:30 EST
Problem still exists in M4
Comment 7 Philipe Mulet CLA 2004-12-20 09:13:28 EST
reopening
Comment 8 Neil Swingler CLA 2004-12-20 09:36:40 EST
Hmm. I created a new workspace and the problem has gone away.
Comment 9 Philipe Mulet CLA 2005-01-04 05:36:57 EST
Cannot reproduce in latest given the indicated steps. Please reopen if you
manage to reproduce.
Comment 10 Markus Keller CLA 2005-01-05 04:30:19 EST
Neil, did you check that the Call Hierarchy's settings are correct? I.e.
- 'Show Caller Hierarchy' is active
- Search Scope is set to Workspace (Context menu, or view toolbar menu (Ctrl+F10))
Comment 11 Neil Swingler CLA 2005-01-05 06:56:20 EST
I didn't think to check search scope - and it's too late now. The sypmtoms I had
are consistent with having the search scope set to heirarchy. I don't remember
every changing this setting though.

Seems to be hitting a few people though. There was a newsgroup post yesterday.