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 43910

Summary: Creation of children under Databases node is not properly synchronized
Product: db Reporter: Jiri Skrivanek <jskrivanek>
Component: CodeAssignee: Radko Najman <rnajman>
Status: CLOSED WONTFIX    
Severity: blocker Keywords: T9Y
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Entire stack trace.

Description Jiri Skrivanek 2004-05-27 06:45:09 UTC
In spite of our test is executed in AWT event
thread, we sometimes get an exception related to
nodes. I think it is something wrong in DB module
because I haven't seen it in any other module. The
following exception is thrown when we expand
Databases node and searching for Drivers node:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.LinkedList.entry(LinkedList.java:360)
	at java.util.LinkedList.get(LinkedList.java:303)
	at
org.openide.explorer.view.VisualizerNode.getChildAt(VisualizerNode.java:213)
	at
javax.swing.tree.DefaultTreeModel.getChild(DefaultTreeModel.java:156)

I must admit it happens only in automated tests
and only sometimes. But it prevent us to write
really stable tests.

Tested in build 20040526-1710, JDK1.4.2_04, Solaris9.
Comment 1 Jiri Skrivanek 2004-05-27 06:45:39 UTC
Created attachment 15313 [details]
Entire stack trace.
Comment 2 Radko Najman 2004-09-29 15:43:07 UTC
Children are created in a separate thred. Wait node is displayed till
they are created. I think you should somehow check if wait node is
displayed or not and continue your test when wait node is replaced by
expected nodes.
For more info see
org.netbeans.modules.db.explorer.DatabaseNodeChildere.initCollection()
method.
Comment 3 Jiri Skrivanek 2004-09-30 13:19:22 UTC
OK, I tried to make the test more robust. It waits until the wait node
dismiss and then it looks for drivers node. It should help.
But the cause of problem is that the wait node is not replaced in AWT
thread. It should be solved in new implementation of DB module.
Comment 4 Radko Najman 2004-09-30 16:14:14 UTC
Test was updated so hopefully it should work now without problems.
Comment 5 Jiri Skrivanek 2004-10-01 08:34:56 UTC
Verified.