| Summary: | Replacing text in a set of files should only modify each physical resource once | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jonathan Locke <jonathan.locke> |
| Component: | Search | Assignee: | Dani Megert <daniel_megert> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P2 | CC: | daniel_megert, jasonsj, markus.kell.r, r.berg, raksha.vasisht, remy.suen, yevshif |
| Version: | 3.6 | ||
| Target Milestone: | 3.7 M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Jonathan Locke
I can only assume what happened given the sparse information: I suspect that in your workspace several Eclipse resources are pointing to identical physical files or folders. While this is a valid setup for more complicated projects, you have to be aware that Eclipse is resource based and hence if you do a search it will find the match for all Eclipse resources e.g. if you search for "test" in project A: A f1 -> c:\foo.txt (with "test" in it) f2 -> c:\foo.txt (with "test" in it) ==> will find two matches: /A/f1 and /A/f2. This is the intended behavior which we won't change but obviously we should not corrupt any files. When replacing text in a bunch of files we should be smarter and remember which physical resource we already modified. Is that your setup? *** Bug 303715 has been marked as a duplicate of this bug. *** yes, but i'm afraid that is a fairly typical setup these days. on any decent sized project, you have nested maven projects and you have to have the root in your workspace too (to export patches from and commit from, mostly). i've been wanting for a long time to exclude the root project from all search and replace operations (i always get duplicates whenever i search my workspace). or even better: couldn't search determine the set of unique physical resources to operate on so it doesn't do things twice? it's definitely what i would expect as a user. >better: couldn't search determine the set of unique physical resources to
>operate on so it doesn't do things twice?
No, that's not an option. You could use working sets for search.
Fixed in HEAD (ReplaceRefactoring.java, rev. 1.8). Available in builds >= N20110318-2000. The fix caused a regression, see bug . The correct fix is in ReplaceRefactoring.java, rev. 1.9. Available in builds >= N20110415-2000. Verified for 3.7M7 with I20110425-1800. *** Bug 345754 has been marked as a duplicate of this bug. *** The regression was bug 342932. And in 3.7 RC1, bug 343821 fixed a UI problem in the Search view. |