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.
SourceChildren used by the ClassNode are initialized with SourceElement asynchronously. Children.findChild then fails to wait until the initialization is completed and returns null prematurely.
It is not just Children.findChild. This fix also address the other mechanisms to find children. The Children class supports the following additional methods which should also be addressed in this fix. nodes() getNodes() getNodesCount()
Yes, but other Children methods just returns the current state. If nodes are filled asynchronously (as for example the filesystem nodes), nodes() etc just returns data available at the time of the call. There are situations where you don't have fixed set of children, because they can change at any time. findChild() is special because it is specific query and can (and should) be handled specially by the data producer.
Fixed in 3.2.19, dev-159. SourceChildren instance is attached to its SourceElement from the beginning of its existence.
Target milestone -> 3.2
Resolved for 3.3.x or earlier, no new info since then -> closing.