Bug 186344 [CommonNavigator] Project Explorer duplicates Working Set actions
M7 The Project Explorer sometimes creates duplicate Working Set related view menu items. This seems to be triggered by "Link with Editor" on startup where two instances of WorkingSetActionProvider are created and initialized. The following is a stack trace at the point where the WorkingSetActionProvider adds its actions. Note the recursion starting in NavigatorActionService.getActionProviderInstance() Thread [main] (Suspended (breakpoint at line 277 in WorkingSetActionProvider)) owns: HashMap<K,V> (id=142) owns: RunnableLock (id=143) WorkingSetActionProvider.fillActionBars(IActionBars) line: 277 NavigatorActionService.initialize(String, CommonActionProvider) line: 353 NavigatorActionService.getActionProviderInstance(CommonActionProviderDescriptor) line: 332 NavigatorActionService.fillActionBars(IActionBars) line: 236 CommonNavigatorManager.selectionChanged(SelectionChangedEvent) line: 217 Viewer$2.run() line: 162 SafeRunner.run(ISafeRunnable) line: 37 Platform.run(ISafeRunnable) line: 850 JFaceUtil$1.run(ISafeRunnable) line: 46 SafeRunnable.run(ISafeRunnable) line: 193 CommonViewer(Viewer).fireSelectionChanged(SelectionChangedEvent) line: 160 CommonViewer(StructuredViewer).updateSelection(ISelection) line: 2039 CommonViewer(StructuredViewer).handleInvalidSelection(ISelection, ISelection) line: 1102 CommonViewer(StructuredViewer).preservingSelection(Runnable, boolean) line: 1376 CommonViewer(TreeViewer).preservingSelection(Runnable, boolean) line: 377 CommonViewer(StructuredViewer).preservingSelection(Runnable) line: 1325 CommonViewer(AbstractTreeViewer).inputChanged(Object, Object) line: 1417 CommonViewer(ContentViewer).setInput(Object) line: 251 CommonViewer(StructuredViewer).setInput(Object) line: 1601 WorkingSetActionProvider.restoreState(IMemento) line: 237 NavigatorActionService.initialize(String, CommonActionProvider) line: 350 NavigatorActionService.getActionProviderInstance(CommonActionProviderDescriptor) line: 332 NavigatorActionService.fillActionBars(IActionBars) line: 236 CommonNavigatorManager.selectionChanged(SelectionChangedEvent) line: 217 Viewer$2.run() line: 162 SafeRunner.run(ISafeRunnable) line: 37 Platform.run(ISafeRunnable) line: 850 JFaceUtil$1.run(ISafeRunnable) line: 46 SafeRunnable.run(ISafeRunnable) line: 193 CommonViewer(Viewer).fireSelectionChanged(SelectionChangedEvent) line: 160 CommonViewer(StructuredViewer).updateSelection(ISelection) line: 2039 CommonViewer(StructuredViewer).setSelection(ISelection, boolean) line: 1636 CommonViewer(TreeViewer).setSelection(ISelection, boolean) line: 1031 CommonViewer.setSelection(ISelection, boolean) line: 325 CommonNavigator.selectReveal(ISelection) line: 313 LinkEditorAction$2.runInUIThread(IProgressMonitor) line: 91 UIJob$1.run() line: 94 [...]
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/NavigatorActionService.java
private IMemento memento;
	private IContributionItem[] menuGroups;
	private boolean disposed = false;
	/**
	 * @param aCommonViewerSite
	 *            A site that provides information about the context for extensions.
	 * @param aStructuredViewer
	 *            The associated StructuredViewer. Used to initialize extensions. <b>May NOT be
	 *            null.</b>
	 * @param aContentService
	 *            The associated INavigatorContentService (for extensions that coordinate behavior
	 *            with content extensions -- either nested or top-level action providers). <b>May
	 *            NOT be null.</b>
	 */
	public NavigatorActionService(ICommonViewerSite aCommonViewerSite, StructuredViewer aStructuredViewer, INavigatorContentService aContentService) {
		super();
		Assert.isNotNull(aCommonViewerSite);
		Assert.isNotNull(aStructuredViewer);
		Assert.isNotNull(aContentService);
		commonViewerSite = aCommonViewerSite;
		contentService = (NavigatorContentService) aContentService;
		structuredViewer = aStructuredViewer;
		viewerDescriptor = contentService.getViewerDescriptor();
	}
	/**
	 * Prepares the menu for object contributions, if the option is set in the extension. The option
	 * is controlled by the &lgt;popupMenu /&gt; element's 'allowPlatformContributions' attribute.
	 * Clients may choose to ignore this setting by supplying a value of <b>true</b> for the
	 * <code>force</code> attribute.
	 *