Project: Eclipse_Platform_UI
Bug 25785 [View Mgmt] NPE on shutdown in ConsoleTerminateActionDelegate
Reported: 2002-11-06 12:17:35 | Status: resolved fixed

I start Eclipse (Debug perspective is the active perspective) I shutdown Eclipse We should handle that the page is null for the action delegate. The strange thing is that it looks like a view is getting restored on shutdown? Thread [main] (Suspended (exception java.lang.NullPointerException)) org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate (org.eclipse.debug.internal.ui.actions.AbstractListenerActionDelegate).init (org.eclipse.ui.IViewPart) line: 152 org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate.ini t(org.eclipse.ui.IViewPart) line: 47 org.eclipse.ui.internal.ViewPluginAction.initDelegate(java.lang.Object) line: 38 org.eclipse.ui.internal.ViewPluginAction (org.eclipse.ui.internal.PluginAction).createDelegate() line: 86 org.eclipse.ui.internal.ViewPluginAction (org.eclipse.ui.internal.PluginAction).selectionChanged (org.eclipse.jface.viewers.ISelection) line: 231 org.eclipse.ui.internal.ViewPluginAction (org.eclipse.ui.internal.PartPluginAction).registerSelectionListener (org.eclipse.ui.IWorkbenchPart) line: 32 org.eclipse.ui.internal.ViewPluginAction.<init> (org.eclipse.core.runtime.IConfigurationElement, java.lang.String, org.eclipse.ui.IViewPart, java.lang.String) line: 26 org.eclipse.ui.internal.ActionDescriptor.createAction(int, org.eclipse.core.runtime.IConfigurationElement, java.lang.Object) line: 155 org.eclipse.ui.internal.ActionDescriptor.<init> (org.eclipse.core.runtime.IConfigurationElement, int, java.lang.Object) line: 117 org.eclipse.ui.internal.ViewerActionBuilder.createActionDescriptor (org.eclipse.core.runtime.IConfigurationElement) line: 30 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.PluginActionBuilder).readElement (org.eclipse.core.runtime.IConfigurationElement) line: 314 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.registry.RegistryReader).readElements (org.eclipse.core.runtime.IConfigurationElement[]) line: 119 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.registry.RegistryReader).readElementChildren (org.eclipse.core.runtime.IConfigurationElement) line: 109 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.PluginActionBuilder).readElement (org.eclipse.core.runtime.IConfigurationElement) line: 320 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.registry.RegistryReader).readElements (org.eclipse.core.runtime.IConfigurationElement[]) line: 119 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.registry.RegistryReader).readExtension (org.eclipse.core.runtime.IExtension) line: 128 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.registry.RegistryReader).readRegistry (org.eclipse.core.runtime.IPluginRegistry, java.lang.String, java.lang.String) line: 140 org.eclipse.ui.internal.ViewerActionBuilder (org.eclipse.ui.internal.PluginActionBuilder).readContributions (java.lang.String, java.lang.String, java.lang.String) line: 287 org.eclipse.ui.internal.ViewerActionBuilder.readViewerContributions (java.lang.String, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.IWorkbenchPart) line: 52 org.eclipse.ui.internal.PopupMenuExtender.readStaticActions() line: 76 org.eclipse.ui.internal.PopupMenuExtender.<init>(java.lang.String, org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.IWorkbenchPart) line: 39 org.eclipse.ui.internal.ViewSite (org.eclipse.ui.internal.PartSite).registerContextMenu(java.lang.String, org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider) line: 147 org.eclipse.ui.internal.ViewSite (org.eclipse.ui.internal.PartSite).registerContextMenu (org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider) line: 153 org.eclipse.debug.internal.ui.views.console.ConsoleView (org.eclipse.debug.ui.AbstractDebugView).createContextMenu (org.eclipse.swt.widgets.Control) line: 348 org.eclipse.debug.internal.ui.views.console.ConsoleView (org.eclipse.debug.ui.AbstractDebugView).createPartControl (org.eclipse.swt.widgets.Composite) line: 202 org.eclipse.ui.internal.PartPane$4.run() line: 135 org.eclipse.core.internal.runtime.InternalPlatform.run (org.eclipse.core.runtime.ISafeRunnable) line: 839 org.eclipse.core.runtime.Platform.run (org.eclipse.core.runtime.ISafeRunnable) line: 413 org.eclipse.ui.internal.ViewPane (org.eclipse.ui.internal.PartPane).createChildControl() line: 133 org.eclipse.ui.internal.ViewPane.createChildControl() line: 201 org.eclipse.ui.internal.ViewFactory$2.run() line: 148 org.eclipse.core.internal.runtime.InternalPlatform.run (org.eclipse.core.runtime.ISafeRunnable) line: 839 org.eclipse.core.runtime.Platform.run (org.eclipse.core.runtime.ISafeRunnable) line: 413 org.eclipse.ui.internal.ViewFactory.busyRestoreView (org.eclipse.ui.IViewReference) line: 92 org.eclipse.ui.internal.ViewFactory$1.run() line: 77 org.eclipse.swt.custom.BusyIndicator.showWhile (org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 65 org.eclipse.ui.internal.ViewFactory.restoreView (org.eclipse.ui.IViewReference) line: 73 org.eclipse.ui.internal.ViewFactory$ViewReference.getPart(boolean) line: 309 org.eclipse.ui.internal.WorkbenchPage$ActivationList.getActive(int) line: 2668 org.eclipse.ui.internal.WorkbenchPage$ActivationList.getActive() line: 2646 org.eclipse.ui.internal.WorkbenchPage.closeAllEditors(boolean) line: 673 org.eclipse.ui.internal.WorkbenchPage.dispose() line: 927 org.eclipse.ui.internal.WorkbenchWindow.closeAllPages() line: 443 org.eclipse.ui.internal.WorkbenchWindow.hardClose() line: 935 org.eclipse.ui.internal.WorkbenchWindow.busyClose() line: 359 org.eclipse.ui.internal.WorkbenchWindow.access$3 (org.eclipse.ui.internal.WorkbenchWindow) line: 348 org.eclipse.ui.internal.WorkbenchWindow$2.run() line: 404 org.eclipse.swt.custom.BusyIndicator.showWhile (org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 65 org.eclipse.ui.internal.WorkbenchWindow.close() line: 402 org.eclipse.jface.window.WindowManager.close() line: 102 org.eclipse.ui.internal.Workbench$2.run() line: 233 org.eclipse.core.internal.runtime.InternalPlatform.run (org.eclipse.core.runtime.ISafeRunnable) line: 839 org.eclipse.core.runtime.Platform.run (org.eclipse.core.runtime.ISafeRunnable) line: 413 org.eclipse.ui.internal.Workbench.busyClose(boolean) line: 230 org.eclipse.ui.internal.Workbench.access$5 (org.eclipse.ui.internal.Workbench, boolean) line: 206 org.eclipse.ui.internal.Workbench$4.run() line: 363 org.eclipse.swt.custom.BusyIndicator.showWhile (org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 65 org.eclipse.ui.internal.Workbench.close(java.lang.Object, boolean) line: 361 org.eclipse.ui.internal.Workbench.close(java.lang.Object) line: 353 org.eclipse.ui.internal.Workbench.close() line: 347 org.eclipse.ui.internal.QuitAction.run() line: 31 org.eclipse.ui.internal.QuitAction (org.eclipse.jface.action.Action).runWithEvent(org.eclipse.swt.widgets.Event) line: 769 org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (org.eclipse.swt.widgets.Event) line: 408 org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (org.eclipse.swt.widgets.Event) line: 362 org.eclipse.jface.action.ActionContributionItem.access$0 (org.eclipse.jface.action.ActionContributionItem, org.eclipse.swt.widgets.Event) line: 353 org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEve nt(org.eclipse.swt.widgets.Event) line: 48 org.eclipse.swt.widgets.EventTable.sendEvent (org.eclipse.swt.widgets.Event) line: 77 org.eclipse.swt.widgets.MenuItem (org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 825 org.eclipse.swt.widgets.Display.runDeferredEvents() line: 1692 org.eclipse.swt.widgets.Display.readAndDispatch() line: 1410 org.eclipse.ui.internal.Workbench.runEventLoop() line: 1419 org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1402 org.eclipse.core.internal.boot.InternalBootLoader.run(java.lang.String, java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable) line: 831 org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL, java.lang.String, java.lang.String[]) line: 432 EclipseRuntimeLauncher.main(java.lang.String[]) line: 24

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java