Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313011 - Variables should be sorted by name
Summary: Variables should be sorted by name
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Simon Kaegi CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-15 07:37 EDT by Michael Schneider CLA
Modified: 2010-12-17 09:18 EST (History)
3 users (show)

See Also:
deboer: pmc_approved+
thatnitind: review+
Michael_Rennie: review+


Attachments
Screenshot of the issue (103.13 KB, image/png)
2010-05-15 07:37 EDT, Michael Schneider CLA
no flags Details
proposed patch (8.19 KB, patch)
2010-05-17 09:58 EDT, Simon Kaegi CLA
no flags Details | Diff
updated patch (8.19 KB, patch)
2010-05-17 14:32 EDT, Simon Kaegi CLA
no flags Details | Diff
updated patch v2 (8.51 KB, patch)
2010-05-17 15:58 EDT, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schneider CLA 2010-05-15 07:37:06 EDT
Created attachment 168630 [details]
Screenshot of the issue

When using the variable view, the variables seems to be "hash-map" sorted.

This makes it hard to spy a variable, especially because all scopes are shown in one list. In my scenario, where I basically start up a browser environment with Dojo, there are always lots of variables around.

See attached screenshot
Comment 1 Simon Kaegi CLA 2010-05-17 09:58:14 EDT
Created attachment 168729 [details]
proposed patch

This is something we want fixed for RC2. Indeed there is no sortinging and the variable order is from a hashmap. This is particularly bad for arrays and needs to be fixed.
Comment 2 Michael Rennie CLA 2010-05-17 13:29:12 EDT
This patch uses 1.5 code in a 1.4 bundle -1 from me. 

Reported error:

"The method valueOf(String) in the type Integer is not applicable for the arguments (int)"	

ArrayReferenceImpl.java	line 86

That aside the sorting does make it somewhat less painful to find a variable. Fixing bug 312287 would greatly help the variable confusion as well.
Comment 3 Simon Kaegi CLA 2010-05-17 14:32:54 EDT
Created attachment 168789 [details]
updated patch

Updating patch to use 1.4 method. Thanks Michael. Good catch.
Comment 4 Simon Kaegi CLA 2010-05-17 15:58:01 EDT
Created attachment 168812 [details]
updated patch v2

Added "advanced" name1 matching to correct a typo (thanks Michael) as well as making variable name matching case insensitive and added [proto] as the first variable on Objects to be consistent with JDT Debug L&F.
Comment 5 Michael Rennie CLA 2010-05-17 16:11:55 EDT
looks good now.
Comment 6 Simon Kaegi CLA 2010-05-17 17:09:05 EDT
Fixed in HEAD