Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2020-12-10 08:27:27 +0000
committerNiraj Modi2020-12-10 08:27:58 +0000
commitd28c8d121012ad4ff872028c44c8e6bd3b027238 (patch)
treea69da446c82e1207db0fee440090f271d364b74d
parente5eec30c484df196d8c4fae5149dda2d1735590e (diff)
downloadeclipse.platform.team-R4_6_maintenance.tar.gz
eclipse.platform.team-R4_6_maintenance.tar.xz
eclipse.platform.team-R4_6_maintenance.zip
Bug 552352 - Using SWAP in Compare editor loses changes and dirty statusR4_6_maintenance
- Back-port fix to 4.6.3+ branch Change-Id: I7376effc5cbbf93ab005fc6528b3ba792660e09a Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index 423f43e4d..e71594efb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -932,7 +932,17 @@ public abstract class ContentMergeViewer extends ContentViewer
fSwitchLeftAndRight = new Action() {
@Override
- public void run() {
+ public void run() { /*
+ * Bug 552352: When comparing .txt files with corresponding .txt file editors
+ * closed and user modifies the content of one of the .txt file in the compare
+ * view and the compare state becomes 'dirty' and if followed by a 'Swap'
+ * action, modifications get lost. This data loss is considered a severe
+ * problem, so to avoid this modified data loss in this scenario, show a
+ * confirmation dialog to 'save' the file before swapping and let user decide
+ * and take a call on this. Note: Issue not seen with .java & .properties files.
+ */
+ doSave(null, getInput());
+
IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore();
preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored());
if (preferences instanceof IPersistentPreferenceStore) {

Back to the top