| Summary: | Replacing text does not update search matches for files that link to the same OS resource | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Raksha Vasisht <raksha.vasisht> | ||||
| Component: | Search | Assignee: | Dani Megert <daniel_megert> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r | ||||
| Version: | 3.7 | Flags: | markus.kell.r:
review+
|
||||
| Target Milestone: | 3.7 RC1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Raksha Vasisht
> ... and when you go to A.txt , it prompts for
> replacing the text there as well.(In reply to comment #0)
That's the expected behavior (assuming you did not save A.txt before).
To complete the support from bug 320533, the ReplaceRefactoring should also - remove the skipped secondary links to matches from the search result - refresh the secondary files in the workspace A complete fix would be too expensive and would not be local to the replace refactoring but also touch the view updating (search for file matches with same link target). In addition, once the view is involved, 'Undo' becomes problematic as the refactoring doesn't know what the view did. Actually, this is already know an issue when replacing "normal" matches. Created attachment 194717 [details]
Fix
The attached patch fixes the case where the selected/all matches to replace contain all the links pointing to the same target. If that's not the case then the view will still be out of sync.
This patch also cleans up some code. Relevant part of the changes are in:
- ReplaceRefactoring.SearchResultUpdateChange.getMatches()
- ReplaceRefactoring.isAlreadyCollected(FileMatch)
Markus, OK for RC1? +1 for RC1. Released ReplaceRefactoring.java to HEAD with a few minor changes. Verified for 3.7RC1 with I20110514-0800. |