Project: Eclipse_Platform_UI
Bug 229473 [Contributions] ShowInMenu dispose is attempting to get a service after the workbench has disposed it
Reported: 2008-04-29 16:36:39 | Status: verified fixed

I20080429-0100 I got this by quitting Eclipse via the Eclipse->Quit menu item. It does not happen if you invoke the keybinding. java.lang.NullPointerException at org.eclipse.ui.internal.menus.MenuServiceFactory.create(MenuServiceFactory.java:46) at org.eclipse.ui.internal.services.WorkbenchServiceRegistry.getService(WorkbenchServiceRegistry.java:102) at org.eclipse.ui.internal.services.ServiceLocator.getService(ServiceLocator.java:171) at org.eclipse.ui.internal.WorkbenchWindow.getService(WorkbenchWindow.java:3877) at org.eclipse.ui.internal.ShowInMenu.dispose(ShowInMenu.java:353) at org.eclipse.jface.action.MenuManager.dispose(MenuManager.java:234) at org.eclipse.jface.action.MenuManager.dispose(MenuManager.java:234) at org.eclipse.jface.action.MenuManager.dispose(MenuManager.java:234) at org.eclipse.jface.window.ApplicationWindow.close(ApplicationWindow.java:308) at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1620) at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:716) at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:692) at org.eclipse.ui.internal.WorkbenchWindow$3.run(WorkbenchWindow.java:808) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:806) at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109) at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:913) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:910) at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:839) at org.eclipse.ui.internal.Workbench$23.run(Workbench.java:1083) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.Workbench.close(Workbench.java:1081) at org.eclipse.ui.internal.Workbench.close(Workbench.java:1053) at org.eclipse.ui.internal.Workbench$56.handleEvent(Workbench.java:2265) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3567) at org.eclipse.swt.widgets.Display.coreEventProc(Display.java:865) at org.eclipse.swt.internal.carbon.OS.MenuSelect(Native Method) at org.eclipse.swt.widgets.Display.mouseProc(Display.java:2877) at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2380) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2344) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2210) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:489) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

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