Bug 101625 NPE when cancelling Call Hierachy search
In I20050624-0010. 1) Start a Call Hierarchy query that is likely to take a long time (for example, on SomeClass.toString()). 2) Try to cancel the search before it completes. The search is not cancelled, and the following is written to the error log: java.lang.NullPointerException at org.eclipse.ui.progress.DeferredTreeContentManager$1.isParent(DeferredTreeContentManager.java:225) at org.eclipse.ui.progress.DeferredTreeContentManager$1.belongsTo(DeferredTreeContentManager.java:206) at org.eclipse.core.internal.jobs.JobManager.select(JobManager.java:876) at org.eclipse.core.internal.jobs.JobManager.select(JobManager.java:898) at org.eclipse.core.internal.jobs.JobManager.select(JobManager.java:886) at org.eclipse.core.internal.jobs.JobManager.cancel(JobManager.java:229) at org.eclipse.ui.progress.DeferredTreeContentManager.cancel(DeferredTreeContentManager.java:365) at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyContentProvider.cancelJobs(CallHierarchyContentProvider.java:171) at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewer.cancelJobs(CallHierarchyViewer.java:129) at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.cancelJobs(CallHierarchyViewPart.java:922) at org.eclipse.jdt.internal.ui.callhierarchy.CancelSearchAction.run(CancelSearchAction.java:37) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/CallHierarchyViewPart.java
ISelection selection= super.getSelection();
			if (!selection.isEmpty()) {
				return CallHierarchyUI.convertSelection(selection);
			}
			return selection;
		}
	}
	
    private static final String DIALOGSTORE_VIEWORIENTATION = "CallHierarchyViewPart.orientation"; 
    private static final String DIALOGSTORE_CALL_MODE = "CallHierarchyViewPart.call_mode"; 
	/**
	 * The key to be used is <code>DIALOGSTORE_RATIO + fCurrentOrientation</code>.
	 */
	private static final String DIALOGSTORE_RATIO= "CallHierarchyViewPart.ratio"; 
	
    static final int VIEW_ORIENTATION_VERTICAL = 0;
    static final int VIEW_ORIENTATION_HORIZONTAL = 1;
    static final int VIEW_ORIENTATION_SINGLE = 2;
    static final int VIEW_ORIENTATION_AUTOMATIC = 3;
    static final int CALL_MODE_CALLERS = 0;
    static final int CALL_MODE_CALLEES = 1;
    static final String GROUP_SEARCH_SCOPE = "MENU_SEARCH_SCOPE"; 
	static final String ID_CALL_HIERARCHY = "org.eclipse.jdt.callhierarchy.view"; 
	private static final String GROUP_FOCUS = "group.focus"; 
    private static final int PAGE_EMPTY = 0;
    private static final int PAGE_VIEWER = 1;
    private Label fNoHierarchyShownLabel;
    private PageBook fPagebook;
    private IDialogSettings fDialogSettings;
    private int fCurrentOrientation;