Project: SWT
Bug 235847 [Contributions] [Mac] Odd behaviour in help menu on OS X
Reported: 2008-06-05 11:15:00 | Status: resolved fixed

I20080604-2000 I'm not even sure how to classify this bug. There are numerous bad things all happening at once. Steps to reproduce: 1) open the team synch view in change set mode (and have some change sets) 2) select one of the top level change sets 3) open the help menu Note that the menu is empty and not only that the content of the team view disappears! If you dismiss the menu the content returns. Opening the log you find the following stack: java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at org.eclipse.ui.internal.actions.ModifyWorkingSetDelegate.getItems(ModifyWorkingSetDelegate.java:260) at org.eclipse.ui.internal.actions.ModifyWorkingSetDelegate.fillMenu(ModifyWorkingSetDelegate.java:196) at org.eclipse.ui.internal.actions.AbstractWorkingSetPulldownDelegate$1.menuShown(AbstractWorkingSetPulldownDelegate.java:98) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:235) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1566) at org.eclipse.swt.widgets.Menu.kEventMenuOpening(Menu.java:803) at org.eclipse.swt.widgets.Widget.menuProc(Widget.java:1317) at org.eclipse.swt.widgets.Display.menuProc(Display.java:2861) at org.eclipse.swt.internal.carbon.OS.MenuSelect(Native Method) at org.eclipse.swt.widgets.Display.mouseProc(Display.java:2891) at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3047) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2387) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2203) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) 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:382) 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) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) Problem 1: The working set delegate handler assumes (because of it's enablement clause) that if it is filling a menu it is doing it because the selections are adaptable. In this case, the selection is NOT adaptable (for unknown reasons) so the code fails. Problem 2: A bad delegate can destroy the menu. Problem 3: For some reason menushown is being invoked by SWT on a menu that ISN'T being shown. This is what puts us in the position where #1 is possible. Problem 4: The view content disappears. I dont even know where to start with this one...

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