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 51192 - Find on Project Node in Explorer sometimes does not work
Summary: Find on Project Node in Explorer sometimes does not work
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-05 10:34 UTC by Jan Jancura
Modified: 2004-11-10 08:06 UTC (History)
3 users (show)

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 Jan Jancura 2004-11-05 10:34:26 UTC
1) Start IDE with some set of already opened projects
2) select some project node - pop-up menu - Find
3) search for "a" expression
-> no matching nodes were found

Workarround: unfold Packages node and underlying
"Source Packages" node.
Comment 1 Marian Petras 2004-11-05 13:05:18 UTC
I just reproduced it. However, I doubt it is caused by a bug in the
Utilities module. I am evaluating it more...
Comment 2 Marian Petras 2004-11-05 15:04:40 UTC
I found the immediate cause if this bug - it is that both the Source
Packages node and the Source Packages node claim to have no subnodes.
I suspect it is caused by that class PackageViewChildren creates its
children lazily. Class PackageViewChildren is in module java/project -
reassigning to that Issuezilla component.
Comment 3 Jesse Glick 2004-11-06 00:30:10 UTC
Maybe you were failing to call getNodes(true) rather than just getNodes()?
Comment 4 Petr Hrebejk 2004-11-06 10:08:23 UTC
Sure the nodes are created asynchronously. If you don't call getNodes(
true ) you won't get them. Seems to me that the UI performance
requirements and the implementation of find are somehow incompatible.

Comment 5 Marian Petras 2004-11-08 07:18:26 UTC
You are right - I used getNodes() instead of getNodes(true). This bug
is in class SubnodesSearchInfo in module OpenideX.

Change of the method getNodes() to getNodes(true) should have no
performance impact on the nodes mentioned in the initial report -
these nodes use a subclass of SubnodesSearchInfo which does not ask
for subnodes until the Find action is invoked.
Comment 6 Marian Petras 2004-11-08 08:29:46 UTC
Fixed in the trunk.

Modified file:
    openidex/src/org/openidex/search/SubnodesSearchInfo.java   (1.2)

Diff:
http://www.netbeans.org/source/browse/openidex/src/org/openidex/search/SubnodesSearchInfo.java.diff?r1=1.1&r2=1.2&f=u
Comment 7 Marian Petras 2004-11-08 08:40:48 UTC
This bug should be fixed in NetBeans 4.0. If the bug remains
unpatched, the user may be returned wrong results from the search
feature - in most cases, they will get an empty result (no occurences
found).

After I fixed the bug in the trunk, I performed a functional test
manually - there are no automatic tests covering this bug.

The patch is very simple and low-risk. See the diff.
Comment 8 _ pkuzel 2004-11-09 10:00:17 UTC
The proposed patch is OK.
Comment 9 Jan Jancura 2004-11-09 14:53:44 UTC
Works for me in 20041109-1048.
Thanks!
Comment 10 Marian Petras 2004-11-10 08:06:56 UTC
Fixed in branch 'release40', too.

Modified file:
    openidex/src/org/openidex/search/SubnodesSearchInfo.java  (1.1.10.1)