From 5d880636dcd863aef63631564c2878b6f2ad8bdd Mon Sep 17 00:00:00 2001 From: lgoubet Date: Thu, 21 Mar 2019 15:08:34 +0100 Subject: Disposing of the comparison shouldn't be done by the SMV In case of comparison dialogs, the SMV might be switched to other files, while the comparison itself will be kept around. Clearing the adapters will render that comparison invalid and reopening the previously selected file will then fail to show all differences. Change-Id: I441584a09198b6859742538e028004dba3937d54 --- .../ide/ui/internal/configuration/EMFCompareConfiguration.java | 4 +++- .../internal/structuremergeviewer/EMFCompareStructureMergeViewer.java | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java index 895521cfd..427fd8b42 100644 --- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java +++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java @@ -200,7 +200,9 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl // CompareConfiguration does not clear its properties list... // Lets clean our own mess ourselves // EVENT_BUS must not be set to null + Comparison comparison = getComparison(); disposeComparison(); + comparison.eAdapters().clear(); } /** @@ -216,7 +218,7 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl } /** - * {@link #dispose()} is only called when the comparison editor is closed, whereas EMFCompareComparison + * {@link #dispose()} is only called when the comparison editor is closed, whereas EMFCompareConfiguration * follows its own separate lifecycle. See documentation of {@link #dispose()}. * * @see #dispose() diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java index 43420c55f..a5e35c0a1 100644 --- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java +++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java @@ -1827,7 +1827,6 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap } } } - comparison.eAdapters().clear(); } editingDomainChange(getCompareConfiguration().getEditingDomain(), null); -- cgit v1.2.3