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

Bug 313011

Summary: Variables should be sorted by name
Product: [WebTools] JSDT Reporter: Michael Schneider <michschn>
Component: DebugAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: Michael_Rennie, potionsmasterz, thatnitind
Version: 3.2Flags: deboer: pmc_approved+
thatnitind: review+
Michael_Rennie: review+
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
Screenshot of the issue
none
proposed patch
none
updated patch
none
updated patch v2 none

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