Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Barbero2013-05-31 12:26:08 +0000
committerGerrit Code Review @ Eclipse.org2013-05-31 12:26:08 +0000
commit814abca3925e952ea51dd6d5ac5b9bfc1fc9ce20 (patch)
tree88e0227c24aa421bb942a63c51ddfdf34d97d431
parent2386580220baf49f766f2d2af7a6fad270d6989c (diff)
parent53c92efdbb8820e1509a3cd891dfff8081289c60 (diff)
downloadorg.eclipse.emf.compare-814abca3925e952ea51dd6d5ac5b9bfc1fc9ce20.tar.gz
org.eclipse.emf.compare-814abca3925e952ea51dd6d5ac5b9bfc1fc9ce20.tar.xz
org.eclipse.emf.compare-814abca3925e952ea51dd6d5ac5b9bfc1fc9ce20.zip
Merge "[396260] The structure merge viewer should not unload all resources" into 2.1
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java19
1 files changed, 14 insertions, 5 deletions
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 fe256a98b..e9cfa8716 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
@@ -143,6 +143,12 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
private EventBus eventBus;
/**
+ * When comparing EObjects from a resource, the resource involved doesn't need to be unload by EMF
+ * Compare.
+ */
+ private boolean resourcesShouldBeUnload;
+
+ /**
* @param parent
* @param configuration
*/
@@ -309,10 +315,13 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
void compareInputChanged(ICompareInput input, IProgressMonitor monitor) {
if (input != null) {
if (input instanceof ComparisonNode) {
+ resourcesShouldBeUnload = false;
compareInputChanged((ComparisonNode)input, monitor);
} else if (input instanceof ComparisonScopeInput) {
+ resourcesShouldBeUnload = false;
compareInputChanged((ComparisonScopeInput)input, monitor);
} else {
+ resourcesShouldBeUnload = true;
SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
final ITypedElement left = input.getLeft();
@@ -404,11 +413,11 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
editingDomain = null;
}
- // FIXME: should unload only if input.getLeft/Right/Ancestor (previously stored in field) are
- // instanceof ResourceNode
- unload(leftResourceSet);
- unload(rightResourceSet);
- unload(originResourceSet);
+ if (resourcesShouldBeUnload) {
+ unload(leftResourceSet);
+ unload(rightResourceSet);
+ unload(originResourceSet);
+ }
if (getCompareConfiguration() != null) {
getCompareConfiguration().setProperty(EMFCompareConstants.COMPARE_RESULT, null);

Back to the top