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.
The bug manifests itself as IZ 140788. To observe what is described below put a breakpoint inside org.openide.nodes.EntrySupport$Default.getArray() method. While processing expansion of a node in project tree the AWT-EventQueue thread posts a request into RequestProcessor at org.openide.explorer.view.TreeView.prepareWaitCursor(). Thus 2 threads would execute org.openide.nodes.EntrySupport$Default.getArray() method. Scenario 1. If AWT-EventQueue thread gets first into the getArray() method it will successfully execute if (doInitialize) { ... children.callAddNotify(); ... "children calculation" branch, while RequestProcessor will be waiting in the "else" branch for the calculation to be completed. Scenario 2. If RequestProcessor thread gets first into the getArray() method it will be executing the "children calculation" branch. Unfortunately the AWT-EventQueue (which at the moment is processing the node expansion mouse click) willn't be waiting on the "else" branch for the "children calculation" to be completed. The reason is that the AWT-EventQueue has already obtained these Children's MUTEX.readAccess() back at at org.openide.explorer.view.TreeView$ExplorerTree$GuardedActions.<init> (TreeView.java:2043) Thus the check in the "else" branch of getArray() method if (Children.MUTEX.isReadAccess() || Children.MUTEX.isWriteAccess() || (initThread == Thread.currentThread())) { will produce "true". So the getNodes() executed in AWT-EventQueue at ... at org.openide.nodes.EntrySupport$Default.getNodes(EntrySupport.java:153 ) ... at org.openide.explorer.view.VisualizerNode.getChildren(VisualizerNode.j ava:250) at org.openide.explorer.view.VisualizerNode.getChildCount(VisualizerNode .java:324) at javax.swing.tree.DefaultTreeModel.getChildCount(DefaultTreeModel.java :168) ... would return empty set of children. The RequestProcessor who is executing children.callAddNotify(); in the "children calculation" branch wouldn't be able to execute it as the writeRequests generated for the mutex are put on hold until readAccess is relinquished by AWT-EventQueue ( ie. until AWT-EventQueue returns well above (in the call stack) getNodes() whcih already produced empty set of children) Thus mouse click to expand a node would produce no children-nodes under the node.
Dangerous locking in TreeView should be already removed - see #140458. Can you please check if this issue is still valid?
We last pulled from golden on the 24th. It looks like the fix for issue 140458 was integrated on the 25th. We'll verify against main. Thanks, George
Closing as duplicate of #140458. Please reopen if problem still exists. *** This issue has been marked as a duplicate of 140458 ***