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
WorkbenchSWTActivator.trace(Policy.MENUS, msg + ": " + menu + ": "
				+ menuModel, null);
	}
	private static Method aboutToShow;
	public static Method getAboutToShow() {
		if (aboutToShow == null) {
			try {
				aboutToShow = MenuManager.class
						.getDeclaredMethod("handleAboutToShow");
				aboutToShow.setAccessible(true);
			} catch (SecurityException e) {
				
				e.printStackTrace();
			} catch (NoSuchMethodException e) {
				
				e.printStackTrace();
			}
		}
		return aboutToShow;
	}
	@Inject
	private MApplication application;
	@Inject
	private IPresentationEngine renderer;
	@Inject
	EModelService modelService;
	private HashMap<Menu, Runnable> pendingCleanup = new HashMap<Menu, Runnable>();
	public void handleEvent(Event event) {
		if (!(event.widget instanceof Menu)) {
			return;