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 188295 - columns of watch view has various problem
Summary: columns of watch view has various problem
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Sun Solaris
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 03:15 UTC by Chihin Ko
Modified: 2010-07-07 14:03 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chihin Ko 2010-07-02 03:15:46 UTC
use sample program JavaApplication as the test case :

add println statement into main:

    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("this is test");
    }

set bpt on line "System.out..."

start debugging, stop at bpt line

- open watch view, make sure only value column is visible
- drag and drop "Main" from source window to watch view to create
  "Main" watch node
- step into println, Type and toString() columns shown in watch views

Sometime this sequence can not always reproduce the problem, you need to play with it couple more times.

But with solstudio this problem can always be reproduced, following is from
solstudio CR 6965612 :

Steps to reproduce:
- run IDE with a fresh userdir
- create Welcome sample
- do step into
- open Watches, it contains two columns "Name" and "Value"
- drag and drop 'argc' from editor into Watches
Result: "Type" column appears unexpectedly on the first place (before Name and Value), Name and Value can change its place, e.g. the order could be Type, Value, Name. If user removes Type column and finish debug session then very often the following exception appears:
java.lang.ArrayIndexOutOfBoundsException: 2
	at org.netbeans.modules.viewmodel.OutlineTable.setColumnsOrder(OutlineTable.java:711)
	at org.netbeans.modules.viewmodel.OutlineTable.updateTableColumns(OutlineTable.java:674)
	at org.netbeans.modules.viewmodel.OutlineTable.setModel(OutlineTable.java:444)
	at org.netbeans.spi.viewmodel.Models.createView(Models.java:130)
[catch] at org.netbeans.modules.debugger.ui.views.ViewModelListener$2.run(ViewModelListener.java:486)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

It also could be java.lang.ArrayIndexOutOfBoundsException: 3 instead of 2

After that it's impossible to use Watches any more as the same exception appears after any action and Watches shows nothing. Restarting IDE does not help.
*** (#1 of 1): 2010-06-30 08:56:01 PDT alexander.pepin@sun.com
Comment 1 Martin Entlicher 2010-07-02 06:58:44 UTC
Reproduced. The same problem is with Variables window when it contains watches.
I did not get the exception, but the columns are added back as you described.
Comment 2 Alexander Pepin 2010-07-02 09:18:51 UTC
Exception usually appears after some manipulation with columns e.g. hide Type column, add a new watch , hide Type column once again etc.
Comment 3 Martin Entlicher 2010-07-02 15:12:18 UTC
This is really a piquant issue.
It seems to be a bug in Outline, witch discards the list of hidden columns and create new ones in ETable.createDefaultColumnsFromModel() in a response to tableChanged event that rebuilds the whole table.
Such event is thrown because we call refresh in the root node. And when the node has set it's display name, we call Node.fireDisplayNameChange(). The root node does not have set display name by default, unless someone ask for it. Therefore refreshes do not rebuild the whole table unless someone asks for a display name of the root node. Since the root is not visible, nobody cares about it's display name.
But there's "log("canDrop " + n);" line in OutlineViewDropSupport.canDrop(OutlineViewDropSupport.java:584) And that logging asks for the display name of the root node! Therefore the drop action into Watches initializes display name of the root node. After that, events that rebuild the whole table are sent, which results in discard of the hidden columns.
Comment 4 Chihin Ko 2010-07-02 19:48:27 UTC
Martin, 

  will you be able to fix it in 6.9.1 ? otherwise, we need to diable drag & drop
watch node in solstudio 12.2
Comment 5 Martin Entlicher 2010-07-03 06:10:04 UTC
I've made a safe fix, that just masks the problem by preventing from calling getDisplayName on the root node.
changeset:   173860:c01887dd86b4
http://hg.netbeans.org/main/rev/c01887dd86b4

Please verify in trunk builds that this helps and also that the exception does not occur. Since the fix can not break anything, it's very safe for 6.9.1.

To fix the problem in ETable.createDefaultColumnsFromModel() I've submitted issue #188341. That can be more risky to change so close before release of 6.9.1.
Comment 6 Quality Engineering 2010-07-04 08:16:34 UTC
Integrated into 'main-golden', will be available in build *201007040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c01887dd86b4
User: mentlicher@netbeans.org
Log: #188295 Mask the problem with table refreshing when root node fires it's display name change.
Comment 7 Alexander Pepin 2010-07-05 16:19:06 UTC
verified in OSS IDE built on nb6.9 with updated org-openide-explorer.jar
 provided by developers.
Please push the fix into 6.9.1.
Comment 8 ivan 2010-07-05 22:17:34 UTC
I verified this as well.
- started with an older trunk and no d&d functionality : no problems.
- added toolshg d&d fix: can see the problem, but only with d&d and not
  any watch creation as mentioned somewhere else.
- added current nb trunk, including fixes for this: no problems.
  Also no regressions wrt previous column rearrangement bug.

Thanks Martin!
Comment 9 Alexander Pepin 2010-07-07 09:34:56 UTC
Please approve integration into 6.9.1 as this fix is highly needed for OSS IDE. Without this fix we will not be able to expose a new feature in debugger and will have to drop it.
Comment 10 Martin Ryzl 2010-07-07 10:04:40 UTC
approved for integration into 6.9.1
Comment 11 Alexander Pepin 2010-07-07 10:49:01 UTC
Petr please integrate the fix today so that it will appear in nightly build.
Comment 12 pgebauer 2010-07-07 14:03:36 UTC
The fix has been ported into the release691 branch.
http://hg.netbeans.org/release691/rev/6c9709ae59ba