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 103145 - Search results may be inapplicable after source file modification.
Summary: Search results may be inapplicable after source file modification.
Status: RESOLVED WONTFIX
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-02 14:54 UTC by Jana Maleckova
Modified: 2011-08-09 13:03 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2007-05-02 14:54:04 UTC
NetBeans IDE 6.0 Preview (M9, build 070501)
1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252

Description:
============
If some changes are made in guarded blocks after searching, then search result
are not displayed correctly in detail (selected in source editor)

test case:
==========
have project with jFrame and insert some components in it.
1. invoke search and replace dialog (ctrl-shift-p) and try to find e. g.
component's variable name
2. all occurrences are displayed in search/result win. Check that all results
are correctly displayed in editor after double click (are highlighted)
3. insert another component and save form
4. then check previous occurrences again as it is described in step. 2
see that results are not correctly highlighted in editor and different code is mark.
workaround: do the search again ...
Comment 1 Tomas Stupka 2007-09-07 10:47:56 UTC
simpler way to reproduce:

1.) search for a string and doubleclick on some item from the hitlist - the searched string will be highlighted in the
editor
2.) now move the cursor to a position before the highlighted text and hit enter
3.) doubleclick the same item in the hitlist 


org.netbeans.modules.search.TextDetail has a Line object which is referencing the line number the searched text was
found at. Unfortunately, the column number (also held by TextDetail) doesn't exist in that line anymore.  

Comment 2 Alexei Mokeev 2009-01-16 09:46:53 UTC
In general the search results become obsolete once you modified source code.
Currently (for java) results are valid until you modified exactly the line with the appearance (Tomas usecase).
  
Nevertheless, IDE could do better job here by trying to match old results to the new sources.
Comment 3 Jaroslav Havlin 2011-08-09 12:59:10 UTC
It is not always possible to match old results with new document content, but current release (7.0.1) does quite a good job trying it.