Bug 552352 - Using SWAP in Compare editor loses changes and dirty status
Summary: Using SWAP in Compare editor loses changes and dirty status
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.6   Edit
Hardware: All Windows 10
: P3 normal (vote)
Target Milestone: 4.6.3+   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2019-10-23 09:39 EDT by William Alexander CLA
Modified: 2020-12-15 03:42 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Alexander CLA 2019-10-23 09:39:53 EDT
I have recreated this using Eclipse 4.6.3 and 4.12.
The recreate steps are as follows:
1) I started Eclipse 4.6.3 and created a new project with two text files in it. 
text1.txt with contents of:
line 1
line 2
line 3
text2.txt with contents of:
line 1
line 1a
line 2
line 3
line 4
2) close both files
3) select both files and Compare with > Each other
4) Press the button to copy the current change from right to left
5) notice the asterisk in the compare editor tab indicating that text1.txt is now dirty, because "line 1a" has been added to text1.txt
6) Press the Swap Left and Right view button
7) notice the changes that were made for text1.txt are lost, the compare editor is no longer marked as dirty, and there was no warning prompting whether to save or informing me that my changes would be lost.
Comment 1 Thomas Wolf CLA 2019-10-23 12:46:30 EDT
Perhaps related: https://github.com/eclipse/xtext-eclipse/issues/1010

Seems to have to do with corrupted internal state after the swap; in the xtext case Christian mentioned stale listeners.
Comment 2 Niraj Modi CLA 2019-12-03 01:12:07 EST
Did some initial investigation, yet to reach a fix.
Will continue on this in next release.
Comment 3 Niraj Modi CLA 2020-03-03 02:25:00 EST
Moving out of 4.15
Comment 4 Niraj Modi CLA 2020-04-07 02:44:06 EDT
Yet to reach a fix for this, one important point to note the steps mentioned in comment 0 are working fine for .java files and are only breaking for .txt file

Will continue my investigation for what best can be done here.
I am open for inputs from anybody expert in Compare module. Thanks!
Comment 5 Dani Megert CLA 2020-04-18 10:18:23 EDT
This has been moved many times now. Please fix for 4.16 M3.
Comment 6 Alexander Kurtakov CLA 2020-06-01 03:52:35 EDT
Too late now. MOve to 4.17 M1
Comment 7 Niraj Modi CLA 2020-06-03 05:51:02 EDT
IMO, not an issue in Compare module and may be related to "Text editor" since "Java editor" works fine for the very same set of steps.

Had a discussion on the bug scenario with Kalyan for his evaluation of the problem from Platform UI side.
Comment 8 Niraj Modi CLA 2020-07-07 01:29:42 EDT
Kalyan and I had couple of combined investigations on this issue, but no success so far.

Any help from the community(specifically from the Compare side) is appreciated here. Thanks!!
Comment 9 Alexander Kurtakov CLA 2020-11-17 02:37:18 EST
Remove target milestone.
Comment 10 Eclipse Genie CLA 2020-12-08 11:15:35 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173548
Comment 11 Niraj Modi CLA 2020-12-08 11:37:20 EST
(In reply to Eclipse Genie from comment #10)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173548

Attempted a fix which prompts with a Save dialog to avoid possible data loss with .txt files with steps mentioned in comment 0
Comment 13 Niraj Modi CLA 2020-12-09 12:19:15 EST
Checked the fix in below recent 4.19 IBuild:
https://download.eclipse.org/eclipse/downloads/drops4/I20201208-2310/

Resolving now.
Comment 14 Niraj Modi CLA 2020-12-10 02:03:46 EST
Reopening for back-port to 4.15+, 4.11+, 4.8+, 4.6.3+ maintenance branches.
Comment 15 Eclipse Genie CLA 2020-12-10 02:04:38 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173134
Comment 17 Eclipse Genie CLA 2020-12-10 02:49:29 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173643
Comment 19 Eclipse Genie CLA 2020-12-10 03:05:18 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173644
Comment 21 Eclipse Genie CLA 2020-12-10 03:28:56 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173645
Comment 23 Niraj Modi CLA 2020-12-10 04:01:44 EST
(In reply to Niraj Modi from comment #14)
> Reopening for back-port to 4.15+, 4.11+, 4.8+, 4.6.3+ maintenance branches.

Done with the back-porting, marking resolve.
Comment 24 Eclipse Genie CLA 2020-12-15 03:32:44 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/173806