Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341327 - [Commands] Handler conflict due to multiple instances of EditorActionBars for one editor id
Summary: [Commands] Handler conflict due to multiple instances of EditorActionBars for...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 05:20 EDT by Markus Schorn CLA
Modified: 2011-04-26 13:41 EDT (History)
2 users (show)

See Also:


Attachments
Fix (1.94 KB, patch)
2011-03-30 05:37 EDT, Markus Schorn CLA
pwebster: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schorn CLA 2011-03-30 05:20:14 EDT
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.
Comment 1 Markus Schorn CLA 2011-03-30 05:37:05 EDT
Created attachment 192169 [details]
Fix

To fix the issue, the editor manager simply needs to make sure not to remove an EditorActionBars object from the cache that has a positive ref-count.
Comment 2 Paul Webster CLA 2011-04-01 10:34:39 EDT
Released with minor changes.  Thanx Markus!

PW
Comment 3 Dani Megert CLA 2011-04-06 08:03:24 EDT
Good catch!
Comment 4 Paul Webster CLA 2011-04-26 13:41:37 EDT
In I20110425-1800
PW