Bug 45253 - [Viewers] Null argument in call hierarchy view
Summary: [Viewers] Null argument in call hierarchy view
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2003-10-21 02:27 EDT by Wassim Melhem CLA
Modified: 2009-08-30 02:05 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2003-10-21 02:27:59 EDT
Build: 3.0M4

The Call hierarchy view was open.
org.eclipse.pde.core and org.eclipse.pde.ui are checked out from CVS.  All 
other SDK plug-ins are imported as binary with source.

I selected the method ClasspathUtilCore.computePluginEntries(..) from the 
pde.core plug-in.  From the context menu > open call hierarchy.

I got the stack pasted below.  Actually, I was getting it pretty frequently.

Error Oct 21, 2003 02:17:31.632 null argument;
org.eclipse.jface.util.Assert$AssertionFailedException: null argument;
	at org.eclipse.jface.util.Assert.isNotNull(Assert.java:139)
	at org.eclipse.jface.util.Assert.isNotNull(Assert.java:116)
	at org.eclipse.jface.viewers.StructuredViewer.disassociate
(StructuredViewer.java:238)
	at org.eclipse.jface.viewers.TableViewer.internalRefresh
(TableViewer.java:475)
	at org.eclipse.jface.viewers.TableViewer.internalRefresh
(TableViewer.java:431)
	at org.eclipse.jface.viewers.StructuredViewer$7.run
(StructuredViewer.java:856)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection
(StructuredViewer.java:796)
	at org.eclipse.jface.viewers.StructuredViewer.refresh
(StructuredViewer.java:854)
	at org.eclipse.jface.viewers.StructuredViewer.refresh
(StructuredViewer.java:816)
	at org.eclipse.jface.viewers.TableViewer.inputChanged
(TableViewer.java:398)
	at org.eclipse.jface.viewers.ContentViewer.setInput
(ContentViewer.java:238)
	at org.eclipse.jface.viewers.StructuredViewer.setInput
(StructuredViewer.java:983)
	at org.eclipse.jdt.internal.ui.callhierarchy.LocationViewer.clearViewer
(LocationViewer.java:95)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.clearView
(CallHierarchyViewPart.java:926)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.updateView
(CallHierarchyViewPart.java:907)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.refresh
(CallHierarchyViewPart.java:577)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.setMethod
(CallHierarchyViewPart.java:199)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyUI.openInViewPart
(CallHierarchyUI.java:212)
	at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyUI.open
(CallHierarchyUI.java:199)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.OpenCallHierarchyAction.run
(OpenCallHierarchyAction.java:187)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.OpenCallHierarchyAction.run
(OpenCallHierarchyAction.java:126)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:196)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:172)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:541)
	at org.eclipse.jface.action.ActionContributionItem.access$4
(ActionContributionItem.java:494)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent
(ActionContributionItem.java:466)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2173)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1863)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2347)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:2330)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:858)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:299)
	at org.eclipse.core.launcher.Main.run(Main.java:765)
	at org.eclipse.core.launcher.Main.main(Main.java:599)
Comment 1 Dirk Baeumer CLA 2003-10-21 04:37:44 EDT
The NPE happens in JFace.
Comment 2 Nick Edgar CLA 2003-10-28 11:12:43 EST
Appears to be due to the input having null elements.

The following test program shows the same failure:

	public static void main(String[] args) {
		Display display = new Display ();
		Shell shell = new Shell(display);
		TableViewer viewer = new TableViewer(shell, SWT.H_SCROLL | 
SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
		viewer.setContentProvider(new ArrayContentProvider());
		viewer.setLabelProvider(new LabelProvider());
		viewer.setInput(new Object[3]);
		viewer.setInput(new Object[0]);
		shell.open();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}

I'm adding various null checks in the viewers implementation to catch these 
earlier.

The JDT team should look at how this can happen in the call hierarchy.

Comment 3 Dirk Baeumer CLA 2003-10-28 12:37:14 EST
Jesper, can you please have a look how this can happen in the call hierarchy 
view.
Comment 4 Dirk Baeumer CLA 2003-10-28 12:37:48 EST
Nick, can you please assign the PR to JDT/UI if you are done.
Comment 5 Nick Edgar CLA 2003-10-28 15:58:49 EST
Viewer changes released.  Moving to JDT UI.
Comment 6 Jesper Kamstrup Linnet CLA 2003-10-31 16:08:40 EST
N200310310010 / M4

I have not been able to reproduce the problem, neither with the latest nightly
build nor with M4. I'd really like other examples of problems of this kind if
possible.
Comment 7 Dirk Baeumer CLA 2003-11-21 09:26:03 EST
We were not able to reproduce the problem. Setting status to remind.
Comment 8 Wassim Melhem CLA 2003-11-21 09:28:48 EST
I have been having a pretty pleasant experience using this view recently.  So 
maybe it was just a transient problem.
Comment 9 Denis Roy CLA 2009-08-30 02:05:20 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.