Community
Participate
Working Groups
Created attachment 273112 [details] Screenshot Build ID: CDT Photon M6 (9.5m6) on Eclipse Photon M6 / MacOSX Sierra 10.12.6 If the "Rename Refactoring" finds partial matches and there are multiple Linked Resources pointing to a matching file, the source code gets totally messed up: editor contents still looks correct, but file contents on disk is broken. Even "Refresh" doesn't reload broken contents from disk, so users might notice too late. This is a severe issue as it may cause data loss! Likely affects all hosts and not only MacOSX. See also the lower pane ("Goinkoink") in attached screenshot how file is broken. I assume the issue occurs, because file contents is replaced multiple times in the same file (ie once per linked resource). The issue occurs on CDT projects generated by cmake, as these typically create duplicate file resources. Steps to reproduce: 1. git clone https://github.com/moberhuber/refactor-test-suite.git 2. brew install cmake 3. brew install ninja 4. mkdir rft-build && cd rft-build 5. cmake -G'Eclipse CDT4 - Ninja' ../refactor-test-suite 6. In CDT, "Import Existing Projects" from the rft-build directory 7. Open Resource : Rename.cpp 8. In line 53, select the namespace identifier X and Refactor > Rename : Goink --> In the "11 Potential Matches" dialog, accept defaults (Preview, OK) --> Editor looks OK, but "git diff" on command-line shows the broken file Workaround : In the "Potential Matches" dialog, deselect the 2nd linked resource occurrence of Rename.cpp Proposed fix: Make sure that any file shown in the "Partial Matches" dialog from refactoring is unique. Simply hide any duplicates caused by linked resources or symbolic links.