Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364920

Summary: [Call Hierarchy] NPE using Show Callees on function referencing global variable
Product: [Tools] CDT Reporter: Marc-André Laperle <malaperle>
Component: cdt-source-navAssignee: Markus Schorn <mschorn.eclipse>
Status: VERIFIED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0.2   
Target Milestone: 8.0.2   
Hardware: All   
OS: All   
Whiteboard:

Description Marc-André Laperle CLA 2011-11-27 15:37:39 EST
Tested on CDT 8.0.1 and master (8.1.0.20111117)

int a;
void main() { // Open Call Hierarchy here, show callees
    a;
}

java.lang.NullPointerException
	at org.eclipse.cdt.internal.ui.callhierarchy.CallHierarchyUI.isRelevantForCallHierarchy(CallHierarchyUI.java:300)
	at org.eclipse.cdt.internal.ui.callhierarchy.CHQueries.findCalls(CHQueries.java:132)
	at org.eclipse.cdt.internal.ui.callhierarchy.CHContentProvider.asyncronouslyComputeRefersTo(CHContentProvider.java:172)
	at org.eclipse.cdt.internal.ui.callhierarchy.CHContentProvider.asyncronouslyComputeChildren(CHContentProvider.java:104)
	at org.eclipse.cdt.internal.ui.viewsupport.AsyncTreeContentProvider.runJob(AsyncTreeContentProvider.java:223)
	at org.eclipse.cdt.internal.ui.viewsupport.AsyncTreeContentProvider.access$0(AsyncTreeContentProvider.java:218)
	at org.eclipse.cdt.internal.ui.viewsupport.AsyncTreeContentProvider$1.run(AsyncTreeContentProvider.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Markus Schorn CLA 2011-12-21 09:21:29 EST
Fixed in cdt_8_0 and master branch.
Comment 2 CDT Genie CLA 2011-12-21 09:23:03 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 364920: NPE using call hierarchy

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=9e7125fb908b7b9d2e0079e3bf871c0ce7daff34
Comment 3 CDT Genie CLA 2011-12-21 10:23:02 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 364920: NPE using call hierarchy

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=77e2eefe30685d0988bdffeac617e7d0d8560bd0
Comment 4 Marc-André Laperle CLA 2012-01-21 23:08:36 EST
Actually, this bug was not present in 8.0.1 but it was in the cdt_8_0 branch with
645d8be5c61150069897447aafdf1a611e9c4e9a 2011-09-28
Bug 350345: Resolving explicit type conversions

Verified in 8.0.2 RC1.