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 54436

Summary: Root node claims no nodes were found but there are some nodes displayed
Product: utilities Reporter: Marian Petras <mpetras>
Component: SearchAssignee: Marian Petras <mpetras>
Status: RESOLVED FIXED    
Severity: blocker Keywords: RANDOM, THREAD
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Marian Petras 2005-02-03 08:32:17 UTC
Sometimes, when searching a very small directory,
the Search Results window display found nodes but
the root node claims that "No matching nodes were
found." It seems that the set of displayed nodes
is correct, only the text of the root node is wrong.
Comment 1 Marian Petras 2005-02-03 08:43:11 UTC
The bug is in method Manager.startSearching(...). It calls
callOnWindowFromAWT("setResultModel", resultModel). This call
schedules method call ResultView.setResultModel(resultModel) to the
end of the AWT event queue (invokeLater(...)). If a matching node is
found before this call is processed, the result model does not notify
the root node so that it is not updated.
Comment 2 Marian Petras 2005-02-03 10:37:29 UTC
Fixed in the trunk.

I fixed the bug by replacing calls of EventQueue.invokeLater(...) with
EventQueue.invokeAndWait(...). I also reviewed which methods are
called from which threads and removed some unncessary redirections to
the AWT dispatch thread.

Modified files:
    utilities/src/org/netbeans/modules/search/:
            Manager.java   (1.8)
            ResultModel.java   (1.49)
            ResultTreeChildren.java   (1.10)
            ResultView.java   (1.30)

Diffs:
http://utilities.netbeans.org/source/browse/utilities/src/org/netbeans/modules/search/Manager.java.diff?r1=1.7&r2=1.8&f=u
http://utilities.netbeans.org/source/browse/utilities/src/org/netbeans/modules/search/ResultModel.java.diff?r1=1.48&r2=1.49&f=u
http://utilities.netbeans.org/source/browse/utilities/src/org/netbeans/modules/search/ResultTreeChildren.java.diff?r1=1.9&r2=1.10&f=u
http://utilities.netbeans.org/source/browse/utilities/src/org/netbeans/modules/search/ResultView.java.diff?r1=1.29&r2=1.30&f=u