Project: Eclipse_Platform_UI
Bug 341327 [Commands] Handler conflict due to multiple instances of EditorActionBars for one editor id
Reported: 2011-03-30 05:20:14 | Status: verified fixed

I have an edtior with the id 'myEditID'. When this editor throws a PartInitException during EditorPart.init(...) an ErrorEditorPart with id 'myEditID' is created. For this error editor a new instance of EditorActionBars is used, which is not ref-counted. Nevertheless, when the ErrorEditorPart is closed, the editor manager unrefs the private instance of EditorActionBars and clears the entry for the id 'myEditID' from its cache. The entry cleared is an instance that is in use by an editor. When opening another editor with id 'myEditID', a new instance of EditorActionBars is created (because the cache has been cleared). The second instance of EditorActionBars for the same type of ediotr leads to a handler conflict because 'EditorActionBars.setGlobalHandler(..)' can no longer properly deactivate a previously registered handler.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java