Bug 36345 - "Occurrences in File" deletes search history
Summary: "Occurrences in File" deletes search history
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-10 08:30 EDT by Robert Klemme CLA
Modified: 2003-04-14 03:28 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Klemme CLA 2003-04-10 08:30:56 EDT
Steps to reproduce:
Clear search history.
On a class indentifier right click -> search -> occurrences in file
On another class identifer do the same
The search history now contains only the last search.

This problem does not arise, if another search (e.g. search -> references) is 
done in between.
Comment 1 Dani Megert CLA 2003-04-10 09:54:23 EDT
Good catch.
Happens because the searches with same runnable are considered equal (to support
Search Again). This specific search cannot be repeated and hence has null as its
runnable and therefore they are all considered equal.

Fixed and released in HEAD. Not critical enough to go into 2.1 maintenance stream.
Comment 2 Robert Klemme CLA 2003-04-11 02:36:28 EDT
Fine. The one thing I can't understand is why this search can't be repeated.  I 
can see no obvious reason for this.  If someone finds the time to explain, I'd 
be glad.  Thanks!
Comment 3 Dani Megert CLA 2003-04-14 03:28:18 EDT
Sure. The search is an AST based search. To repeat the search we would either
have to keep the AST node or start to manage text positions (the text in the
editor at the cursor position where the search started could have been changed -
e.g. the local variable v might have been refactored to a field). Keeping the
AST node is bad because all other referenced nodes would stay in memory.

Given the needed overhead and our assumption that this kind of search is mostly
used while the file itself is open and therefore redoing a search can be done by
selecting the same "thing" again and hit Ctrl+U, we did not provide the search
again action. If you think this is needed then please file a new feature request
for this.