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

Bug 365459

Summary: IconProviderService registration should not require unique ranking
Product: z_Archived Reporter: Beat Schwarzentrub <bsh>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: andi.bur
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch by A. Bur none

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 ***