Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314959 - IObjectActionDelegate use is problemmatic across multiple workbenches
Summary: IObjectActionDelegate use is problemmatic across multiple workbenches
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.3   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: 1.3 RC3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-28 16:53 EDT by Austin Riddle CLA
Modified: 2010-06-01 04:05 EDT (History)
0 users

See Also:


Attachments
Proposed fix (3.76 KB, patch)
2010-05-31 09:17 EDT, Ralf Sternberg CLA
ruediger.herrmann: review+
Details | Diff
mylyn/context/zip (166.75 KB, application/octet-stream)
2010-05-31 09:17 EDT, Ralf Sternberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Riddle CLA 2010-05-28 16:53:11 EDT
In reference to:

http://www.eclipse.org/forums/index.php?t=msg&th=169015&start=0&

There is a bug in the handling of IObjectActionDelegate.

After testing in 1.2, it is clear that there used to be separate delegate instances per user.  In 1.3M7 there is a shared delegate for all users.

The implications of this are described in the thread above.
Comment 1 Austin Riddle CLA 2010-05-28 17:14:38 EDT
OK, I spoke too soon.  Repeated tests show that in both 1.2 and 1.3 there is a shared delegate, it is just that it is "possible" for the instance to be different because of the workbench logic behind it.  

This is still a very difficult issue for us to grapple with because we have so many object delegates in our code.
Comment 2 Ralf Sternberg CLA 2010-05-31 09:17:42 EDT
Created attachment 170520 [details]
Proposed fix

It seems that we have missed two singletons in the workbench: Turning the class ObjectActionContributorManager into a session singleton cures the problem, i.e. it results in separate IActionDelegate instances per user session.
Since Workbench#shutdown invokes dispose() on this singleton, I think it is clear that it is meant to have Workbench scope. The same is true for PropertyPageContributionManager.
Comment 3 Ralf Sternberg CLA 2010-05-31 09:17:47 EDT
Created attachment 170521 [details]
mylyn/context/zip
Comment 4 Ralf Sternberg CLA 2010-05-31 09:41:14 EDT
I'm convinced that the ObjectPluginAction instances (those are passed as parameter to the IObjectActionDelegate) should have session scope, as they contain state that is related to the workbench instance.
I'm not quite sure about the solution. Although it is simple and looks reasonable, it leads to reading the extension registry once for every application. Not sure if there is some better way to do it.

Please ignore the mylyn context, this slipped in here by accident.
Comment 5 Ralf Sternberg CLA 2010-06-01 04:05:05 EDT
Committed patch to CVS HEAD.