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

Bug 41448

Summary: launch shortcuts should be sorted
Product: [Eclipse Project] Platform Reporter: Wassim Melhem <wassim.melhem>
Component: DebugAssignee: Darin Swanson <Darin_Swanson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jared_burns
Version: 3.0   
Target Milestone: 3.0 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Wassim Melhem CLA 2003-08-12 15:44:58 EDT
The extensions contributing to the org.eclipse.debug.ui.launchShortcuts show 
up in the Run>Run As cascading menu in what seems to be the order they were 
retrieved from the registry.  They should instead be listed in alphabetical 
order.
Comment 1 Jared Burns CLA 2003-08-12 19:03:15 EDT
In the SDK, the config types show up in alphabetical order. Is this just a 
coincidence? I've looked at the code in LaunchAsAction and the *comment* says 
"// Sort the applicable config types alphabetically and add them to the menu", 
but I don't see where the code's supposed to be doing this.
Comment 2 Wassim Melhem CLA 2003-08-12 20:07:29 EDT
It confused me at a first glance, but they are not really sorted.  Java Applet 
should be listed before Java Application, but Java Application is actually 
first in the list.
The problem became more obvious when I added two new JUnit shortcuts, and the 
list got pretty visibly disordered.
Comment 3 Jared Burns CLA 2003-08-13 14:12:48 EDT
Looks like whoever wrote the method just forgot to add the sorting code. :-/
Comment 4 Jared Burns CLA 2003-08-13 14:47:51 EDT
Turns out I was just fooled by the comment, which is obsolete. The sorting was 
apparently moved into the launch manager, but the comment wasn't removed from 
where it used to be done in the UI.

I refactored the LaunchManager to sort the configs alphabetically when they're 
loaded.
Comment 5 Jared Burns CLA 2003-08-13 14:49:15 EDT
Please verify, DarinS.
Comment 6 Darin Swanson CLA 2003-08-13 15:29:25 EDT
Jared, what is the test case for producing a set of launch shortcuts that is 
not sorted? Wassim's test case produces sorted shortcuts for me before the 
change.

You did a refactoring that moves the sorting but the result to me looks the 
same...the shortcuts were sorted before and the shortcuts are sorted now?
Comment 7 Jared Burns CLA 2003-08-13 16:19:06 EDT
Call any API other than getLaunchShortcuts(String, String).
Comment 8 Darin Swanson CLA 2003-08-13 16:39:41 EDT
Thanks Jared...I can see clearly now :-)
So the test case is to open a perspective that does not explictly have 
associated launch shortcuts (such as the Plug-in Development Perspective) and 
then look at the Run>Run As sorting.

Verified.