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 148389 - [65cat] local variables not sorted in debugger pane
Summary: [65cat] local variables not sorted in debugger pane
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 166253 167869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-25 16:31 UTC by gholmer
Modified: 2009-08-01 06:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (33.19 KB, image/png)
2008-09-25 16:32 UTC, gholmer
Details
screenshot, using 0930 build (45.75 KB, image/png)
2008-09-30 15:06 UTC, gholmer
Details
screen shot (15.82 KB, image/png)
2009-04-27 20:11 UTC, gholmer
Details
unsorted variables (24.15 KB, text/plain)
2009-05-18 15:28 UTC, gholmer
Details
screen shot showing sort arrow but unsorted variables (21.42 KB, image/png)
2009-06-15 14:51 UTC, gholmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gholmer 2008-09-25 16:31:25 UTC
[ BUILD # : 200809250201 ]
[ JDK VERSION : 1.6.0_07 ]

Local variables are not sorted correctly in debugger output pane. 
See screenshot: sort arrow is visible in name field, but names are
not sorted.  After three clicks on the column header to cycle through
sort orders, it is correct.
Comment 1 gholmer 2008-09-25 16:32:26 UTC
Created attachment 70599 [details]
screenshot
Comment 2 Martin Entlicher 2008-09-25 16:43:52 UTC
Debugger is not involved in the sorting.
Moving to tree table view.
Comment 3 Stanislav Aubrecht 2008-09-29 16:43:57 UTC
i tried nb080929, jdk1.6_05, win xp and sorting of local variables worked fine.
can you QA pls help me reproducing this issue? thanks
Comment 4 Lukas Hasik 2008-09-30 09:06:43 UTC
easily reproducible with 09/25 build on WinXp and jdk1.6.0_10.
Comment 5 Lukas Hasik 2008-09-30 09:36:31 UTC
after discussion with saubrecht I fount out that I'm not able to reproduce it.
It works for me as expected:
1, the table of local variables appears with order as the variables are in the code
2, click the name column -> ordered lexically (a-z), arrow visible
3, click the name column -> ordered lexically (z-a), arrow visible
4, click again -> back to "code order" sorting, arrow disappears

Glen, can you provide more info? What is your OS? Why are you using Metal? Is it the default l&f or do you use --laf switch?
Thank you
Comment 6 gholmer 2008-09-30 14:00:18 UTC
Glen, can you provide more info? 

What is your OS?
Ubuntu 8.04.1 with GNOME

Why are you using Metal?
0) I like Metal L&F
1) I don't like GTK L&F
2) ctrl-PgUp/ctrl-PgDn editor shortcuts don't work in Nimbus L&F

Is it the default l&f or do you use --laf switch?
I use "--laf javax.swing.plaf.metal.MetalLookAndFeel"
Comment 7 gholmer 2008-09-30 14:01:51 UTC
I should mention that I'm using 6u10, which is not in the dropdown here:
http://qa.netbeans.org/processes/cat/65/bug_form.html
Comment 8 Stanislav Aubrecht 2008-09-30 14:48:15 UTC
you wrote that three clicks were need to get correct sort order. does the order change at all on the first and second
clicks?
what happens on fourth and next clicks? what about sorting other table columns, is the same behavior?
Comment 9 gholmer 2008-09-30 15:05:38 UTC
Everything you're asking worked when I filed the issue, i.e. after clicking once, it cycled through normally.

However, I just tried now (attaching to an external copy of GlassFish), and the ordering was correct and consistent with
the arrow on first entering the debugger, so I cycled through a few times... and ended up with what's in the attached
screenshot.

Something's clearly wrong here (there is not a "division" class variable).
Comment 10 gholmer 2008-09-30 15:06:51 UTC
Created attachment 70905 [details]
screenshot, using 0930 build
Comment 11 Stanislav Aubrecht 2008-10-01 11:46:43 UTC
debugger guys, can you pls look at this one? the last screenshot shows two rows for the same variable with different values
Comment 12 Martin Entlicher 2008-10-01 13:52:35 UTC
I have no idea what the two variables with the same name mean and how can this be reproduced.
IMHO this is irrelevant to this problem. I can reproduce the bad sorting and have all variables unique.

