Bug 318645 Duplicate menu contributions after editor switching
Build Identifier: Build id: I20100630-1856 Steps to reproduce: 1. Open a Java file 2. Make sure the 'Source' menu is okay 3. Open a text file 4. Switch back to the Java file 5. Open the 'Source' menu again: all contributions are duplicated Additional switching back and forth will add even more duplicates to the 'Source' menu. Reproducible: Always
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/modeling/MenuServiceFilter.java
}
		final Menu menu = (Menu) event.widget;
		Object obj = menu.getData(AbstractPartRenderer.OWNING_ME);
		if (obj == null && menu.getParentItem() != null) {
			obj = menu.getParentItem().getData(AbstractPartRenderer.OWNING_ME);
		}
		if (obj instanceof MRenderedMenu) {
			handlerRenderedMenu(event, menu, (MRenderedMenu) obj);
		} else if (obj instanceof MPopupMenu) {
			handleContextMenu(event, menu, (MPopupMenu) obj);
		} else if (obj instanceof MMenu) {
			handleMenu(event, menu, (MMenu) obj);
		}
	}
	private void handleMenu(final Event event, final Menu menu,
			final MMenu menuModel) {
		if ((menu.getStyle() & SWT.BAR) != 0) {
			
			return;
		}
		switch (event.type) {
		case SWT.Show:
			trace("handleMenu.Show", menu, menuModel);
			cleanUp(menu);
			showMenu(event, menu, menuModel);
			break;
		case SWT.Hide:
			trace("handleMenu.Hide", menu, menuModel);
			
			break;