Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365459 - IconProviderService registration should not require unique ranking
Summary: IconProviderService registration should not require unique ranking
Status: CLOSED DUPLICATE of bug 375325
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-02 11:56 EST by Beat Schwarzentrub CLA
Modified: 2021-08-19 11:04 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch by A. Bur (1.45 KB, patch)
2011-12-02 11:56 EST, Beat Schwarzentrub CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beat Schwarzentrub CLA 2011-12-02 11:56:27 EST
Build Identifier: 

PROBLEM:

A client plugin that wishes to provide icons, has to register an implementation of IIconProviderService as a service. If two plugins register such a service with the same ranking, only one registration "survives". The other one is quietly neglected.

EVALUATION:

The class org.eclipse.scout.rt.client.ui.IconLocator uses a TreeSet to sort all registered services that implement IIconProviderService. The comparator uses the supplied ranking value to compare two services. Therefore, all but the last compared service with the same ranking are overwritten.

PROPOSED SOLUTION:

Use Collections.sort() to sort the list of services. (See attached patch by A. Bur)

Reproducible: Always
Comment 1 Beat Schwarzentrub CLA 2011-12-02 11:56:55 EST
Created attachment 207853 [details]
Proposed patch by A. Bur
Comment 2 Andi Bur CLA 2012-04-25 06:35:36 EDT

*** This bug has been marked as a duplicate of bug 375325 ***