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

Bug 318765

Summary: [api] Consolidate getSortedVersions() method with getVersions() method family
Product: [WebTools] WTP Common Tools Reporter: Konstantin Komissarchik <konstantin>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: enhancement    
Priority: P3 Keywords: api
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Konstantin Komissarchik CLA 2010-07-02 17:39:16 EDT
IProjectFacet and IRuntimeComponent have the following methods:

getVersions() -> Set
getVersions( String filter ) -> Set
getSortedVersions( boolean direction ) -> List

The geSortedVersions method in particular isn't well integrated. Sorting would be better as a feature of the getVersions() method. The return type is problematic too. Better semantics would be conveyed by using SortedSet rather than a List in this situation.

A new enum (SortDirection) will be introduced with three items: NONE, ASCENDING and DESCENDING. A new variant of getVersions() method would be added with the following signature:

getVersions( String filter, SortDirection sortDirection ) -> Set

If sortDirection is not null and is not NONE, the returned set will be castable to SortedSet.

The existing getSortedVersions() method will be removed.
Comment 1 Konstantin Komissarchik CLA 2010-07-02 17:54:58 EDT
In the description, IRuntimeComponentType should be used instead of IRuntimeComponent.
Comment 2 Konstantin Komissarchik CLA 2010-07-02 18:30:11 EDT
Created attachment 173332 [details]
Patch
Comment 3 Konstantin Komissarchik CLA 2010-07-02 18:51:28 EDT
Patch released.