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 23352 - getNodesCount() == 0 after parse task finished
Summary: getNodesCount() == 0 after parse task finished
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-10 16:27 UTC by andrew
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
testcase (4.75 KB, application/octet-stream)
2002-05-10 19:40 UTC, andrew
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2002-05-10 16:27:47 UTC
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 :-(
Comment 1 Svata Dedic 2002-05-10 18:08:08 UTC
Not receiving answer within 48 hours does not mean that the question
will not be answered; community support works on the "best-effort" basis.
Comment 2 andrew 2002-05-10 19:40:20 UTC
Created attachment 5702 [details]
testcase
Comment 3 andrew 2002-05-10 19:44:28 UTC
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 :-)
Comment 4 Svata Dedic 2002-05-17 16:44:18 UTC
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

Comment 5 Jan Becicka 2002-06-27 15:49:52 UTC
VERIFIED
Comment 6 Quality Engineering 2003-07-01 13:21:42 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.