| Summary: | Cannot save changes in compare editor for 2 projects | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> | ||||||||||
| Component: | Compare | Assignee: | Malgorzata Janczarska <malgorzata.tomczyk> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | critical | ||||||||||||
| Priority: | P3 | CC: | daniel_megert, jamesblackburn+eclipse, Szymon.Brandys, tomasz.zarna | ||||||||||
| Version: | 3.7 | ||||||||||||
| Target Milestone: | 3.7 M7 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 312893 | ||||||||||||
| Attachments: |
|
||||||||||||
Caused by bad fox for bug 273450. Even typing inside the left or right pane removes the dirty flag and hence nothing is saved on close. Note: it works when only two files are compared with each other. Created attachment 191895 [details]
mylyn/context/zip
Created attachment 192267 [details] Fixing setDirty(boolean) The problem was that while fixing bug 273450 CompareEditorInput.setDirty(boolean) was changed so that changing dirty flag to "true" was ignored. Normally setting the dirty flag is made by notifying the property change, but while selection was changed in meantime we flush is made, that first sets the CompareEditorInput dirty=false, and then dirty=true, using the API method. Because the API method did not work for dirty=true the Editor stayed in dirty==false state. The problem would occur also if any time someone would call setDirty(true) via API. I've found one case when the compare editor doesn't work as expected (it did before applying the patch): 1. Select two files (not folders), do Compare with Each Other 2. Make a change on the left side 3. Try to close the editor => IS: A dialog will pop up asking you to select which files you want to save. This is wrong because only the file on left has been modified. => WAS: A dialog asking whether you want to save the file on the left popped up. Created attachment 193067 [details] fixing setDirty() adding setRight/LeftDirty() This patch is actually combined patches for this bug and bug 312893. It gives more control over witch site of the compare is actually dirty that solves the problem pointed by Tomasz in comment #4. The bad news is that after some more extensive testing I discovered that is doesn't solve bug 312893 in 100%, so we'll have to keep bug 312893 open. (In reply to comment #5) > The bad news is that after some more extensive testing I discovered that is > doesn't solve bug 312893 in 100%, so we'll have to keep bug 312893 open. What cases does the fix not cover? Could you please update bug 312893 with them. (In reply to comment #6) > What cases does the fix not cover? Could you please update bug 312893 with them. View bug 312893 for more details. The patch works as expected. Except for bug 342951 and bug 342953 I couldn't find anything suspicious. Note that those bugs have been there since 3.6.1 at least. I've released the fix with a minor change (renamed setSaveNeeded in SaveablesCompareEditorInput to setDirty). Available in builds >=N20110415-2000. Thanks Gosia, good job! Using 3.7RC3 I'm seeing a NPE every time I save in compare editor. The NPE seems to be in the coded added by this bug. See: bug 347557 And also a NPE closing a dirty compare editor (also in new code): bug 347560 |
Created attachment 191685 [details] Team Project Set with 2 versions of org.junit I20110315-0800, was OK in 3.6.2 - new workspace - import attached Team Project Set - select the 2 projects, choose Compare With > Each Other - open a difference, e.g. .classpath - click Copy All from Left to Right => editor becomes dirty (good) - click into the right merge viewer pane => editor not dirty any more and I can't save the change. => Critical: When I close the editor, the changes are lost without any dialog. In 3.6.2, clicking into the right pane caused some flashing, but the editor stayed dirty and I could save.