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 243644 - Threading problem with many nodes
Summary: Threading problem with many nodes
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-08 05:13 UTC by scanti
Modified: 2015-08-13 12:34 UTC (History)
0 users

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 scanti 2014-04-08 05:13:11 UTC
I had a Node with about 5000 subnodes, each of these was a job. I checked the ide back and forth to see how the execution was going and I got an exception
We have an Application based on NetBeans 7.4 

java.util.NoSuchElementException
	at java.util.ArrayList$Itr.next(Unknown Source)
	at org.openide.explorer.view.VisualizerChildren.added(VisualizerChildren.java:236)
	at org.openide.explorer.view.VisualizerEvent$Added.run(VisualizerEvent.java:110)
	at org.openide.util.Mutex.readAccess(Mutex.java:372)
	at org.openide.util.Mutex$1R.run(Mutex.java:1314)
	at org.openide.nodes.Children$ProjectManagerDeadlockDetector.execute(Children.java:1921)
	at org.openide.util.Mutex.doWrapperAccess(Mutex.java:1333)
	at org.openide.util.Mutex.readAccess(Mutex.java:361)
	at org.openide.explorer.view.VisualizerNode$QP.processQueue(VisualizerNode.java:685)
	at org.openide.explorer.view.VisualizerNode$QP.access$000(VisualizerNode.java:624)
	at org.openide.explorer.view.VisualizerNode$QP$ProcessQueue.run(VisualizerNode.java:706)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Comment 1 Ondrej Vrabec 2014-07-17 09:05:43 UTC
Is it reproducible? Could you please attach a simple test-case app that throws the exception?
Comment 2 scanti 2014-07-17 12:54:22 UTC
No, not easily reproducible
Comment 3 ashishkirpan 2015-08-13 12:34:04 UTC
Hi,

I am also facing the same issue. Previously it was rare but now it is coming most of the time. I cant share sample app because I don't have any, but I can provide steps for this sample app.

1. I am using outline view to display the nodes in tree format.
2. In this tree any node can contains its sub nodes.
3. I am using ChildFactory (ChildFactory.Detachable<ModelClassName>) and ChildNode (BeanNode<ModelClassName) to create the childrens in outline view.
4. Now If any new object added in my ModelClass list object the same needs to update in outline view tree. So I added PropertyChangeListener in ChildFactory class.
5. Now this point is most important to create this NoSuchElementException. Here, in propertyChange() method I am calling this.refresh(false) method if element is added on some if condition.
for e.g. 

public void propertyChange(PropertyChangeEvent evt) {
        
            if ("ADD_CHILD".equals(evt.getPropertyName())) {
                this.refresh(false);
            } else if ("REMOVE_CHILD".equals(evt.getPropertyName())) {
                this.refresh(false);
            } else if ("VALUE_CHANGE".equals(evt.getPropertyName())) {
                this.refresh(false);
			}    
        }
        expandNode();
    }

and at the same time I am trying to expand all nodes of the tree.
6. The expansion logic will get the node name and check in the outline view, and once it find the node it will call outlineview.getOutline().expandPath(...) method.
7. Now add the multiple nodes and subnodes in tree and fire the VALUE_CHANGE property of ModelClass object. In this case all tree will go for recreate.

This issue may reproduce.