Community
Participate
Working Groups
Created attachment 224320 [details] MenuManagerRenderer patch v1 We have a view with two context menu registrations with the same tree viewer but different selection providers (don't ask me why). On the second notification to the MenuManager's listeners (it has 2, both from PopupMenuExtender), the exception below gets thrown. I have attached a patch that fixes the problem though it's not clear to me if this is the right fix. I did not alter the code that affects menu manager because that doesn't cause problems on our end. If this is the right fix, perhaps the same fix should be applied for the code that affects menu managers? org.eclipse.emf.common.util.AbstractEList$BasicIndexOutOfBoundsException: index=26, size=22 at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:332) at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.reconcileManagerToModel(MenuManagerRenderer.java:894) at org.eclipse.ui.internal.PopupMenuExtender.addMenuContributions(PopupMenuExtender.java:405) at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:379) at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:343) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:475) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:470) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:500) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4881) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4557) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1627) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2069) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:257) at org.eclipse.swt.widgets.Display.runPopups(Display.java:4210) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1021)
Created attachment 224330 [details] Test project that reproduces the problem. The attached project will reproduce the problem. However, it may be contrived in the sense that we're adding two contribution items to the menu manager where equals(Object) returns true. Changing the maps in MenuManagerRenderer to be implementations of IdentityHashMap appears to be an alternate fix to the problem (besides what's been suggested in attachment 224320 [details]).
This looks like the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=383734.
*** Bug 383734 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > The attached project will reproduce the problem. However, it may be > contrived in the sense that we're adding two contribution items to the menu > manager where equals(Object) returns true. Changing the maps in > MenuManagerRenderer to be implementations of IdentityHashMap appears to be > an alternate fix to the problem (besides what's been suggested in attachment > 224320 [details]). Is it the maps with MenuManager and and IContributionItem as keys that need to be IdentityHashMaps? PW
(In reply to comment #4) > (In reply to comment #1) > > Changing the maps in > > MenuManagerRenderer to be implementations of IdentityHashMap appears to be > > an alternate fix to the problem (besides what's been suggested in attachment > > 224320 [details]). > > Is it the maps with MenuManager and and IContributionItem as keys that need > to be IdentityHashMaps? Don't quite remember the details I'm afraid.
Patch with change: https://git.eclipse.org/r/#/c/11812/
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3d996ff0b4a10627420bca71805ad2b5c9195e78
Can this fix be backported for IES 422 ?
Verified in the build I20130428-2000
I have confirmed that the problem is gone on my end on 4.3M7. Thanks, Daniel and Paul!
Another part of the fix we'll need to put in 4.3.1 http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=65406fd6c95cbd322b265ccc0ce761aa8bd4caeb PW
(In reply to comment #11) > Another part of the fix we'll need to put in 4.3.1 > > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?h=R4_2_maintenance&id=65406fd6c95cbd322b265ccc0ce761aa8bd4caeb > > PW Paul, Can I close this bug or we have to verify it once again? If so, do you have any test scenario that can be used to check the last commit? thanks, Daniel
The 2 commits have to be backported to 4.3.1 PW
Hello Is there a work around for this? We are seeing this issue , which was working fine in earlier versions of eclipse. After upgrading to 4.3. I see the following exception when a popup menu is displayed. Is there a fix which can be downloaded for this to work, or when is the target date for the proposed fix. Thanks Ani org.eclipse.emf.common.util.AbstractEList$BasicIndexOutOfBoundsException: index=2, size=1 at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:332) at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.reconcileManagerToModel(MenuManagerRenderer.java:859) at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.reconcileManagerToModel(MenuManagerRenderer.java:860) at org.eclipse.ui.internal.PopupMenuExtender.addMenuContributions(PopupMenuExtender.java:414) at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:388) at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:343) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:475) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:470) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:500) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4964) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4640) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1627) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:257) at org.eclipse.swt.widgets.Display.runPopups(Display.java:4211) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3753) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) c
(In reply to comment #14) > Hello > Is there a work around for this? We are seeing this issue , which was > working fine in earlier versions of eclipse. After upgrading to 4.3. I see > the following exception when a popup menu is displayed. Is there a fix which > can be downloaded for this to work, or when is the target date for the > proposed fix. > > > > Thanks > Ani > Are you able to attach some simple test project where we can recreate the issue? Daniel
(In reply to comment #14) > Hello > Is there a work around for this? The only workaround is not to register a contained MenuManager after registering the parent MenuManager. It's fixed in 4.4 and will be backported to 4.3.1 PW
Paul, could you review this for 4.3.1? https://git.eclipse.org/r/#/c/15009/ PW
Release on 4.3 with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_3_maintenance&id=153ac7896e509ead240662d15e0576634723c497
(In reply to comment #16) Hi Paul In this case, I have registered my own ContextMenuProvider class say 'myContextMenuProvider', which extends the org.eclipse.gef.ContextMenuProvider . This is registered in the configureGraphicalViewer() method using code as getGraphicalViewer().setContextMenu(myContextMenuProvider) ((IEditorSite) getSite()).registerContextMenu( "myContextMenuId", myContextMenuProvider, getGraphicalViewer(), false); I am not able to follow, which of these places would i do the workaround , and how? Would the backport for 4.3.1 be publicly available anytime soon Thanks for all your help AS > (In reply to comment #14) > > Hello > > Is there a work around for this? > > The only workaround is not to register a contained MenuManager after > registering the parent MenuManager. > > It's fixed in 4.4 and will be backported to 4.3.1 > > PW
(In reply to comment #19) > > I am not able to follow, which of these places would i do the workaround , > and how? I'm not familiar with GEF, so I can't tell you where it's double-registering. > Would the backport for 4.3.1 be publicly available anytime soon Kepler SR1 will be available beginning of October. But the fix will be in the next Maintenance (M) build on http://download.eclipse.org/eclipse/downloads/ sometime next Wednesday afternoon. PW
(In reply to comment #20) > (In reply to comment #19) > > > > I am not able to follow, which of these places would i do the workaround , > > and how? > > I'm not familiar with GEF, so I can't tell you where it's double-registering. > > > Would the backport for 4.3.1 be publicly available anytime soon > > Kepler SR1 will be available beginning of October. But the fix will be in > the next Maintenance (M) build on > http://download.eclipse.org/eclipse/downloads/ sometime next Wednesday > afternoon. > > PW Will there be a juno 4.2.3? Since Rational tools have moved to Juno 4.2.2 this can cause some headaches for implementers.
(In reply to comment #21) > (In reply to comment #20) > > (In reply to comment #19) > > > > > > I am not able to follow, which of these places would i do the workaround , > > > and how? > > > > I'm not familiar with GEF, so I can't tell you where it's double-registering. > > > > > Would the backport for 4.3.1 be publicly available anytime soon > > > > Kepler SR1 will be available beginning of October. But the fix will be in > > the next Maintenance (M) build on > > http://download.eclipse.org/eclipse/downloads/ sometime next Wednesday > > afternoon. > > > > PW > > Will there be a juno 4.2.3? Since Rational tools have moved to Juno 4.2.2 > this can cause some headaches for implementers. No there won't be a SR3. Rational can provide a fix(pack) if they desire to do so.
Verified in the build: M20130828-0800