Project: SWT
Bug 106006 [Contributions] NullPointerExceptions in MenuManager.update
Reported: 2005-08-03 21:06:42 | Status: resolved fixed

Today, with no apparent cause, my Eclipse (with MyEclipse, but as will be described later, I've eliminated MyEclipse as a cause) started displaying dialogs that "an error has occurred" when performing various operations (opening files, closing files, committing to CVS). Checking the logs revealed that NPEs were occurring in MenuManager.update, essentially whenever I clicked on anything. Initially I thought perhaps something in my workspace was corrupted, so I quit Eclipse and created a new workspace... same problem. Then I freshly unpacked a new Eclipse 3.1 and did not install MyEclipse in it, and let it create another new workspace on startup... same problem. I also tried to switch the default VM on my Mac OS X 10.4.2 system back to 1.4 (I use 1.5 normally)... same problem. So I'm reporting it in the hope that somebody can either figure out what in my configuration that I didn't manage to delete is causing the problem, or figure out what in Eclipse is causing the problem. System information, in case it'll be useful: PowerBook G4, 15", 1.5GHz, 1.5GB memory. It was 1.25GB memory until today, but Eclipse was working fine for a while even with the new memory, and it doesn't seem to me that that would be likely to cause this sort of issue anyway. Log produced by Eclipse: !SESSION 2005-08-03 17:22:08.956 ----------------------------------------------- eclipse.buildId=I20050627-1435 java.version=1.5.0_02 java.vendor=Apple Computer, Inc. BootLoader constants: OS=macosx, ARCH=ppc, WS=carbon, NL=en_US Framework arguments: -keyring /Volumes/Anlashok/Users/dmz/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws carbon -arch ppc -keyring /Volumes/Anlashok/Users/ dmz/.eclipse_keyring -consoleLog -showlocation !ENTRY org.eclipse.ui 4 4 2005-08-03 17:22:51.918 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-08-03 17:22:51.921 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jface.action.MenuManager.update(MenuManager.java:591) at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:721) at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars(WorkbenchWindow.java:2485) at org.eclipse.ui.internal.WorkbenchWindow.updateActionSets(WorkbenchWindow.java:2555) at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActionSets(WorkbenchPage.java: 485) at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActivePart(WorkbenchPage.java: 335) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:2857) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:552) at org.eclipse.ui.internal.WorkbenchPage.makeActive(WorkbenchPage.java:1090) at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1070) at org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage.java:2012) at org.eclipse.ui.internal.ViewPane.doHide(ViewPane.java:196) at org.eclipse.ui.internal.PartStack.close(PartStack.java:495) at org.eclipse.ui.internal.PartStack.close(PartStack.java:478) at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:102) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent (TabbedStackPresentation.java:81) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java: 267) at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java: 276) at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1 (DefaultTabFolder.java:1) at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder $1.closeButtonPressed(DefaultTabFolder.java:67) at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:563) at org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:190) at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2075) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:292) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1380) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1404) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1389) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1237) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3060) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2712) 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) !ENTRY org.eclipse.ui 4 4 2005-08-03 17:23:01.562 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-08-03 17:23:01.564 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jface.action.MenuManager.update(MenuManager.java:591) at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:721) at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars(WorkbenchWindow.java:2485) at org.eclipse.ui.internal.WorkbenchPage.updateActionBars(WorkbenchPage.java:3301) at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActivePart(WorkbenchPage.java: 336) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:2857) at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:2471) at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:249) at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:214) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1380) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1404) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1385) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1214) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:1999) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:637) at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations.java:376) at org.eclipse.swt.widgets.Shell.kEventWindowActivated(Shell.java:857) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1880) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3716) at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2677) 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) !ENTRY org.eclipse.ui.workbench 4 2 2005-08-03 17:23:03.931 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.NullPointerException at org.eclipse.swt.widgets.Menu.releaseWidget(Menu.java:884) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.swt.widgets.Decorations.releaseWidget(Decorations.java:345) at org.eclipse.swt.widgets.Shell.releaseWidget(Shell.java:1117) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.jface.window.Window.close(Window.java:321) at org.eclipse.jface.window.ApplicationWindow.close(ApplicationWindow.java:291) at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1403) at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:646) at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:627) at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindow.java:728) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:726) at org.eclipse.jface.window.WindowManager.close(WindowManager.java:108) at org.eclipse.ui.internal.Workbench$11.run(Workbench.java:588) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:585) at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:522) at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:713) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.Workbench.close(Workbench.java:711) at org.eclipse.ui.internal.Workbench.close(Workbench.java:686) at org.eclipse.ui.internal.Workbench$21.handleEvent(Workbench.java:1621) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3212) at org.eclipse.swt.widgets.Display.close(Display.java:817) at org.eclipse.swt.widgets.Display.commandProc(Display.java:701) at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2682) 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) !ENTRY org.eclipse.ui 4 4 2005-08-03 17:23:06.504 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-08-03 17:23:06.666 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.swt.widgets.Menu.releaseWidget(Menu.java:884) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.swt.widgets.Decorations.releaseWidget(Decorations.java:357) at org.eclipse.swt.widgets.Shell.releaseWidget(Shell.java:1117) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.swt.widgets.Display.release(Display.java:2760) at org.eclipse.swt.graphics.Device.dispose(Device.java:202) at org.eclipse.swt.widgets.Display.close(Display.java:818) at org.eclipse.swt.widgets.Display.commandProc(Display.java:701) at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2682) 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) !ENTRY org.eclipse.osgi 2005-08-03 17:23:06.677 !MESSAGE Application error !STACK 1 java.lang.NullPointerException at org.eclipse.swt.widgets.Menu.releaseWidget(Menu.java:884) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.swt.widgets.Decorations.releaseWidget(Decorations.java:357) at org.eclipse.swt.widgets.Shell.releaseWidget(Shell.java:1117) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:604) at org.eclipse.swt.widgets.Display.release(Display.java:2760) at org.eclipse.swt.graphics.Device.dispose(Device.java:202) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:118) 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) !ENTRY org.eclipse.core.runtime 2 2 2005-08-03 17:23:07.616 !MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.ui.internal.progress.ProgressViewUpdater$1

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java