Is there anything I can check to help you with this?
So far I've just found that SortedNodeTreeModel.sortChildren() is simply not called.
Comment 13 gholmer 2009-04-27 20:05:40 UTC
Still seeing this in 200904270201; sorting works, but variables revert to unsorted 
at each debugging session even if column header was clicked on to sort the last time.
Comment 14 gholmer 2009-04-27 20:11:08 UTC
Created attachment 81007 [details]
screen shot
Comment 15 Jiri Rechtacek 2009-05-11 15:28:34 UTC
According to the last comment I think the problem is not in sorting of variable but make a sorting mode persistent
between sessions. Reassigning back to debugger as a client OV API.
Comment 16 gholmer 2009-05-11 16:34:32 UTC
Not just persistent, but default as well.  It makes no sense to show a pane full of unsorted variables by default.
Comment 17 Martin Entlicher 2009-05-15 13:22:19 UTC
By default, the variables are listed in the order in which they appear (order which debugger provides seems to
correspond with the order in the source code).
In any case, persistent sorting seems to be a regression caused by rewrite from TreeTableView to Outline.
Comment 18 Martin Entlicher 2009-05-15 14:37:55 UTC
Moving back to Outline.
Persistence is implemented in debugger, we use ETableColumn.setSorted(). Header is marked with the arrow as expected,
but the sorting algorithm does not care at all. The rows remain unsorted.
Please fix in Outline.

Debugger part is fixed in changeset:   131803:f4159899de5d
http://hg.netbeans.org/main/rev/f4159899de5d
Comment 19 Martin Entlicher 2009-05-15 14:47:53 UTC
Moving version back to 6.5, it seems the buggy behavior of Outline is consistent with old TreeTableView, according to
the description. It's necessary to click on the sorting arrow to get desired sorting order.
Comment 20 Quality Engineering 2009-05-16 08:59:05 UTC
Integrated into 'main-golden', will be available in build *200905160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f4159899de5d
User: mentlicher@netbeans.org
Log: #148389 - Remember the sorting of columns.
Comment 21 gholmer 2009-05-18 15:28:59 UTC
Created attachment 82322 [details]
unsorted variables
Comment 22 gholmer 2009-05-18 15:31:52 UTC
The above screenshot was taken on build 200905180201 right after starting a debug session.  The sort arrow in the header
indicates that the variables are in ascending order by name, but they are not.  After clicking the header, it remains
the same, but the variables are now sorted.

This should not require a click. The variables should be presented in sorted order by default.
Comment 23 Martin Entlicher 2009-05-29 21:34:29 UTC
*** Issue 166253 has been marked as a duplicate of this issue. ***
Comment 24 gholmer 2009-06-15 14:51:16 UTC
Created attachment 83589 [details]
screen shot showing sort arrow but unsorted variables
Comment 25 gholmer 2009-06-15 14:51:52 UTC
Added another screenshot since the previous one was apparently uploaded with the wrong MIME type.
Comment 26 Martin Entlicher 2009-06-30 10:54:40 UTC
*** Issue 167869 has been marked as a duplicate of this issue. ***
Comment 27 Martin Entlicher 2009-06-30 10:55:32 UTC
*** Issue 167869 has been marked as a duplicate of this issue. ***
Comment 28 Martin Entlicher 2009-07-31 12:26:01 UTC
If I get it right, ETableColumn.setSorted() should NOT be made public in the fix of issue #151294.
The changeset http://hg.netbeans.org/main/rev/13b0821dda4a correctly made public ETableColumnModel.setColumnSorted()
which seems to work fine, but ETableColumn.setSorted() has no effect, since the model does not have the column in
"sortedColumns" list.

Since we can not simply revert the fix of issue #151294 - that would be an incompatible API change, I'll mark the method
as deprecated.
Comment 29 Martin Entlicher 2009-07-31 15:48:34 UTC
Fixed in changeset:   139950:d2cf4c0d56fd
http://hg.netbeans.org/main/rev/d2cf4c0d56fd
Comment 30 Quality Engineering 2009-08-01 06:33:56 UTC
Integrated into 'main-golden', will be available in build *200908010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d2cf4c0d56fd
User: mentlicher@netbeans.org
Log: #148389 - ETableColumn.setSorted() is deprecated since it does not made the column actually sorted. ETableColumnModel.setColumnSorted() needs to be used instead.