Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 293140

Summary: ImageRegistry is not unique per bundle
Product: [RT] RAP Reporter: Moritz Post <mpost>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: b.muskalla
Version: unspecified   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Returns an ImageRegistry per session per plug-in none

Description Moritz Post CLA 2009-10-23 06:18:08 EDT
When having multiple bundles which all use the image registry, the bundle which initializes the image registry first by calling AbstractUIBundle.getImageRegistry() gets to set a global registry for every bundle to request the registry later on. Thereby the every bundle gets the registry from the very first bundle to request it. Also the initImageRegistry method in the Activator of later bundles is not invoked since it is already created.

The implementation of this behavior is located in org.eclipse.ui.plugin.AbstractUIPlugin.getImageRegistry(). The session store would need to hold a separate image registry for each bundle.
Comment 1 Benjamin Muskalla CLA 2009-10-23 06:31:32 EDT
I think you're talking about different sessions, not different bundles?
Each bundle correctly gets it's own instance of the image registry but is only initialized once as bundles get only started once for the whole application.
This sounds like a DUP of 281852 for me, Moritz?
Comment 2 Moritz Post CLA 2009-10-23 09:26:11 EDT
From what i read in the code, an image registry is loaded on a per class basis. Maybe it is somehow related to individual sessions but it is not related to a specific bundle.

Also in practice: I have two bundles both use their image registry respectively. When bundle A has loaded its reg it gets the properly inserted values from its initRegistry method in the reg. Now the second bundle gets to request its reg for the first time and from the getImageRegistry call its receives the registry from bundle A in return.
Comment 3 Rüdiger Herrmann CLA 2009-10-28 12:38:20 EDT
Created attachment 150743 [details]
Returns an ImageRegistry per session per plug-in

Moritz, does that solve your problem?
Comment 4 Moritz Post CLA 2009-10-28 13:37:30 EDT
(In reply to comment #3)
> Created an attachment (id=150743) [details]
> Returns an ImageRegistry per session per plug-in
> 
> Moritz, does that solve your problem?

The first impression is good. i haven't had the time test it in practice. Is it also part of CVS HEAD?
Comment 5 Rüdiger Herrmann CLA 2009-10-29 06:23:44 EDT
(In reply to comment #4)
> [ ... ]
> The first impression is good. i haven't had the time test it in practice. Is it
> also part of CVS HEAD?
No, the changes aren't yet in CVS
Comment 6 Rüdiger Herrmann CLA 2009-10-29 13:05:01 EDT
Fixed in CVS HEAD