This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268814

Summary: in debugger: array elements are sorted by string, not element order
Product: cnd Reporter: tbrunhoff <tbrunhoff>
Component: DebuggerAssignee: Maria Tishkova <mromashova>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P2    
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Variables pane

Description tbrunhoff 2016-11-03 20:47:34 UTC
Created attachment 162758 [details]
Variables pane

This was a bug in 2007, and fixed, so perhaps this is a regression. see #122997.

In the 'Variables' pane array elements are sorted by the string that represents their order, not the order itself. See the attached screenshot and note that m_baseVector[0] is followed by m_baseVector[10], and so on.
Comment 1 tbrunhoff 2016-11-03 21:09:14 UTC
Product Version: NetBeans IDE Dev (Build 201609190002)
Updates: Updates available
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Linux version 4.1.13-100.fc21.x86_64 running on amd64; UTF-8; en_US (nb)
User directory: /home/toddb/.netbeans/dev
Cache directory: /home/toddb/.cache/netbeans/dev
Comment 2 Maria Tishkova 2016-11-09 14:35:09 UTC
I need more information, as for simple case when we just have plain array there is no such problem. 
What is the type of the variable? I need a code to reproduce the problem as using the sample from the bz #122997 I do not see incorrect ordering
Comment 3 tbrunhoff 2016-11-09 15:23:43 UTC
Yes, simple program don't show the issue. I even tried to extract some of the structures from the original code, and the order of array elements is correct.

I might suggest you look at the code that renders array elements and look for a conditional where one branch orders arrays by index and another branch orders by a sort of the text rendering of each element.
Comment 4 Maria Tishkova 2016-11-15 12:59:02 UTC
fixed in release82 branch in enum (will be later transplanted to the trunk)

changeset:   313319:16852c2eecc4
branch:      release82
tag:         tip
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Tue Nov 15 15:56:36 2016 +0300
summary:     fixed bz#268814 - in debugger: array elements are sorted by string, not element order
Comment 5 Quality Engineering 2016-11-23 03:19:17 UTC
Integrated into 'main-silver', will be available in build *201611230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2f435d884b86
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed bz#268814 - in debugger: array elements are sorted by string, not element order
(transplanted from 16852c2eecc42acac473ed2cb7e5b0d5c92828a7)
Comment 6 Quality Engineering 2016-12-03 03:04:09 UTC
Integrated into 'main-silver', will be available in build *201612030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/797a7e94023e
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed bz#268814 - in debugger: array elements are sorted by string, not element order
- additional fix i18n
(transplanted from a35fd7b8f600e4e625ec3820398484f3616c410b)
Comment 7 soldatov 2016-12-07 14:59:39 UTC
Verified in internal NetBeans 8,2 patch 1 build.