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.
I have found SourceElement can have status STATUS_OK and, at the same moment, the node wich represents the java source (obtained via DataObject.getNodeDelegate()) has getChildren().getNodesCount() == 0. This takes place when java object is selected in NB explorer. When this object is opened in editor, getChildren().getNodesCount() > 0. Andrew P.S. I have asked about it nbdev mail-list without answer :-(
Not receiving answer within 48 hours does not mean that the question will not be answered; community support works on the "best-effort" basis.
Created attachment 5702 [details] testcase
Svata, testcase attachemnt was commited: build, add for testing, select java object in FS, view output window. P.S. This is my first step to understand something in API - I'm sure there are multiple uglies in the code :-)
This is a tough one. I've found a potential race condition in SourceChildren.java, but that does not fix your problem. It seems that your listener is activated before the event (source file was parsed) propagates to the SourceChildren. So at the time the listener calls expand(), nodes aren't yet updated because the SourceChildren's listener may be next in the queue to be notified. I couldn't come with a solution to this issue... Would you mind moving the discussion to nbdev@ again ? In the meantime, I'll fix the race at least: /cvs/openide/src/org/openide/src/nodes/SourceChildren.java,v <-- SourceChildren.java new revision: 1.33; previous revision: 1.32
VERIFIED
Resolved for 3.4.x or earlier, no new info since then -> closing.