Bug 330467 [Compatibility] Workbench window menu bar submenus keeps growing
Submenus like 'Search > Text' keeps growing in size.
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
MMenu menuModel;
		MMenuContribution menuContribution;
		ArrayList<MMenuElement> generatedElements = new ArrayList<MMenuElement>();
		MenuManager manager;
		public ContributionRecord(MMenu menuModel,
				MMenuContribution contribution, MenuManager manager) {
			this.menuModel = menuModel;
			this.menuContribution = contribution;
			this.manager = manager;
		}
		/**
		 * @param context
		 */
		public void updateVisibility(IEclipseContext context) {
			ExpressionContext exprContext = new ExpressionContext(context);
			boolean isVisible = ContributionsAnalyzer.isVisible(
					menuContribution, exprContext);
			for (MMenuElement item : generatedElements) {
				if (isVisible && item.getVisibleWhen() != null) {
					MenuManagerRenderer.updateVisibility(manager, item,
							exprContext);
				} else {
					item.setVisible(isVisible);