Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2012-10-04 14:42:33 +0000
committerMikaël Barbero2012-10-04 14:44:51 +0000
commit2907dfe53df56d1c73ae263bb5ff017a0156fcd3 (patch)
tree57db82e6d00fdd04b5ae8b2ee4d62c8efc31e974
parentca4e1a9d26db1b83195b221a4d9eb4eae020df6e (diff)
downloadorg.eclipse.emf.compare-2907dfe53df56d1c73ae263bb5ff017a0156fcd3.tar.gz
org.eclipse.emf.compare-2907dfe53df56d1c73ae263bb5ff017a0156fcd3.tar.xz
org.eclipse.emf.compare-2907dfe53df56d1c73ae263bb5ff017a0156fcd3.zip
API embellishment
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/ComparisonItemProvider.java1
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java75
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java18
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java18
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java6
-rw-r--r--plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java97
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/equi/EquiComputingTest.java70
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fragmentation/FragmentationTest.java28
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java6
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java6
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java3
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DynamicInstanceComparisonTest.java23
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java18
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/ProximityComparisonTest.java14
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeOutOfScopeValuesTest.java144
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeTest.java288
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/MultipleMergeTest.java52
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java83
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/req/ReqComputingTest.java110
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java16
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation2Test.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation3Test.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/ChangeAssociationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddActionExecutionSpecificationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddBehaviorExecutionSpecificationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/extend/AddExtendTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/generalizationSet/AddGeneralizationSetTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/message/AddMessageTest.java32
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/StereotypeTest.java80
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/timeConstraint/AddTimeConstraintTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java120
-rw-r--r--plugins/org.eclipse.emf.compare/model/compare.ecore5
-rw-r--r--plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java26
-rw-r--r--plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java18
-rw-r--r--plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/CompareFactoryImpl.java25
-rw-r--r--plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java18
-rw-r--r--plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java64
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java330
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareConfiguration.java23
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java43
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java172
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java23
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/EMFCompareExtensionRegistry.java72
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java2
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java114
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ComparisonSpec.java23
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ReferenceChangeSpec.java6
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultComparisonFactory.java49
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java46
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java265
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IComparisonFactory.java29
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IEqualityHelperFactory.java27
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java1
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java94
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ProximityEObjectMatcher.java55
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java24
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/DiffUtil.java32
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EMFComparePredicates.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java95
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/IEqualityHelper.java54
73 files changed, 1878 insertions, 1326 deletions
diff --git a/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/ComparisonItemProvider.java b/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/ComparisonItemProvider.java
index da63285ba..f135f7366 100644
--- a/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/ComparisonItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/ComparisonItemProvider.java
@@ -22,7 +22,6 @@ import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.ComparePackage;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.EMFCompareConfiguration;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
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 d8fbe2b7a..9a39d03a1 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
@@ -176,8 +176,8 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
final IComparisonScope scope = EMFCompare.createDefaultScope(leftResourceSet, rightResourceSet,
originResourceSet);
- final Comparison compareResult = EMFCompare.newComparator(scope).setMonitor(
- BasicMonitor.toMonitor(monitor)).compare();
+ final Comparison compareResult = EMFCompare.builder().build().compare(scope,
+ BasicMonitor.toMonitor(monitor));
EMFCompareEditingDomain editingDomain = new EMFCompareEditingDomain(compareResult,
leftResourceSet, rightResourceSet, originResourceSet);
getCompareConfiguration().setProperty(EMFCompareConstants.EDITING_DOMAIN, editingDomain);
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java
new file mode 100644
index 000000000..fc4da4e11
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDE.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide;
+
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.conflict.IConflictDetector;
+import org.eclipse.emf.compare.diff.IDiffEngine;
+import org.eclipse.emf.compare.equi.IEquiEngine;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
+import org.eclipse.emf.compare.match.IMatchEngine;
+import org.eclipse.emf.compare.req.IReqEngine;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class EMFCompareIDE extends EMFCompare {
+
+ /**
+ * @param matchEngine
+ * @param diffEngine
+ * @param reqEngine
+ * @param equiEngine
+ * @param conflictDetector
+ * @param postProcessorRegistry
+ */
+ protected EMFCompareIDE(IMatchEngine matchEngine, IDiffEngine diffEngine, IReqEngine reqEngine,
+ IEquiEngine equiEngine, IConflictDetector conflictDetector,
+ PostProcessorRegistry postProcessorRegistry) {
+ super(matchEngine, diffEngine, reqEngine, equiEngine, conflictDetector, postProcessorRegistry);
+ }
+
+ /**
+ * @return
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder extends EMFCompare.Builder {
+
+ public Builder() {
+ this.registry = EMFCompareIDEPlugin.getDefault().getPostProcessorRegistry();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.EMFCompare.Builder#setPostProcessorRegistry(org.eclipse.emf.compare.extension.PostProcessorRegistry)
+ */
+ @Override
+ public org.eclipse.emf.compare.EMFCompare.Builder setPostProcessorRegistry(
+ PostProcessorRegistry registry) {
+ throw new UnsupportedOperationException(
+ "Can not set a post processor registry in the IDE context");
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.EMFCompare.Builder#build()
+ */
+ @Override
+ public EMFCompare build() {
+ return super.build();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
index 2f21dc398..77870c95f 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/EMFCompareIDEPlugin.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.compare.ide;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.ide.internal.extension.PostProcessorRegistryListener;
import org.osgi.framework.BundleContext;
@@ -28,8 +29,13 @@ public class EMFCompareIDEPlugin extends Plugin {
/** This plugin's shared instance. */
private static EMFCompareIDEPlugin plugin;
+ /**
+ * The registry that will hold references to all post processors.
+ */
+ private PostProcessorRegistry postProcessorRegistry;
+
/** The registry listener that will be used to react to post processor changes. */
- private PostProcessorRegistryListener postProcessorListener = new PostProcessorRegistryListener();
+ private PostProcessorRegistryListener postProcessorListener;
/**
* {@inheritDoc}
@@ -41,6 +47,9 @@ public class EMFCompareIDEPlugin extends Plugin {
plugin = this;
super.start(context);
+ this.postProcessorRegistry = new PostProcessorRegistry();
+ this.postProcessorListener = new PostProcessorRegistryListener(postProcessorRegistry);
+
final IExtensionRegistry registry = Platform.getExtensionRegistry();
registry.addListener(postProcessorListener,
@@ -63,6 +72,13 @@ public class EMFCompareIDEPlugin extends Plugin {
}
/**
+ * @return the postProcessorRegistry
+ */
+ public PostProcessorRegistry getPostProcessorRegistry() {
+ return postProcessorRegistry;
+ }
+
+ /**
* Returns the shared instance.
*
* @return the shared instance
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java
index d0dfbcbd4..065b38929 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/extension/PostProcessorRegistryListener.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IRegistryEventListener;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.compare.extension.EMFCompareExtensionRegistry;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
/**
* This listener will allow us to be aware of contribution changes against the model resolver extension point.
@@ -30,6 +30,12 @@ public class PostProcessorRegistryListener implements IRegistryEventListener {
/** Name of the extension point's "postProcessor" tag. */
private static final String POST_PROCESSOR_TAG = "postProcessor"; //$NON-NLS-1$
+ private final PostProcessorRegistry registry;
+
+ public PostProcessorRegistryListener(PostProcessorRegistry registry) {
+ this.registry = registry;
+ }
+
/**
* {@inheritDoc}
*
@@ -55,9 +61,9 @@ public class PostProcessorRegistryListener implements IRegistryEventListener {
* it's been registered. This will parse these initial contributions.
*/
public void parseInitialContributions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
+ final IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- for (IExtension extension : registry.getExtensionPoint(POST_PROCESSOR_EXTENSION_POINT)
+ for (IExtension extension : extensionRegistry.getExtensionPoint(POST_PROCESSOR_EXTENSION_POINT)
.getExtensions()) {
parseExtension(extension);
}
@@ -75,7 +81,7 @@ public class PostProcessorRegistryListener implements IRegistryEventListener {
if (POST_PROCESSOR_TAG.equals(elem.getName())) {
final String postProcessorClassName = elem
.getAttribute(PostProcessorIDEDescriptor.POST_PROCESSOR_CLASS_ATTRIBUTE);
- EMFCompareExtensionRegistry.removePostProcessor(postProcessorClassName);
+ registry.removePostProcessor(postProcessorClassName);
}
}
}
@@ -96,11 +102,11 @@ public class PostProcessorRegistryListener implements IRegistryEventListener {
* @param extension
* Parses the given extension and adds its contribution to the registry.
*/
- private static void parseExtension(IExtension extension) {
+ private void parseExtension(IExtension extension) {
final IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement element : configElements) {
if (POST_PROCESSOR_TAG.equals(element.getName())) {
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorIDEDescriptor(element));
+ registry.addPostProcessor(new PostProcessorIDEDescriptor(element));
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java
index 51411c976..6ed95c4dc 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/ManyStructuralFeatureAccessorImpl.java
@@ -29,7 +29,7 @@ import org.eclipse.emf.compare.rcp.ui.mergeviewer.InsertionPoint;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.MatchedObject;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.MergeViewer.MergeViewerSide;
import org.eclipse.emf.compare.utils.DiffUtil;
-import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -173,11 +173,11 @@ public class ManyStructuralFeatureAccessorImpl extends BasicStructuralFeatureAcc
private Object matchingValue(Object value, List<?> in) {
Object ret = null;
- EqualityHelper equalityHelper = getComparison().getConfiguration().getEqualityHelper();
+ IEqualityHelper equalityHelper = getComparison().getEqualityHelper();
Iterator<?> valuesIterator = in.iterator();
while (valuesIterator.hasNext() && ret == null) {
Object object = valuesIterator.next();
- if (equalityHelper.matchingValues(getComparison(), object, value)) {
+ if (equalityHelper.matchingValues(object, value)) {
ret = object;
}
}
diff --git a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
index 97bbb2ed3..860212767 100644
--- a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
@@ -23,5 +23,6 @@ Export-Package: org.eclipse.emf.compare.tests.framework,
org.eclipse.emf.compare.tests.nodes.util,
org.eclipse.emf.compare.tests.suite
Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
+ com.google.common.cache;version="[10.0.0,11.0.0)",
com.google.common.collect;version="[10.0.0,11.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
index fcc497746..ddaae9fcc 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/conflict/ConflictDetectionTest.java
@@ -56,7 +56,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA1AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -94,7 +94,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA1ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -142,8 +142,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA2AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
-
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -180,7 +179,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA2ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -218,7 +217,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA3AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -256,7 +255,7 @@ public class ConflictDetectionTest {
final Resource right = input.getA3ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -304,7 +303,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB1AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -343,7 +342,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB1ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -382,7 +381,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB2AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -421,7 +420,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB2ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -460,7 +459,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB3AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -499,7 +498,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB3ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -538,7 +537,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB4AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -577,7 +576,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB4ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -616,7 +615,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB5AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -655,7 +654,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB5ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -694,7 +693,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB6AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -733,7 +732,7 @@ public class ConflictDetectionTest {
final Resource right = input.getB6ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -772,7 +771,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC1AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -810,7 +809,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC1ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -868,7 +867,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC2AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -906,7 +905,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC2ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -966,7 +965,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC3AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1004,7 +1003,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC3ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1042,7 +1041,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC4AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1096,7 +1095,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC4ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1162,7 +1161,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC5AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1200,7 +1199,7 @@ public class ConflictDetectionTest {
final Resource right = input.getC5ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1258,7 +1257,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD1AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1297,7 +1296,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD1ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1336,7 +1335,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD2AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1375,7 +1374,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD2ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1414,7 +1413,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD3AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1453,7 +1452,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD3ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1492,7 +1491,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD4AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1565,7 +1564,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD4ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1638,7 +1637,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD5AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1675,7 +1674,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD5ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1712,7 +1711,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD6AttributeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1749,7 +1748,7 @@ public class ConflictDetectionTest {
final Resource right = input.getD6ReferenceRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1786,7 +1785,7 @@ public class ConflictDetectionTest {
final Resource right = input.getE1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1824,7 +1823,7 @@ public class ConflictDetectionTest {
final Resource right = input.getE2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1862,7 +1861,7 @@ public class ConflictDetectionTest {
final Resource right = input.getFRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1901,7 +1900,7 @@ public class ConflictDetectionTest {
final Resource right = input.getGRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1940,7 +1939,7 @@ public class ConflictDetectionTest {
final Resource right = input.getH1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -1978,7 +1977,7 @@ public class ConflictDetectionTest {
final Resource right = input.getH2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -2016,7 +2015,7 @@ public class ConflictDetectionTest {
final Resource right = input.getIRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
@@ -2035,7 +2034,7 @@ public class ConflictDetectionTest {
final Resource right = input.getComplexRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final List<Conflict> conflicts = comparison.getConflicts();
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/equi/EquiComputingTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/equi/EquiComputingTest.java
index c8f5137cd..963b9f8b4 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/equi/EquiComputingTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/equi/EquiComputingTest.java
@@ -45,7 +45,7 @@ public class EquiComputingTest {
final Resource left = input.getA1Left();
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testA1(TestKind.LEFT, comparison);
}
@@ -120,7 +120,7 @@ public class EquiComputingTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testA2(TestKind.LEFT, comparison);
@@ -221,7 +221,7 @@ public class EquiComputingTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testA3(TestKind.LEFT, comparison);
@@ -310,7 +310,7 @@ public class EquiComputingTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testA4(TestKind.LEFT, comparison);
}
@@ -368,7 +368,7 @@ public class EquiComputingTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testA5(TestKind.LEFT, comparison);
}
@@ -479,7 +479,7 @@ public class EquiComputingTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA1(TestKind.RIGHT, comparison);
}
@@ -490,7 +490,7 @@ public class EquiComputingTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA2(TestKind.RIGHT, comparison);
}
@@ -501,7 +501,7 @@ public class EquiComputingTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA3(TestKind.RIGHT, comparison);
}
@@ -512,7 +512,7 @@ public class EquiComputingTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA4(TestKind.RIGHT, comparison);
}
@@ -523,7 +523,7 @@ public class EquiComputingTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA5(TestKind.RIGHT, comparison);
}
@@ -534,7 +534,7 @@ public class EquiComputingTest {
final Resource right = input.getC1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testC1(TestKind.LEFT, comparison);
}
@@ -585,7 +585,7 @@ public class EquiComputingTest {
final Resource right = input.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testC2(TestKind.LEFT, comparison);
}
@@ -641,7 +641,7 @@ public class EquiComputingTest {
final Resource right = input.getC3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testC3(TestKind.LEFT, comparison);
}
@@ -697,7 +697,7 @@ public class EquiComputingTest {
final Resource right = input.getC4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testC4(TestKind.LEFT, comparison);
}
@@ -758,7 +758,7 @@ public class EquiComputingTest {
final Resource right = input.getD1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testD1(TestKind.LEFT, comparison);
}
@@ -902,7 +902,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE1Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA1(TestKind.LEFT, comparison);
}
@@ -914,7 +914,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE2Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA2(TestKind.LEFT, comparison);
}
@@ -926,7 +926,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE3Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA3(TestKind.LEFT, comparison);
}
@@ -938,7 +938,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE4Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA4(TestKind.LEFT, comparison);
}
@@ -950,7 +950,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE5Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA5(TestKind.LEFT, comparison);
}
@@ -962,7 +962,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE6Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC1(TestKind.LEFT, comparison);
}
@@ -974,7 +974,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE7Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC2(TestKind.LEFT, comparison);
}
@@ -986,7 +986,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE8Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC3(TestKind.LEFT, comparison);
}
@@ -998,7 +998,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE9Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC4(TestKind.LEFT, comparison);
}
@@ -1010,7 +1010,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getE10Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testD1(TestKind.LEFT, comparison);
}
@@ -1022,7 +1022,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF1Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA1(TestKind.RIGHT, comparison);
}
@@ -1034,7 +1034,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF2Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA2(TestKind.RIGHT, comparison);
}
@@ -1046,7 +1046,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF3Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA3(TestKind.RIGHT, comparison);
}
@@ -1058,7 +1058,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF4Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA4(TestKind.RIGHT, comparison);
}
@@ -1070,7 +1070,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF5Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testA5(TestKind.RIGHT, comparison);
}
@@ -1082,7 +1082,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF6Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC1(TestKind.RIGHT, comparison);
}
@@ -1094,7 +1094,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF7Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC2(TestKind.RIGHT, comparison);
}
@@ -1106,7 +1106,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF8Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC3(TestKind.RIGHT, comparison);
}
@@ -1118,7 +1118,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF9Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testC4(TestKind.RIGHT, comparison);
}
@@ -1130,7 +1130,7 @@ public class EquiComputingTest {
final Resource ancestor = input.getF10Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
testD1(TestKind.RIGHT, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fragmentation/FragmentationTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fragmentation/FragmentationTest.java
index 5a57d65f3..ec30b6858 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fragmentation/FragmentationTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fragmentation/FragmentationTest.java
@@ -62,7 +62,7 @@ public class FragmentationTest {
assertSame(Integer.valueOf(1), Integer.valueOf(rightSet.getResources().size()));
final IComparisonScope scope = EMFCompare.createDefaultScope(leftSet, rightSet, originSet);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -92,7 +92,7 @@ public class FragmentationTest {
EcoreUtil.resolveAll(rightSet);
final IComparisonScope scope = EMFCompare.createDefaultScope(leftSet, rightSet, originSet);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final Diff diff = differences.get(0);
@@ -103,12 +103,12 @@ public class FragmentationTest {
assertSame(Integer.valueOf(1), Integer.valueOf(right.getContents().size()));
// there should be no diff between left and right
- final Comparison lrCompare = EMFCompare.newComparator(
- EMFCompare.createDefaultScope(leftSet, rightSet)).compare();
+ final Comparison lrCompare = EMFCompare.builder().build().compare(
+ EMFCompare.createDefaultScope(leftSet, rightSet));
assertSame(Integer.valueOf(0), Integer.valueOf(lrCompare.getDifferences().size()));
// but there should be two diffs (a pseudo conflict deletion) when compared with origin
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getDifferences().size()));
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getConflicts().size()));
}
@@ -129,7 +129,7 @@ public class FragmentationTest {
EcoreUtil.resolveAll(rightSet);
final IComparisonScope scope = EMFCompare.createDefaultScope(leftSet, rightSet, originSet);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final Diff diff = differences.get(0);
@@ -139,7 +139,7 @@ public class FragmentationTest {
assertSame(Integer.valueOf(2), Integer.valueOf(origin.getContents().size()));
assertSame(Integer.valueOf(2), Integer.valueOf(right.getContents().size()));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -150,7 +150,7 @@ public class FragmentationTest {
final Resource right = input.getDeletedRootRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -172,7 +172,7 @@ public class FragmentationTest {
final Resource right = input.getDeletedRootRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final Diff diff = differences.get(0);
@@ -183,12 +183,12 @@ public class FragmentationTest {
assertSame(Integer.valueOf(1), Integer.valueOf(right.getContents().size()));
// there should be no diff between left and right
- final Comparison lrCompare = EMFCompare.newComparator(EMFCompare.createDefaultScope(left, right))
- .compare();
+ final Comparison lrCompare = EMFCompare.builder().build().compare(
+ EMFCompare.createDefaultScope(left, right));
assertSame(Integer.valueOf(0), Integer.valueOf(lrCompare.getDifferences().size()));
// but there should be two diffs (a pseudo conflict deletion) when compared with origin
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getDifferences().size()));
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getConflicts().size()));
}
@@ -201,7 +201,7 @@ public class FragmentationTest {
final Resource right = input.getDeletedRootRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
final Diff diff = differences.get(0);
@@ -211,7 +211,7 @@ public class FragmentationTest {
assertSame(Integer.valueOf(2), Integer.valueOf(origin.getContents().size()));
assertSame(Integer.valueOf(2), Integer.valueOf(right.getContents().size()));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
index 6ccbbef5d..80b7cd273 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.emf.compare.tests.framework.junit.internal;
+import com.google.common.cache.CacheBuilder;
+
import java.lang.reflect.Constructor;
import org.eclipse.emf.common.notify.Notifier;
@@ -108,8 +110,8 @@ public class DiffStatement extends Statement {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
- final IEObjectMatcher contentMatcher = ProximityEObjectMatcher.builder(
- EditionDistance.builder(new EqualityHelper()).build()).build();
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder())).build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
engine = new DefaultMatchEngine(matcher);
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
index 3cda4e041..9342553f4 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.emf.compare.tests.framework.junit.internal;
+import com.google.common.cache.CacheBuilder;
+
import java.lang.reflect.Constructor;
import java.util.List;
@@ -114,8 +116,8 @@ public class MatchStatement extends Statement {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
- final IEObjectMatcher contentMatcher = ProximityEObjectMatcher.builder(
- EditionDistance.builder(new EqualityHelper()).build()).build();
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder())).build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
engine = new DefaultMatchEngine(matcher);
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java
index 80f322b9e..4172f0933 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.compare.tests.fullcomparison;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Lists;
import org.eclipse.emf.compare.match.eobject.EditionDistance;
@@ -48,7 +49,7 @@ public class DistanceAxiomsTests {
@Before
public void setUp() throws Exception {
AllTests.fillEMFRegistries();
- this.meter = new EditionDistance(new EqualityHelper());
+ this.meter = new EditionDistance(EqualityHelper.createDefaultCache(CacheBuilder.newBuilder()));
}
@DataPoints
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DynamicInstanceComparisonTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DynamicInstanceComparisonTest.java
index acf6fb798..4750ba450 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DynamicInstanceComparisonTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DynamicInstanceComparisonTest.java
@@ -17,6 +17,7 @@ import java.io.IOException;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.fullcomparison.data.dynamic.DynamicInstancesInputData;
import org.eclipse.emf.compare.tests.suite.AllTests;
import org.eclipse.emf.ecore.resource.Resource;
@@ -48,43 +49,43 @@ public class DynamicInstanceComparisonTest {
@Test
public void compare2Ways() throws IOException {
- Comparison result = EMFCompare.newComparator(EMFCompare.createDefaultScope(left, right)).compare();
+ Comparison result = EMFCompare.builder().build().compare(EMFCompare.createDefaultScope(left, right));
assertEquals("We are supposed to have one difference (ADD/REMOVE of an instance)", 1, result
.getDifferences().size());
}
@Test
public void compare3Ways() throws IOException {
- Comparison result = EMFCompare.newComparator(EMFCompare.createDefaultScope(left, right, origin))
- .compare();
+ Comparison result = EMFCompare.builder().build().compare(
+ EMFCompare.createDefaultScope(left, right, origin));
assertEquals("We are supposed to have one difference (ADD/REMOVE of an instance)", 1, result
.getDifferences().size());
}
@Test
public void copyLeftToRight() throws IOException {
- EMFCompare comparator = EMFCompare.newComparator(EMFCompare.createDefaultScope(left, right));
- Comparison result = comparator.compare();
+ IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
+ Comparison result = EMFCompare.builder().build().compare(scope);
assertEquals("We are supposed to have one difference (ADD/REMOVE of an instance)", 1, result
.getDifferences().size());
for (Diff diff : result.getDifferences()) {
diff.copyLeftToRight();
}
- assertEquals("We are supposed to have no difference as we merged everything", 0, comparator.compare()
- .getDifferences().size());
+ assertEquals("We are supposed to have no difference as we merged everything", 0, EMFCompare.builder()
+ .build().compare(scope).getDifferences().size());
}
@Test
public void copyRightToLeft() throws IOException {
- EMFCompare comparator = EMFCompare.newComparator(EMFCompare.createDefaultScope(left, right));
- Comparison result = comparator.compare();
+ IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
+ Comparison result = EMFCompare.builder().build().compare(scope);
assertEquals("We are supposed to have one difference (ADD/REMOVE of an instance)", 1, result
.getDifferences().size());
for (Diff diff : result.getDifferences()) {
diff.copyRightToLeft();
}
- assertEquals("We are supposed to have no difference as we merged everything", 0, comparator.compare()
- .getDifferences().size());
+ assertEquals("We are supposed to have no difference as we merged everything", 0, EMFCompare.builder()
+ .build().compare(scope).getDifferences().size());
}
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java
index 31464332a..b3ddcaf4c 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java
@@ -10,10 +10,13 @@
*/
package org.eclipse.emf.compare.tests.fullcomparison;
+import com.google.common.cache.CacheBuilder;
+
import java.io.IOException;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
+import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.EditionDistance;
import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
import org.eclipse.emf.compare.match.eobject.IdentifierEObjectMatcher;
@@ -61,10 +64,10 @@ public class MatchPerformanceComparisonTest {
@Test
public void warmup() throws IOException {
- final IEObjectMatcher contentMatcher = ProximityEObjectMatcher.builder(
- EditionDistance.builder(new EqualityHelper()).build()).build();
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder())).build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
- DefaultMatchEngine matchEngine = new DefaultMatchEngine(matcher);
+ IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
}
@@ -72,7 +75,7 @@ public class MatchPerformanceComparisonTest {
@Test
public void matchPerIdAlmostIdenticalModels() throws IOException {
final IEObjectMatcher matcher = new IdentifierEObjectMatcher();
- DefaultMatchEngine matchEngine = new DefaultMatchEngine(matcher);
+ IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
for (int i = 0; i < nbIterations; i++) {
matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
@@ -81,13 +84,12 @@ public class MatchPerformanceComparisonTest {
@Test
public void matchPerContentAlmostIdenticalModels() throws IOException {
- final IEObjectMatcher contentMatcher = ProximityEObjectMatcher.builder(
- EditionDistance.builder(new EqualityHelper()).build()).build();
- DefaultMatchEngine matchEngine = new DefaultMatchEngine(contentMatcher);
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder())).build());
+ IMatchEngine matchEngine = new DefaultMatchEngine(contentMatcher);
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
for (int i = 0; i < nbIterations; i++) {
matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
}
}
-
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/ProximityComparisonTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/ProximityComparisonTest.java
index 12ca1de53..2b15f6098 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/ProximityComparisonTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/ProximityComparisonTest.java
@@ -18,6 +18,7 @@ import com.google.common.collect.Lists;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.framework.EMFCompareTestBase;
import org.eclipse.emf.compare.tests.fullcomparison.data.distance.DistanceMatchInputData;
@@ -48,7 +49,7 @@ public class ProximityComparisonTest extends EMFCompareTestBase {
v2.getEClassifiers().clear();
final IComparisonScope scope = EMFCompare.createDefaultScope(v1, v2);
- Comparison result = EMFCompare.newComparator(scope).compare();
+ Comparison result = EMFCompare.builder().build().compare(scope);
assertAllMatched(Lists.newArrayList(v1), result);
assertEquals("We are supposed to have zero diffs", 0, result.getDifferences().size());
}
@@ -58,7 +59,8 @@ public class ProximityComparisonTest extends EMFCompareTestBase {
Resource left = inputData.getCompareLeft();
Resource right = inputData.getCompareRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison result = EMFCompare.newComparator(scope).matchByID(UseIdentifiers.NEVER).compare();
+ Comparison result = EMFCompare.builder().setMatchEngine(
+ DefaultMatchEngine.create(UseIdentifiers.NEVER)).build().compare(scope);
assertEquals("We are supposed to have one rename diff", 1, result.getDifferences().size());
}
@@ -69,7 +71,7 @@ public class ProximityComparisonTest extends EMFCompareTestBase {
EPackage v2 = EcoreUtil.copy(EcorePackage.eINSTANCE);
final IComparisonScope scope = EMFCompare.createDefaultScope(v1, v2);
- Comparison result = EMFCompare.newComparator(scope).compare();
+ Comparison result = EMFCompare.builder().build().compare(scope);
assertAllMatched(Lists.newArrayList(v1), result);
assertEquals("We are supposed to have zero diffs", 0, result.getDifferences().size());
@@ -83,7 +85,8 @@ public class ProximityComparisonTest extends EMFCompareTestBase {
v2.setName("renamed");
final IComparisonScope scope = EMFCompare.createDefaultScope(v1, v2);
- Comparison result = EMFCompare.newComparator(scope).matchByID(UseIdentifiers.NEVER).compare();
+ Comparison result = EMFCompare.builder().setMatchEngine(
+ DefaultMatchEngine.create(UseIdentifiers.NEVER)).build().compare(scope);
assertAllMatched(Lists.newArrayList(v1), result);
assertEquals("We are supposed to have zero diffs", 1, result.getDifferences().size());
}
@@ -92,7 +95,8 @@ public class ProximityComparisonTest extends EMFCompareTestBase {
public void alwaysTakeTheClosestNoMatterTheIterationOrder() throws Exception {
final IComparisonScope scope = EMFCompare.createDefaultScope(inputData.getVerySmallLeft(), inputData
.getVerySmallRight());
- Comparison result = EMFCompare.newComparator(scope).matchByID(UseIdentifiers.NEVER).compare();
+ Comparison result = EMFCompare.builder().setMatchEngine(
+ DefaultMatchEngine.create(UseIdentifiers.NEVER)).build().compare(scope);
assertEquals(
"The Match took on element which is close enough (in the limits) preventing the next iteration to take it (it was closest)",
1, result.getDifferences().size());
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeOutOfScopeValuesTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeOutOfScopeValuesTest.java
index dc7994a2d..a9eec8071 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeOutOfScopeValuesTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeOutOfScopeValuesTest.java
@@ -45,7 +45,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoChangeRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -78,7 +78,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -88,7 +88,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoChangeRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -121,7 +121,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -132,7 +132,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoChangeOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -175,7 +175,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -186,7 +186,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoChangeOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -226,7 +226,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// And coincidentally, "origin" also points to that same proxy in this case
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)originValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -238,7 +238,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoChangeOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -278,7 +278,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// And coincidentally, "origin" also points to that same proxy in this case
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)originValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -290,7 +290,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoChangeOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -333,7 +333,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -343,7 +343,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoSetRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -376,7 +376,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -386,7 +386,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoSetRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -417,7 +417,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertNull(leftValue);
assertNull(rightValue);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -428,7 +428,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoSetOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -467,7 +467,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -478,7 +478,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoSetOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -513,7 +513,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertNull(rightValue);
assertNull(originValue);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -525,7 +525,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoSetOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -560,7 +560,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertNull(rightValue);
assertNull(originValue);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -572,7 +572,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoSetOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -611,7 +611,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -621,7 +621,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoUnsetRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -652,7 +652,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertNull(leftValue);
assertNull(rightValue);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -662,7 +662,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMonoUnsetRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -695,7 +695,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -706,7 +706,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoUnsetOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -743,7 +743,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -754,7 +754,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoUnsetOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -791,7 +791,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -803,7 +803,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoUnsetOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -840,7 +840,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(((InternalEObject)leftValue).eProxyURI(), ((InternalEObject)rightValue).eProxyURI());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -852,7 +852,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMonoUnsetOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -889,7 +889,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -899,7 +899,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiAddRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -949,7 +949,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertTrue(rightProxyIndex != -1);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -959,7 +959,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiAddRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1008,7 +1008,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(-1, leftProxyIndex);
assertEquals(-1, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1019,7 +1019,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiAddOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1083,7 +1083,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1094,7 +1094,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiAddOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1155,7 +1155,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(-1, rightProxyIndex);
assertEquals(-1, originProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1167,7 +1167,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiAddOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1228,7 +1228,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(-1, rightProxyIndex);
assertEquals(-1, originProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1240,7 +1240,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiAddOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1304,7 +1304,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1314,7 +1314,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiDelRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1363,7 +1363,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(-1, leftProxyIndex);
assertEquals(-1, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1373,7 +1373,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiDelRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1423,7 +1423,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertTrue(rightProxyIndex != -1);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1434,7 +1434,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiDelOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1498,7 +1498,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1510,7 +1510,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiDelOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1574,7 +1574,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1586,7 +1586,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiDelOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1649,7 +1649,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(2, originProxyIndex);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1660,7 +1660,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiDelOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1723,7 +1723,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(2, originProxyIndex);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1733,7 +1733,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiMoveRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1785,7 +1785,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertTrue(rightProxyIndex != -1);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1795,7 +1795,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource right = input.getReferenceMultiMoveRightOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1847,7 +1847,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertTrue(rightProxyIndex != -1);
assertEquals(leftProxyIndex, rightProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1858,7 +1858,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiMoveOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1924,7 +1924,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1935,7 +1935,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiMoveOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1999,7 +1999,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(leftProxyIndex, rightProxyIndex);
assertEquals(leftProxyIndex, originProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2011,7 +2011,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiMoveOriginOutOfScope();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2075,7 +2075,7 @@ public class IndividualMergeOutOfScopeValuesTest {
assertEquals(leftProxyIndex, rightProxyIndex);
assertEquals(leftProxyIndex, originProxyIndex);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2087,7 +2087,7 @@ public class IndividualMergeOutOfScopeValuesTest {
final Resource origin = input.getReferenceMultiMoveOriginOutOfScope();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2153,7 +2153,7 @@ public class IndividualMergeOutOfScopeValuesTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeTest.java
index fc7d29ea9..7c8605001 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/IndividualMergeTest.java
@@ -57,7 +57,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoChangeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -74,7 +74,7 @@ public class IndividualMergeTest {
assertEquals("leftValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -84,7 +84,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoChangeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -101,7 +101,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -112,7 +112,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoChangeOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -131,7 +131,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -142,7 +142,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoChangeOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -159,7 +159,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -171,7 +171,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoChangeOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -188,7 +188,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -200,7 +200,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoChangeOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -219,7 +219,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -229,7 +229,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoSetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -246,7 +246,7 @@ public class IndividualMergeTest {
assertEquals("leftValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -256,7 +256,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoSetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -273,7 +273,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -284,7 +284,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoSetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -303,7 +303,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -314,7 +314,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoSetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -331,7 +331,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -343,7 +343,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoSetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -360,7 +360,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -372,7 +372,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoSetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -391,7 +391,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -401,7 +401,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoUnsetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -418,7 +418,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -428,7 +428,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMonoUnsetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -445,7 +445,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -456,7 +456,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoUnsetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -475,7 +475,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -486,7 +486,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoUnsetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -503,7 +503,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -515,7 +515,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoUnsetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -532,7 +532,7 @@ public class IndividualMergeTest {
assertEquals("originValue", originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -544,7 +544,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMonoUnsetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -563,7 +563,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -573,7 +573,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiAddRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -592,7 +592,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -602,7 +602,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiAddRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -621,7 +621,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -632,7 +632,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiAddOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -653,7 +653,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -664,7 +664,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiAddOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -683,7 +683,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -695,7 +695,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiAddOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -714,7 +714,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -726,7 +726,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiAddOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -747,7 +747,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -757,7 +757,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiDelRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -776,7 +776,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -786,7 +786,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiDelRight();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -805,7 +805,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -816,7 +816,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -837,7 +837,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -848,7 +848,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -867,7 +867,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -879,7 +879,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -898,7 +898,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains("value1"));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -910,7 +910,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -931,7 +931,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -942,7 +942,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiMoveRight();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -965,7 +965,7 @@ public class IndividualMergeTest {
assertTrue(sourceFeatureValue instanceof List<?>);
assertEqualContents(((List<Object>)targetFeatureValue), ((List<Object>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -976,7 +976,7 @@ public class IndividualMergeTest {
final Resource right = input.getAttributeMultiMoveRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -999,7 +999,7 @@ public class IndividualMergeTest {
assertTrue(sourceFeatureValue instanceof List<?>);
assertEqualContents(((List<Object>)targetFeatureValue), ((List<Object>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1011,7 +1011,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1036,7 +1036,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1048,7 +1048,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1071,7 +1071,7 @@ public class IndividualMergeTest {
assertTrue(sourceFeatureValue instanceof List<?>);
assertEqualContents(((List<Object>)targetFeatureValue), ((List<Object>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1084,7 +1084,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1107,7 +1107,7 @@ public class IndividualMergeTest {
assertTrue(sourceFeatureValue instanceof List<?>);
assertEqualContents(((List<Object>)targetFeatureValue), ((List<Object>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1120,7 +1120,7 @@ public class IndividualMergeTest {
final Resource origin = input.getAttributeMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1145,7 +1145,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1155,7 +1155,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoChangeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1174,7 +1174,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1184,7 +1184,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoChangeRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1203,7 +1203,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1214,7 +1214,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoChangeOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1235,7 +1235,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1246,7 +1246,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoChangeOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1265,7 +1265,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1277,7 +1277,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoChangeOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1296,7 +1296,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1308,7 +1308,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoChangeOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1329,7 +1329,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1339,7 +1339,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoSetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1358,7 +1358,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1368,7 +1368,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoSetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1385,7 +1385,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1396,7 +1396,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoSetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1417,7 +1417,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1428,7 +1428,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoSetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1445,7 +1445,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1457,7 +1457,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoSetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1474,7 +1474,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1486,7 +1486,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoSetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1507,7 +1507,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1517,7 +1517,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoUnsetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1534,7 +1534,7 @@ public class IndividualMergeTest {
assertNull(originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1544,7 +1544,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMonoUnsetRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1563,7 +1563,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1574,7 +1574,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoUnsetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1593,7 +1593,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1604,7 +1604,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoUnsetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1623,7 +1623,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1635,7 +1635,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoUnsetOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1654,7 +1654,7 @@ public class IndividualMergeTest {
assertSame(targetNode, originNode.eGet(feature));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1666,7 +1666,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMonoUnsetOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1685,7 +1685,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1695,7 +1695,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiAddRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1716,7 +1716,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1726,7 +1726,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiAddRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1747,7 +1747,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1758,7 +1758,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiAddOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1781,7 +1781,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1792,7 +1792,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiAddOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1813,7 +1813,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1825,7 +1825,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiAddOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1846,7 +1846,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1858,7 +1858,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiAddOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1881,7 +1881,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1891,7 +1891,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiDelRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1912,7 +1912,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertFalse(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1922,7 +1922,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiDelRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1943,7 +1943,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1954,7 +1954,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -1977,7 +1977,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -1988,7 +1988,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiDelOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2009,7 +2009,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2021,7 +2021,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiDelOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2042,7 +2042,7 @@ public class IndividualMergeTest {
assertTrue(featureValue instanceof Collection<?>);
assertTrue(((Collection<?>)featureValue).contains(targetNode));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2054,7 +2054,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiDelOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2077,7 +2077,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2088,7 +2088,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiMoveRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2112,7 +2112,7 @@ public class IndividualMergeTest {
assertEqualContents(comparison, ((List<EObject>)targetFeatureValue),
((List<EObject>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2123,7 +2123,7 @@ public class IndividualMergeTest {
final Resource right = input.getReferenceMultiMoveRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2147,7 +2147,7 @@ public class IndividualMergeTest {
assertEqualContents(comparison, ((List<EObject>)targetFeatureValue),
((List<EObject>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2159,7 +2159,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2185,7 +2185,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2197,7 +2197,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiMoveOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2221,7 +2221,7 @@ public class IndividualMergeTest {
assertEqualContents(comparison, ((List<EObject>)targetFeatureValue),
((List<EObject>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2234,7 +2234,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiMoveOrigin();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2258,7 +2258,7 @@ public class IndividualMergeTest {
assertEqualContents(comparison, ((List<EObject>)targetFeatureValue),
((List<EObject>)sourceFeatureValue));
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -2271,7 +2271,7 @@ public class IndividualMergeTest {
final Resource origin = input.getReferenceMultiMoveOrigin();
IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
@@ -2297,7 +2297,7 @@ public class IndividualMergeTest {
// We should have no difference between left and right ... though they might be different from origin
scope = EMFCompare.createDefaultScope(left, right);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/MultipleMergeTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/MultipleMergeTest.java
index d83a0c76f..422b3812f 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/MultipleMergeTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/MultipleMergeTest.java
@@ -60,7 +60,7 @@ public class MultipleMergeTest {
final Resource right = conflictInput.getComplexRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
/*
@@ -179,7 +179,7 @@ public class MultipleMergeTest {
final Resource right = conflictInput.getComplexRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -270,7 +270,7 @@ public class MultipleMergeTest {
final Resource right = conflictInput.getComplexRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -360,7 +360,7 @@ public class MultipleMergeTest {
final Resource right = conflictInput.getComplexRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, origin);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -453,7 +453,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -495,7 +495,7 @@ public class MultipleMergeTest {
// And validate that diff6 got merged as an equivalent diff
assertMerged(comparison, diff6, false, false);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -505,7 +505,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -543,7 +543,7 @@ public class MultipleMergeTest {
assertMerged(comparison, diff5, true, true);
assertMerged(comparison, diff6, true, true);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -553,7 +553,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -580,7 +580,7 @@ public class MultipleMergeTest {
assertMerged(comparison, diff3, false, false);
assertMerged(comparison, diff4, false, false);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -590,7 +590,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -617,7 +617,7 @@ public class MultipleMergeTest {
assertMerged(comparison, diff3, true, true);
assertMerged(comparison, diff4, true, true);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -627,7 +627,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -686,7 +686,7 @@ public class MultipleMergeTest {
assertSame(DifferenceState.MERGED, diff11.getState());
assertSame(DifferenceState.MERGED, diff12.getState());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -696,7 +696,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -765,7 +765,7 @@ public class MultipleMergeTest {
diff11.copyRightToLeft();
diff12.copyRightToLeft();
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -775,7 +775,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -803,7 +803,7 @@ public class MultipleMergeTest {
assertMerged(comparison, diff3, true, false);
assertMerged(comparison, diff4, false, false);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -813,7 +813,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -846,7 +846,7 @@ public class MultipleMergeTest {
assertMerged(comparison, diff3, true, false);
assertMerged(comparison, diff4, false, false);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -856,7 +856,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -894,7 +894,7 @@ public class MultipleMergeTest {
diff1.copyRightToLeft();
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -904,7 +904,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getC4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -949,7 +949,7 @@ public class MultipleMergeTest {
// 2 required 3, which is equivalent to 5. 5 should thus have been merged too
assertMerged(comparison, diff5, false, false);
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
@@ -959,7 +959,7 @@ public class MultipleMergeTest {
final Resource right = equivalenceInput.getC4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- Comparison comparison = EMFCompare.newComparator(scope).compare();
+ Comparison comparison = EMFCompare.builder().build().compare(scope);
final List<Diff> differences = comparison.getDifferences();
@@ -1003,7 +1003,7 @@ public class MultipleMergeTest {
assertNull(diff5.getMatch().getLeft());
assertNull(diff5.getMatch().getRight());
- comparison = EMFCompare.newComparator(scope).compare();
+ comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getDifferences().size()));
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
index a92439233..5c66f007b 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/PostProcessorTest.java
@@ -16,13 +16,15 @@ import java.io.IOException;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.extension.EMFCompareExtensionRegistry;
import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
import org.eclipse.emf.compare.tests.postprocess.data.PostProcessInputData;
import org.eclipse.emf.compare.tests.postprocess.data.TestPostProcessor;
+import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
-import org.junit.After;
+import org.junit.BeforeClass;
import org.junit.Test;
@SuppressWarnings("nls")
@@ -30,9 +32,9 @@ public class PostProcessorTest {
private PostProcessInputData input = new PostProcessInputData();
- @After
- public void after() {
- EMFCompareExtensionRegistry.clearRegistry();
+ @BeforeClass
+ public static void beforeClass() {
+ EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
}
@Test
@@ -42,7 +44,7 @@ public class PostProcessorTest {
final Resource right = input.getRight();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
}
@@ -52,14 +54,16 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// Post processing (add a match element) if EMF Compare scans a model coming from the namespace URI
// "http://www.eclipse.org/emf/compare/tests/nodes" at least.
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(
+ registry.addPostProcessor(new PostProcessorDescriptor(
"http://www.eclipse.org/emf/compare/tests/nodes", null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getMatches().size()));
@@ -70,13 +74,15 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// Post processing (add a match element) if EMF Compare scans a model from the namespace URI which
// matches the regex ".*/nodes" at least.
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(".*/nodes", null,
+ registry.addPostProcessor(new PostProcessorDescriptor(".*/nodes", null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getMatches().size()));
@@ -87,12 +93,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned namespace URIs.
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(".*/nides", null,
+ registry.addPostProcessor(new PostProcessorDescriptor(".*/nides", null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -103,12 +111,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned namespace URIs (null value case)
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, null,
+ registry.addPostProcessor(new PostProcessorDescriptor(null, null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -119,12 +129,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned namespace URIs (empty value case)
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor("", null,
+ registry.addPostProcessor(new PostProcessorDescriptor("", null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -135,12 +147,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned namespace URIs (blank value case)
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(" ", null,
+ registry.addPostProcessor(new PostProcessorDescriptor(" ", null,
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -151,14 +165,15 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// Post processing (add a match element) if EMF Compare scans a resource where its URI is the same as
// the specified one at least.
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, left.getURI()
- .toString(), "org.eclipse.emf.compare.logical.extension.TestPostProcess",
- new TestPostProcessor()));
+ registry.addPostProcessor(new PostProcessorDescriptor(null, left.getURI().toString(),
+ "org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getMatches().size()));
@@ -169,13 +184,15 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// Post processing (add a match element) if EMF Compare scans a resource where its URI matches the
// specified regex at least.
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nodes",
+ registry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nodes",
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(2), Integer.valueOf(comparison.getMatches().size()));
@@ -186,12 +203,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned resource URIs
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nides",
+ registry.addPostProcessor(new PostProcessorDescriptor(null, ".*.nides",
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -202,12 +221,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned resource URIs (empty value)
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, "",
+ registry.addPostProcessor(new PostProcessorDescriptor(null, "",
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
@@ -218,12 +239,14 @@ public class PostProcessorTest {
final Resource left = input.getLeft();
final Resource right = input.getRight();
+ PostProcessorRegistry registry = new PostProcessorRegistry();
// No post processes if the regex matches no scanned resource URIs (blank value)
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(null, " ",
+ registry.addPostProcessor(new PostProcessorDescriptor(null, " ",
"org.eclipse.emf.compare.logical.extension.TestPostProcess", new TestPostProcessor()));
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().setPostProcessorRegistry(registry).build()
+ .compare(scope);
assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getMatches().size()));
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/req/ReqComputingTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/req/ReqComputingTest.java
index 3904397ed..e5c423780 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/req/ReqComputingTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/req/ReqComputingTest.java
@@ -53,7 +53,7 @@ public class ReqComputingTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -63,7 +63,7 @@ public class ReqComputingTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -73,7 +73,7 @@ public class ReqComputingTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -83,7 +83,7 @@ public class ReqComputingTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB4(TestKind.DELETE, comparison);
}
@@ -93,7 +93,7 @@ public class ReqComputingTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB5(TestKind.DELETE, comparison);
}
@@ -103,7 +103,7 @@ public class ReqComputingTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB6(TestKind.DELETE, comparison);
}
@@ -114,7 +114,7 @@ public class ReqComputingTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB7(TestKind.ADD, comparison);
}
@@ -124,7 +124,7 @@ public class ReqComputingTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB8(TestKind.ADD, comparison);
}
@@ -134,7 +134,7 @@ public class ReqComputingTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB9(TestKind.ADD, comparison);
}
@@ -144,7 +144,7 @@ public class ReqComputingTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB10(TestKind.ADD, comparison);
}
@@ -154,7 +154,7 @@ public class ReqComputingTest {
final Resource right = input.getA11Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB11(TestKind.ADD, comparison);
}
@@ -164,7 +164,7 @@ public class ReqComputingTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -174,7 +174,7 @@ public class ReqComputingTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -184,7 +184,7 @@ public class ReqComputingTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -194,7 +194,7 @@ public class ReqComputingTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB4(TestKind.ADD, comparison);
}
@@ -204,7 +204,7 @@ public class ReqComputingTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB5(TestKind.ADD, comparison);
}
@@ -214,7 +214,7 @@ public class ReqComputingTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB6(TestKind.ADD, comparison);
}
@@ -224,7 +224,7 @@ public class ReqComputingTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB7(TestKind.DELETE, comparison);
}
@@ -234,7 +234,7 @@ public class ReqComputingTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB8(TestKind.DELETE, comparison);
}
@@ -244,7 +244,7 @@ public class ReqComputingTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB9(TestKind.DELETE, comparison);
}
@@ -254,7 +254,7 @@ public class ReqComputingTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB10(TestKind.DELETE, comparison);
}
@@ -264,7 +264,7 @@ public class ReqComputingTest {
final Resource right = input.getA11Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB11(TestKind.DELETE, comparison);
}
@@ -274,7 +274,7 @@ public class ReqComputingTest {
final Resource right = input.getC1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD1(TestKind.DELETE, comparison);
}
@@ -284,7 +284,7 @@ public class ReqComputingTest {
final Resource right = input.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD2(TestKind.DELETE, comparison);
}
@@ -294,7 +294,7 @@ public class ReqComputingTest {
final Resource right = input.getC3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD3(TestKind.DELETE, comparison);
}
@@ -304,7 +304,7 @@ public class ReqComputingTest {
final Resource right = input.getC4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD4(TestKind.DELETE, comparison);
}
@@ -314,7 +314,7 @@ public class ReqComputingTest {
final Resource right = input.getC5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD5(TestKind.DELETE, comparison);
}
@@ -324,7 +324,7 @@ public class ReqComputingTest {
final Resource right = input.getC1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD1(TestKind.ADD, comparison);
}
@@ -334,7 +334,7 @@ public class ReqComputingTest {
final Resource right = input.getC2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD2(TestKind.ADD, comparison);
}
@@ -344,7 +344,7 @@ public class ReqComputingTest {
final Resource right = input.getC3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD3(TestKind.ADD, comparison);
}
@@ -354,7 +354,7 @@ public class ReqComputingTest {
final Resource right = input.getC4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD4(TestKind.ADD, comparison);
}
@@ -364,7 +364,7 @@ public class ReqComputingTest {
final Resource right = input.getC5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD5(TestKind.ADD, comparison);
}
@@ -375,7 +375,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE1Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -386,7 +386,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE2Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -397,7 +397,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE3Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -408,7 +408,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE4Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB4(TestKind.DELETE, comparison);
}
@@ -419,7 +419,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE5Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB5(TestKind.DELETE, comparison);
}
@@ -430,7 +430,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE6Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB6(TestKind.DELETE, comparison);
}
@@ -441,7 +441,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE7Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD1(TestKind.DELETE, comparison);
}
@@ -452,7 +452,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE8Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD2(TestKind.DELETE, comparison);
}
@@ -463,7 +463,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE9Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD3(TestKind.DELETE, comparison);
}
@@ -474,7 +474,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE10Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD4(TestKind.DELETE, comparison);
}
@@ -485,7 +485,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getE11Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD5(TestKind.DELETE, comparison);
}
@@ -496,7 +496,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF1Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -507,7 +507,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF2Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -518,7 +518,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF3Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -529,7 +529,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF4Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB4(TestKind.ADD, comparison);
}
@@ -540,7 +540,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF5Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB5(TestKind.ADD, comparison);
}
@@ -551,7 +551,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF6Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testAB6(TestKind.ADD, comparison);
}
@@ -562,7 +562,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF7Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD1(TestKind.ADD, comparison);
}
@@ -573,7 +573,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF8Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD2(TestKind.ADD, comparison);
}
@@ -584,7 +584,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF9Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD3(TestKind.ADD, comparison);
}
@@ -595,7 +595,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF10Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD4(TestKind.ADD, comparison);
}
@@ -606,7 +606,7 @@ public class ReqComputingTest {
final Resource ancestor = input.getF11Ancestor();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, ancestor);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
testCD5(TestKind.ADD, comparison);
}
@@ -616,7 +616,7 @@ public class ReqComputingTest {
final Resource right = input.getG1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = EMFCompare.builder().build().compare(scope);
String root = "root";
String node1 = root + ".node1";
String node2 = node1 + ".node2";
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
index fd9146b6f..5ccaea7cf 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
@@ -8,30 +8,32 @@ import java.util.List;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.extension.EMFCompareExtensionRegistry;
import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
import org.eclipse.emf.compare.uml2.diff.UMLDiffExtensionPostProcessor;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.junit.After;
import org.junit.Before;
@SuppressWarnings("nls")
public abstract class AbstractTest {
+ private EMFCompare emfCompare;
+
@Before
public void before() {
- EMFCompareExtensionRegistry.addPostProcessor(new PostProcessorDescriptor(
- "http://www.eclipse.org/uml2/4.0.0/UML", null,
+ PostProcessorRegistry registry = new PostProcessorRegistry();
+ registry.addPostProcessor(new PostProcessorDescriptor("http://www.eclipse.org/uml2/4.0.0/UML", null,
"org.eclipse.emf.compare.uml2.diff.UMLDiffExtensionPostProcessor",
new UMLDiffExtensionPostProcessor()));
+ emfCompare = EMFCompare.builder().setPostProcessorRegistry(registry).build();
}
- @After
- public void after() {
- EMFCompareExtensionRegistry.clearRegistry();
+ protected EMFCompare getCompare() {
+ return emfCompare;
}
protected enum TestKind {
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation2Test.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation2Test.java
index 02603a2bf..57413cea3 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation2Test.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation2Test.java
@@ -43,7 +43,7 @@ public class AddAssociation2Test extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -53,7 +53,7 @@ public class AddAssociation2Test extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -63,7 +63,7 @@ public class AddAssociation2Test extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -73,7 +73,7 @@ public class AddAssociation2Test extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation3Test.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation3Test.java
index 21fd58e34..36d908a37 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation3Test.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociation3Test.java
@@ -43,7 +43,7 @@ public class AddAssociation3Test extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -53,7 +53,7 @@ public class AddAssociation3Test extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -63,7 +63,7 @@ public class AddAssociation3Test extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -73,7 +73,7 @@ public class AddAssociation3Test extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociationTest.java
index 79026c4a5..cce80e129 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/AddAssociationTest.java
@@ -43,7 +43,7 @@ public class AddAssociationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -53,7 +53,7 @@ public class AddAssociationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -63,7 +63,7 @@ public class AddAssociationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -73,7 +73,7 @@ public class AddAssociationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/ChangeAssociationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/ChangeAssociationTest.java
index 8820477d8..e5c44ec67 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/ChangeAssociationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/association/ChangeAssociationTest.java
@@ -41,7 +41,7 @@ public class ChangeAssociationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class ChangeAssociationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class ChangeAssociationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class ChangeAssociationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
index 89db75a3e..ed2b5696b 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
@@ -41,7 +41,7 @@ public class AddAbstractionTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddAbstractionTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddAbstractionTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddAbstractionTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
index 596ea821c..dd8d99d14 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
@@ -40,7 +40,7 @@ public class AddDependencyTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -50,7 +50,7 @@ public class AddDependencyTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -60,7 +60,7 @@ public class AddDependencyTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -70,7 +70,7 @@ public class AddDependencyTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
index 88674c31f..149c9bdd8 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
@@ -39,7 +39,7 @@ public class AddInterfaceRealizationTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -49,7 +49,7 @@ public class AddInterfaceRealizationTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -59,7 +59,7 @@ public class AddInterfaceRealizationTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -69,7 +69,7 @@ public class AddInterfaceRealizationTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
index 687e920bd..6d30a4f8d 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
@@ -41,7 +41,7 @@ public class AddRealizationTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddRealizationTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddRealizationTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddRealizationTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
index 367c0c1cd..9eeb2067f 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
@@ -41,7 +41,7 @@ public class AddSubstitutionTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddSubstitutionTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddSubstitutionTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddSubstitutionTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
index b7c2bfc7f..1b0ece763 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
@@ -41,7 +41,7 @@ public class AddUsageTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddUsageTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddUsageTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddUsageTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
index 6db0538e2..22912d37b 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
@@ -38,7 +38,7 @@ public class ChangeDependencyTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -48,7 +48,7 @@ public class ChangeDependencyTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -58,7 +58,7 @@ public class ChangeDependencyTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -68,7 +68,7 @@ public class ChangeDependencyTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
index baa2aa6ea..a67bf2cad 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
@@ -39,7 +39,7 @@ public class ChangeUsageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -49,7 +49,7 @@ public class ChangeUsageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -59,7 +59,7 @@ public class ChangeUsageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -69,7 +69,7 @@ public class ChangeUsageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddActionExecutionSpecificationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddActionExecutionSpecificationTest.java
index ca0656b3b..f83dd68c1 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddActionExecutionSpecificationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddActionExecutionSpecificationTest.java
@@ -41,7 +41,7 @@ public class AddActionExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddActionExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddActionExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddActionExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddBehaviorExecutionSpecificationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddBehaviorExecutionSpecificationTest.java
index 55937d2ff..b5ff2d3c8 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddBehaviorExecutionSpecificationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/executionSpecification/AddBehaviorExecutionSpecificationTest.java
@@ -41,7 +41,7 @@ public class AddBehaviorExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddBehaviorExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddBehaviorExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddBehaviorExecutionSpecificationTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/extend/AddExtendTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/extend/AddExtendTest.java
index fe57a1e2e..70c6e4b01 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/extend/AddExtendTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/extend/AddExtendTest.java
@@ -41,7 +41,7 @@ public class AddExtendTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -51,7 +51,7 @@ public class AddExtendTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -61,7 +61,7 @@ public class AddExtendTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -71,7 +71,7 @@ public class AddExtendTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/generalizationSet/AddGeneralizationSetTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/generalizationSet/AddGeneralizationSetTest.java
index c5896ce73..b803fe52e 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/generalizationSet/AddGeneralizationSetTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/generalizationSet/AddGeneralizationSetTest.java
@@ -42,7 +42,7 @@ public class AddGeneralizationSetTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -52,7 +52,7 @@ public class AddGeneralizationSetTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -62,7 +62,7 @@ public class AddGeneralizationSetTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -72,7 +72,7 @@ public class AddGeneralizationSetTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
index 35eb2c292..0b8a8a458 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
@@ -39,7 +39,7 @@ public class AddIncludeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -49,7 +49,7 @@ public class AddIncludeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -59,7 +59,7 @@ public class AddIncludeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -69,7 +69,7 @@ public class AddIncludeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/message/AddMessageTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/message/AddMessageTest.java
index 139dbe598..179efad0d 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/message/AddMessageTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/message/AddMessageTest.java
@@ -45,7 +45,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -55,7 +55,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -65,7 +65,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -75,7 +75,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -85,7 +85,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -95,7 +95,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -105,7 +105,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -115,7 +115,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -125,7 +125,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -135,7 +135,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -145,7 +145,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -155,7 +155,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -165,7 +165,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -175,7 +175,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -185,7 +185,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -195,7 +195,7 @@ public class AddMessageTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
index c8d9d7d08..a52492f3f 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/profiles/ProfileTest.java
@@ -52,7 +52,7 @@ public class ProfileTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -62,7 +62,7 @@ public class ProfileTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -72,7 +72,7 @@ public class ProfileTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -82,7 +82,7 @@ public class ProfileTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/StereotypeTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/StereotypeTest.java
index 8be9550a1..78e9393cb 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/StereotypeTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/StereotypeTest.java
@@ -59,7 +59,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -69,7 +69,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -79,7 +79,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -89,7 +89,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -99,7 +99,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -109,7 +109,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -119,7 +119,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.ADD, comparison);
}
@@ -129,7 +129,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA2Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB2(TestKind.DELETE, comparison);
}
@@ -139,7 +139,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -149,7 +149,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -159,7 +159,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.ADD, comparison);
}
@@ -169,7 +169,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA3Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB3(TestKind.DELETE, comparison);
}
@@ -179,7 +179,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB4(TestKind.ADD, comparison);
}
@@ -189,7 +189,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB4(TestKind.DELETE, comparison);
}
@@ -199,7 +199,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB4(TestKind.ADD, comparison);
}
@@ -209,7 +209,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA4Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB4(TestKind.DELETE, comparison);
}
@@ -219,7 +219,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB5(TestKind.ADD, comparison);
}
@@ -229,7 +229,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB5(TestKind.DELETE, comparison);
}
@@ -239,7 +239,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB5(TestKind.ADD, comparison);
}
@@ -249,7 +249,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA5Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB5(TestKind.DELETE, comparison);
}
@@ -259,7 +259,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB6(TestKind.ADD, comparison);
}
@@ -269,7 +269,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB6(TestKind.DELETE, comparison);
}
@@ -279,7 +279,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB6(TestKind.ADD, comparison);
}
@@ -289,7 +289,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA6Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB6(TestKind.DELETE, comparison);
}
@@ -299,7 +299,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB7(TestKind.ADD, comparison);
}
@@ -309,7 +309,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB7(TestKind.DELETE, comparison);
}
@@ -319,7 +319,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB7(TestKind.ADD, comparison);
}
@@ -329,7 +329,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA7Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB7(TestKind.DELETE, comparison);
}
@@ -339,7 +339,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB8(TestKind.ADD, comparison);
}
@@ -349,7 +349,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB8(TestKind.DELETE, comparison);
}
@@ -359,7 +359,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB8(TestKind.ADD, comparison);
}
@@ -369,7 +369,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA8Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB8(TestKind.DELETE, comparison);
}
@@ -379,7 +379,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB9(TestKind.ADD, comparison);
}
@@ -389,7 +389,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB9(TestKind.DELETE, comparison);
}
@@ -399,7 +399,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB9(TestKind.ADD, comparison);
}
@@ -409,7 +409,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA9Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB9(TestKind.DELETE, comparison);
}
@@ -419,7 +419,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB10(TestKind.ADD, comparison);
}
@@ -429,7 +429,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB10(TestKind.DELETE, comparison);
}
@@ -439,7 +439,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB10(TestKind.ADD, comparison);
}
@@ -449,7 +449,7 @@ public class StereotypeTest extends AbstractTest {
final Resource right = input.getA10Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB10(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/timeConstraint/AddTimeConstraintTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/timeConstraint/AddTimeConstraintTest.java
index ae9ed6a0e..09fcc82e6 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/timeConstraint/AddTimeConstraintTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/timeConstraint/AddTimeConstraintTest.java
@@ -43,7 +43,7 @@ public class AddTimeConstraintTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -53,7 +53,7 @@ public class AddTimeConstraintTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
@@ -63,7 +63,7 @@ public class AddTimeConstraintTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, right);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.ADD, comparison);
}
@@ -73,7 +73,7 @@ public class AddTimeConstraintTest extends AbstractTest {
final Resource right = input.getA1Right();
final IComparisonScope scope = EMFCompare.createDefaultScope(left, right, left);
- final Comparison comparison = EMFCompare.newComparator(scope).compare();
+ final Comparison comparison = getCompare().compare(scope);
testAB1(TestKind.DELETE, comparison);
}
diff --git a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
index 39ec829d1..94fc161ab 100644
--- a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
@@ -4,6 +4,8 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.Match;
@@ -23,16 +25,84 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
// TODO Auto-generated constructor stub
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison)
+ * @see #postMatch(Comparison, Monitor)
+ */
+ @Deprecated
public void postMatch(Comparison comparison) {
- // TODO Auto-generated method stub
+ postMatch(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after the match step,
+ * from a <code>comparison</code>.
+ * <p>
+ * This method should be pull-up to the interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison after the match step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void postMatch(Comparison comparison, Monitor monitor) {
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison)
+ * @se {@link #postDiff(Comparison, BasicMonitor)}
+ */
+ @Deprecated
public void postDiff(Comparison comparison) {
+ postDiff(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after the difference
+ * step, from a <code>comparison</code>.
+ * <p>
+ * This method should be pull-up to the interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison after the difference step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void postDiff(Comparison comparison, Monitor monitor) {
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison)
+ * @see #postRequirements(Comparison, Monitor)
+ */
+ @Deprecated
public void postRequirements(Comparison comparison) {
+ postRequirements(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after the requirements
+ * step, from a <code>comparison</code>.
+ * <p>
+ * This method should be pull-up to the interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison after the requirements step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void postRequirements(Comparison comparison, Monitor monitor) {
final Map<Class<? extends Diff>, IDiffExtensionFactory> mapUml2ExtensionFactories = DiffExtensionFactoryRegistry
.createExtensionFactories();
uml2ExtensionFactories = new HashSet<IDiffExtensionFactory>(mapUml2ExtensionFactories.values());
@@ -54,13 +124,57 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
}
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison)
+ * @see #postEquivalences(Comparison, Monitor)
+ */
+ @Deprecated
public void postEquivalences(Comparison comparison) {
- // TODO Auto-generated method stub
+ postEquivalences(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after the equivalences
+ * step, from a <code>comparison</code>.
+ * <p>
+ * This method should be pull-up to the interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison after the equivalences step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison)
+ * @see #postConflicts(Comparison, Monitor)
+ */
+ @Deprecated
public void postConflicts(Comparison comparison) {
- // TODO Auto-generated method stub
+ postConflicts(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after the conflicts step,
+ * from a <code>comparison</code>.
+ * <p>
+ * This method should be pull-up to the interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison after the conflicts step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void postConflicts(Comparison comparison, Monitor monitor) {
}
diff --git a/plugins/org.eclipse.emf.compare/model/compare.ecore b/plugins/org.eclipse.emf.compare/model/compare.ecore
index 353d70b96..a5af333a3 100644
--- a/plugins/org.eclipse.emf.compare/model/compare.ecore
+++ b/plugins/org.eclipse.emf.compare/model/compare.ecore
@@ -30,7 +30,7 @@
</eAnnotations>
</eParameters>
</eOperations>
- <eOperations name="getConfiguration" eType="#//CompareConfiguration"/>
+ <eOperations name="getEqualityHelper" eType="#//IEqualityHelper"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="matchedResources" upperBound="-1"
eType="#//MatchResource" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
@@ -386,5 +386,6 @@
<eClassifiers xsi:type="ecore:EDataType" name="EIterable" instanceClassName="java.lang.Iterable">
<eTypeParameters name="T"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="CompareConfiguration" instanceClassName="org.eclipse.emf.compare.EMFCompareConfiguration"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="IEqualityHelper" instanceClassName="org.eclipse.emf.compare.utils.IEqualityHelper"
+ serializable="false"/>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java
index 7fa0f2e9b..eb336b2ce 100644
--- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java
+++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java
@@ -870,14 +870,14 @@ public interface ComparePackage extends EPackage {
int EITERABLE = 13;
/**
- * The meta object id for the '<em>Configuration</em>' data type.
+ * The meta object id for the '<em>IEquality Helper</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.EMFCompareConfiguration
- * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getCompareConfiguration()
+ * @see org.eclipse.emf.compare.utils.IEqualityHelper
+ * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper()
* @generated
*/
- int COMPARE_CONFIGURATION = 14;
+ int IEQUALITY_HELPER = 14;
/**
* Returns the meta object for class '{@link org.eclipse.emf.compare.Comparison <em>Comparison</em>}'.
@@ -1395,15 +1395,15 @@ public interface ComparePackage extends EPackage {
EDataType getEIterable();
/**
- * Returns the meta object for data type '{@link org.eclipse.emf.compare.EMFCompareConfiguration <em>Configuration</em>}'.
+ * Returns the meta object for data type '{@link org.eclipse.emf.compare.utils.IEqualityHelper <em>IEquality Helper</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for data type '<em>Configuration</em>'.
- * @see org.eclipse.emf.compare.EMFCompareConfiguration
- * @model instanceClass="org.eclipse.emf.compare.EMFCompareConfiguration"
+ * @return the meta object for data type '<em>IEquality Helper</em>'.
+ * @see org.eclipse.emf.compare.utils.IEqualityHelper
+ * @model instanceClass="org.eclipse.emf.compare.utils.IEqualityHelper" serializeable="false"
* @generated
*/
- EDataType getCompareConfiguration();
+ EDataType getIEqualityHelper();
/**
* Returns the factory that creates the instances of the model.
@@ -1843,14 +1843,14 @@ public interface ComparePackage extends EPackage {
EDataType EITERABLE = eINSTANCE.getEIterable();
/**
- * The meta object literal for the '<em>Configuration</em>' data type.
+ * The meta object literal for the '<em>IEquality Helper</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.EMFCompareConfiguration
- * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getCompareConfiguration()
+ * @see org.eclipse.emf.compare.utils.IEqualityHelper
+ * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper()
* @generated
*/
- EDataType COMPARE_CONFIGURATION = eINSTANCE.getCompareConfiguration();
+ EDataType IEQUALITY_HELPER = eINSTANCE.getIEqualityHelper();
}
diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java
index ba65052fb..3f49087c1 100644
--- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java
+++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.compare;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.ecore.EObject;
/**
@@ -109,14 +111,6 @@ public interface Comparison extends EObject {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @model kind="operation" dataType="org.eclipse.emf.compare.CompareConfiguration"
- * @generated
- */
- EMFCompareConfiguration getConfiguration();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Returns all differences contained by this Comparison and its children.
* <!-- end-model-doc -->
@@ -158,6 +152,14 @@ public interface Comparison extends EObject {
Match getMatch(EObject element);
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model kind="operation" dataType="org.eclipse.emf.compare.IEqualityHelper"
+ * @generated
+ */
+ IEqualityHelper getEqualityHelper();
+
+ /**
* Returns the value of the '<em><b>Three Way</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/CompareFactoryImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/CompareFactoryImpl.java
index ca06d21b0..f93b8d6d5 100644
--- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/CompareFactoryImpl.java
+++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/CompareFactoryImpl.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.compare.impl;
import java.lang.Iterable;
import org.eclipse.emf.compare.*;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+import org.eclipse.emf.compare.utils.EqualityHelper;
import org.eclipse.emf.compare.internal.spec.AttributeChangeSpec;
import org.eclipse.emf.compare.internal.spec.ComparisonSpec;
import org.eclipse.emf.compare.internal.spec.MatchSpec;
@@ -112,8 +114,6 @@ public class CompareFactoryImpl extends EFactoryImpl implements CompareFactory {
return createConflictKindFromString(eDataType, initialValue);
case ComparePackage.EITERABLE:
return createEIterableFromString(eDataType, initialValue);
- case ComparePackage.COMPARE_CONFIGURATION:
- return createCompareConfigurationFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException(
"The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -137,8 +137,6 @@ public class CompareFactoryImpl extends EFactoryImpl implements CompareFactory {
return convertConflictKindToString(eDataType, instanceValue);
case ComparePackage.EITERABLE:
return convertEIterableToString(eDataType, instanceValue);
- case ComparePackage.COMPARE_CONFIGURATION:
- return convertCompareConfigurationToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException(
"The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -324,25 +322,6 @@ public class CompareFactoryImpl extends EFactoryImpl implements CompareFactory {
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EMFCompareConfiguration createCompareConfigurationFromString(EDataType eDataType,
- String initialValue) {
- return (EMFCompareConfiguration)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCompareConfigurationToString(EDataType eDataType, Object instanceValue) {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java
index 5de461735..3bc52c288 100644
--- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java
+++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java
@@ -28,6 +28,8 @@ import org.eclipse.emf.compare.MatchResource;
import org.eclipse.emf.compare.ReferenceChange;
import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+import org.eclipse.emf.compare.utils.EqualityHelper;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
@@ -157,7 +159,7 @@ public class ComparePackageImpl extends EPackageImpl implements ComparePackage {
* <!-- end-user-doc -->
* @generated
*/
- private EDataType compareConfigurationEDataType = null;
+ private EDataType iEqualityHelperEDataType = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
@@ -662,8 +664,8 @@ public class ComparePackageImpl extends EPackageImpl implements ComparePackage {
* <!-- end-user-doc -->
* @generated
*/
- public EDataType getCompareConfiguration() {
- return compareConfigurationEDataType;
+ public EDataType getIEqualityHelper() {
+ return iEqualityHelperEDataType;
}
/**
@@ -755,7 +757,7 @@ public class ComparePackageImpl extends EPackageImpl implements ComparePackage {
// Create data types
eIterableEDataType = createEDataType(EITERABLE);
- compareConfigurationEDataType = createEDataType(COMPARE_CONFIGURATION);
+ iEqualityHelperEDataType = createEDataType(IEQUALITY_HELPER);
}
/**
@@ -833,8 +835,8 @@ public class ComparePackageImpl extends EPackageImpl implements ComparePackage {
op = addEOperation(comparisonEClass, this.getMatch(), "getMatch", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
addEParameter(op, theEcorePackage.getEObject(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
- addEOperation(comparisonEClass, this.getCompareConfiguration(),
- "getConfiguration", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
+ addEOperation(comparisonEClass, this.getIEqualityHelper(),
+ "getEqualityHelper", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
initEClass(matchResourceEClass, MatchResource.class,
"MatchResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -1039,8 +1041,8 @@ public class ComparePackageImpl extends EPackageImpl implements ComparePackage {
// Initialize data types
initEDataType(eIterableEDataType, Iterable.class,
"EIterable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEDataType(compareConfigurationEDataType, EMFCompareConfiguration.class,
- "CompareConfiguration", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEDataType(iEqualityHelperEDataType, IEqualityHelper.class,
+ "IEqualityHelper", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
// Create resource
createResource(eNS_URI);
diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java
index 36f3b1004..a56cc5798 100644
--- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java
+++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java
@@ -23,6 +23,8 @@ import org.eclipse.emf.compare.EMFCompareConfiguration;
import org.eclipse.emf.compare.Equivalence;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
@@ -37,29 +39,27 @@ import org.eclipse.emf.ecore.util.InternalEList;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatchedResources <em>Matched Resources</em>}</li>
- * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatches <em>Matches</em>}</li>
- * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getConflicts <em>Conflicts</em>}</li>
- * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getEquivalences <em>Equivalences</em>}</li>
- * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#isThreeWay <em>Three Way</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatchedResources <em>Matched Resources</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatches <em>Matches</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getConflicts <em>Conflicts</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#getEquivalences <em>Equivalences</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.impl.ComparisonImpl#isThreeWay <em>Three Way</em>}</li>
* </ul>
* </p>
- *
+ *
* @generated
*/
@SuppressWarnings("boxing")
public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
/**
- * The cached value of the '{@link #getMatchedResources() <em>Matched Resources</em>}' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ * The cached value of the '{@link #getMatchedResources() <em>Matched Resources</em>}' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getMatchedResources()
* @generated
* @ordered
@@ -89,7 +89,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* The cached value of the '{@link #getEquivalences() <em>Equivalences</em>}' containment reference list.
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @see #getEquivalences()
* @generated
* @ordered
@@ -97,9 +96,9 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
protected EList<Equivalence> equivalences;
/**
- * The default value of the '{@link #isThreeWay() <em>Three Way</em>}' attribute. <!-- begin-user-doc -->
+ * The default value of the '{@link #isThreeWay() <em>Three Way</em>}' attribute.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #isThreeWay()
* @generated
* @ordered
@@ -107,9 +106,9 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
protected static final boolean THREE_WAY_EDEFAULT = false;
/**
- * The cached value of the '{@link #isThreeWay() <em>Three Way</em>}' attribute. <!-- begin-user-doc -->
+ * The cached value of the '{@link #isThreeWay() <em>Three Way</em>}' attribute.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #isThreeWay()
* @generated
* @ordered
@@ -118,7 +117,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
protected ComparisonImpl() {
@@ -127,7 +125,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -137,7 +134,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public EList<MatchResource> getMatchedResources() {
@@ -150,7 +146,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public EList<Match> getMatches() {
@@ -163,7 +158,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public EList<Conflict> getConflicts() {
@@ -176,7 +170,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public EList<Equivalence> getEquivalences() {
@@ -189,10 +182,9 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
- public EMFCompareConfiguration getConfiguration() {
+ public EList<Diff> getDifferences() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
@@ -200,10 +192,9 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
- public EList<Diff> getDifferences() {
+ public EList<Diff> getDifferences(EObject element) {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
@@ -211,21 +202,20 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
- public EList<Diff> getDifferences(EObject element) {
+ public Match getMatch(EObject element) {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
- public Match getMatch(EObject element) {
+ public IEqualityHelper getEqualityHelper() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
@@ -233,7 +223,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public boolean isThreeWay() {
@@ -242,21 +231,18 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
public void setThreeWay(boolean newThreeWay) {
boolean oldThreeWay = threeWay;
threeWay = newThreeWay;
- if (eNotificationRequired()) {
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.COMPARISON__THREE_WAY,
oldThreeWay, threeWay));
- }
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -276,7 +262,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -298,7 +283,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@SuppressWarnings("unchecked")
@@ -330,7 +314,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -357,7 +340,6 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -379,14 +361,12 @@ public class ComparisonImpl extends MinimalEObjectImpl implements Comparison {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) {
+ if (eIsProxy())
return super.toString();
- }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (threeWay: "); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
index 8b10d8195..3307b0b25 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
@@ -11,8 +11,7 @@
package org.eclipse.emf.compare;
import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Iterator;
+import static com.google.common.base.Preconditions.checkState;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicMonitor;
@@ -22,18 +21,12 @@ import org.eclipse.emf.compare.conflict.IConflictDetector;
import org.eclipse.emf.compare.diff.DefaultDiffEngine;
import org.eclipse.emf.compare.diff.DiffBuilder;
import org.eclipse.emf.compare.diff.IDiffEngine;
-import org.eclipse.emf.compare.diff.IDiffProcessor;
import org.eclipse.emf.compare.equi.DefaultEquiEngine;
import org.eclipse.emf.compare.equi.IEquiEngine;
-import org.eclipse.emf.compare.extension.EMFCompareExtensionRegistry;
import org.eclipse.emf.compare.extension.IPostProcessor;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IMatchEngine;
-import org.eclipse.emf.compare.match.eobject.EditionDistance;
-import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
-import org.eclipse.emf.compare.match.eobject.IdentifierEObjectMatcher;
-import org.eclipse.emf.compare.match.eobject.ProximityEObjectMatcher;
import org.eclipse.emf.compare.req.DefaultReqEngine;
import org.eclipse.emf.compare.req.IReqEngine;
import org.eclipse.emf.compare.scope.DefaultComparisonScope;
@@ -55,45 +48,31 @@ import org.eclipse.emf.compare.utils.UseIdentifiers;
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
-public final class EMFCompare {
- /**
- * The matcher that should be used by the {@link org.eclipse.emf.compare.match.IMatchEngine match engine}
- * to pair elements together.
- * <p>
- * Note that setting this overrides any configuration made through {@link #useIds}.
- * </p>
- */
- private IEObjectMatcher eObjectMatcher;
+public class EMFCompare {
- /** This can be overriden to tweak the way EMF Compare sees two Objects as "equal". */
- private EqualityHelper equalityHelper;
+ private final IMatchEngine matchEngine;
- /** The progress monitor that should be used to display information about the comparison to the user. */
- private Monitor progressMonitor;
+ private final IDiffEngine diffEngine;
- /**
- * Defines the scope of the comparison. Objects not present in this scope will be ignored by the whole
- * process.
- */
- private final IComparisonScope scope;
+ private final IReqEngine reqEngine;
- /**
- * This can be used to configure the ID handling of EMF Compare.
- * <p>
- * Do note that this configuration will be ignored if {@link #eObjectMatcher} is set.
- * </p>
- */
- private UseIdentifiers useIDs = UseIdentifiers.WHEN_AVAILABLE;
+ private final IEquiEngine equiEngine;
+
+ private final IConflictDetector conflictDetector;
+
+ private final PostProcessorRegistry postProcessorRegistry;
/**
- * Instantiation is only permitted through {@link #newComparator(IComparisonScope)}.
- *
- * @param scope
- * The comparison scope to be used by EMF Compare.
*/
- private EMFCompare(IComparisonScope scope) {
- checkNotNull(scope);
- this.scope = scope;
+ protected EMFCompare(IMatchEngine matchEngine, IDiffEngine diffEngine, IReqEngine reqEngine,
+ IEquiEngine equiEngine, IConflictDetector conflictDetector,
+ PostProcessorRegistry postProcessorRegistry) {
+ this.matchEngine = checkNotNull(matchEngine);
+ this.diffEngine = checkNotNull(diffEngine);
+ this.reqEngine = checkNotNull(reqEngine);
+ this.equiEngine = checkNotNull(equiEngine);
+ this.conflictDetector = conflictDetector;
+ this.postProcessorRegistry = checkNotNull(postProcessorRegistry);
}
/**
@@ -105,10 +84,10 @@ public final class EMFCompare {
*
* @return The default EMF Compare Configuration.
*/
+ @Deprecated
public static EMFCompareConfiguration createDefaultConfiguration() {
final Monitor monitor = new BasicMonitor();
- final EqualityHelper equalityHelper = new EqualityHelper();
- return new EMFCompareConfiguration(monitor, equalityHelper);
+ return new EMFCompareConfiguration(monitor, null);
}
/**
@@ -150,241 +129,132 @@ public final class EMFCompare {
return new DefaultComparisonScope(left, right, origin);
}
- /**
- * Returns a new comparator to allow customization of the comparison process.
- *
- * @param scope
- * Defines the scope of the comparison. Any object <b>not</b> present in this scope will be
- * ignored by the whole comparison process.
- * @return A comparator that can be used as-is or further customized to compare the given {@code scope}.
- */
- public static EMFCompare newComparator(IComparisonScope scope) {
- return new EMFCompare(scope);
+ public Comparison compare(IComparisonScope scope) {
+ return compare(scope, new BasicMonitor());
}
/**
- * Launches the comparison with the given configuration.
+ * Launches the comparison with the current configuration.
*
- * @param scope
- * The scope on which a comparison is to be performed.
- * @param configuration
- * The configuration object from which compare engines will be configured.
- * @param matcher
- * The EObject matcher that will be in charge of pairing EObjects together for this comparison.
* @return The result of this comparison.
*/
- private static Comparison compare(IComparisonScope scope, EMFCompareConfiguration configuration,
- IEObjectMatcher matcher) {
- // TODO allow extension of the default match engine
- final IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
- Comparison comparison = matchEngine.match(scope, configuration);
+ public Comparison compare(IComparisonScope scope, final Monitor monitor) {
+ checkNotNull(scope);
+ checkNotNull(monitor);
+ if (scope.getOrigin() != null) {
+ checkState(conflictDetector != null,
+ "ConflictDetector must not be null to compute a 3-way comparison");
+ }
+
+ final Comparison comparison = matchEngine.match(scope, null/* monitor */);
+
+ IPostProcessor postProcessor = postProcessorRegistry.getPostProcessor(scope);
- IPostProcessor postProcessor = getPostProcessor(scope);
if (postProcessor != null) {
- postProcessor.postMatch(comparison);
+ postProcessor.postMatch(comparison/* , monitor */);
}
- final IDiffProcessor diffBuilder = new DiffBuilder();
-
- // TODO allow extension of the default diff engine
- final IDiffEngine diffEngine = new DefaultDiffEngine(diffBuilder);
- diffEngine.diff(comparison);
+ diffEngine.diff(comparison/* , monitor */);
if (postProcessor != null) {
- postProcessor.postDiff(comparison);
+ postProcessor.postDiff(comparison/* , monitor */);
}
- final IReqEngine reqEngine = new DefaultReqEngine();
- reqEngine.computeRequirements(comparison);
+ reqEngine.computeRequirements(comparison/* , monitor */);
if (postProcessor != null) {
- postProcessor.postRequirements(comparison);
+ postProcessor.postRequirements(comparison/* , monitor */);
}
- final IEquiEngine equiEngine = new DefaultEquiEngine();
- equiEngine.computeEquivalences(comparison);
+ equiEngine.computeEquivalences(comparison/* , monitor */);
if (postProcessor != null) {
- postProcessor.postEquivalences(comparison);
+ postProcessor.postEquivalences(comparison/* , monitor */);
}
if (comparison.isThreeWay()) {
- final IConflictDetector conflictDetector = new DefaultConflictDetector();
- conflictDetector.detect(comparison);
+ conflictDetector.detect(comparison/* , monitor */);
if (postProcessor != null) {
- postProcessor.postConflicts(comparison);
+ postProcessor.postConflicts(comparison/* , monitor */);
}
}
return comparison;
}
- /**
- * Retrieve the post processor from a given <code>scope</code>. The scope provides the set of scanned
- * namespaces and resource uris. If one of them matches with the regex of a
- * "org.eclipse.emf.compare.postProcessor" extension point, then the associated post processor is
- * returned.
- *
- * @param scope
- * The given scope.
- * @return The associated post processor if any.
- */
- private static IPostProcessor getPostProcessor(IComparisonScope scope) {
- IPostProcessor postProcessor = null;
- final Iterator<PostProcessorDescriptor> postProcessorIterator = EMFCompareExtensionRegistry
- .getRegisteredPostProcessors().iterator();
- while (postProcessorIterator.hasNext() && postProcessor == null) {
- final PostProcessorDescriptor descriptor = postProcessorIterator.next();
- if (descriptor.getNsURI() != null && descriptor.getNsURI().trim().length() != 0) {
- final Iterator<String> nsUris = scope.getNsURIs().iterator();
- while (nsUris.hasNext() && postProcessor == null) {
- if (nsUris.next().matches(descriptor.getNsURI())) {
- postProcessor = descriptor.getPostProcessor();
- }
- }
- }
- // Should probably use two loops here to prioritize NsURI matching
- if (descriptor.getResourceURI() != null && descriptor.getResourceURI().trim().length() != 0) {
- final Iterator<String> resourceUris = scope.getResourceURIs().iterator();
- while (resourceUris.hasNext() && postProcessor == null) {
- if (resourceUris.next().matches(descriptor.getResourceURI())) {
- postProcessor = descriptor.getPostProcessor();
- }
- }
- }
- }
- return postProcessor;
+ public static Builder builder() {
+ return new Builder();
}
- /**
- * Launches the comparison with the current configuration.
- *
- * @return The result of this comparison.
- */
- public Comparison compare() {
- final Monitor monitor;
- if (progressMonitor != null) {
- monitor = progressMonitor;
- } else {
- monitor = new BasicMonitor();
- }
+ public static class Builder {
+ protected IMatchEngine matchEngine;
- final EqualityHelper helper;
- if (equalityHelper != null) {
- helper = equalityHelper;
- } else {
- helper = new EqualityHelper();
- }
- final EMFCompareConfiguration configuration = new EMFCompareConfiguration(monitor, helper);
+ protected IReqEngine reqEngine;
- final IEObjectMatcher matcher = createMatcher(helper);
+ protected IDiffEngine diffEngine;
- return compare(scope, configuration, matcher);
- }
+ protected IEquiEngine equiEngine;
- /**
- * Tells EMF Compare whether it should use identifiers when matching EObjects.
- * <p>
- * <b>Note</b> that this setting will be ignored if a custom matcher
- * {@link #setEObjectMatcher(IEObjectMatcher) has been set}.
- * </p>
- *
- * @param matchByID
- * Whether we should use identifiers, and how.
- * @return This same comparator to allow chained calls.
- */
- public EMFCompare matchByID(UseIdentifiers matchByID) {
- if (matchByID != null) {
- this.useIDs = matchByID;
+ protected IConflictDetector conflictDetector;
+
+ protected PostProcessorRegistry registry;
+
+ protected Builder() {
}
- return this;
- }
- /**
- * This can be used to provide a custom EObject matcher to EMF Compare whenever the default configurations
- * (see {@link #matchByID(UseIdentifiers)}) are not sufficient.
- * <p>
- * <b>Note</b> that using this will supersede any setting made through {@link #matchByID(UseIdentifiers)}.
- * </p>
- *
- * @param matcher
- * The matcher EMF Compare should use to pair EObjects together.
- * @return This same comparator to allow chained calls.
- */
- public EMFCompare setEObjectMatcher(IEObjectMatcher matcher) {
- if (matcher != null) {
- this.eObjectMatcher = matcher;
+ public Builder setMatchEngine(IMatchEngine matchEngine) {
+ this.matchEngine = checkNotNull(matchEngine);
+ return this;
}
- return this;
- }
- /**
- * If you need to tweak the function EMF Compare uses to determine whether two Objects are "equal", this
- * can be used to provide it a new {@link EqualityHelper}.
- * <p>
- * Note that the equality helper will be used throughout the whole comparison process, from matching to
- * conflict detection.
- * </p>
- *
- * @param helper
- * The equality helper that should be used by the comparison process.
- * @return This same comparator to allow chained calls.
- * @see EqualityHelper
- */
- public EMFCompare setEqualityHelper(EqualityHelper helper) {
- if (helper != null) {
- this.equalityHelper = helper;
+ public Builder setDiffEngine(IDiffEngine diffEngine) {
+ this.diffEngine = checkNotNull(diffEngine);
+ return this;
}
- return this;
- }
- /**
- * Changes the progress monitor that should be used by compare to display progress information about the
- * comparison to the user.
- *
- * @param monitor
- * The monitor that should be used
- * @return This same builder to allow chained calls.
- */
- public EMFCompare setMonitor(Monitor monitor) {
- if (monitor != null) {
- this.progressMonitor = monitor;
+ public Builder setRequirementEngine(IReqEngine reqEngine) {
+ this.reqEngine = checkNotNull(reqEngine);
+ return this;
}
- return this;
- }
- /**
- * Creates the {@link IEObjectMatcher EObject matcher} that should be used by the comparison engine
- * according to the values of {@link #eObjectMatcher} or {@link #useIDs}.
- *
- * @param helper
- * The equality helper that should be used by the matcher if using proximity algorithms.
- * @return The newly created matcher.
- */
- private IEObjectMatcher createMatcher(EqualityHelper helper) {
- if (eObjectMatcher != null) {
- return eObjectMatcher;
+ public Builder setEquivalenceEngine(IEquiEngine equiEngine) {
+ this.equiEngine = checkNotNull(equiEngine);
+ return this;
+ }
+
+ public Builder setConflictDetector(IConflictDetector conflictDetector) {
+ this.conflictDetector = checkNotNull(conflictDetector);
+ return this;
}
- final IEObjectMatcher matcher;
- switch (useIDs) {
- case NEVER:
- matcher = ProximityEObjectMatcher.builder(EditionDistance.builder(helper).build()).build();
- break;
- case ONLY:
- matcher = new IdentifierEObjectMatcher();
- break;
- case WHEN_AVAILABLE:
- // fall through to default
- default:
- // Use an ID matcher, delegating to proximity when no ID is available
- final IEObjectMatcher contentMatcher = ProximityEObjectMatcher.builder(
- EditionDistance.builder(helper).build()).build();
- matcher = new IdentifierEObjectMatcher(contentMatcher);
- break;
+ public Builder setPostProcessorRegistry(PostProcessorRegistry registry) {
+ this.registry = checkNotNull(registry);
+ return this;
+ }
+ public EMFCompare build() {
+ if (matchEngine == null) {
+ matchEngine = DefaultMatchEngine.create(UseIdentifiers.WHEN_AVAILABLE);
+ }
+ if (diffEngine == null) {
+ diffEngine = new DefaultDiffEngine(new DiffBuilder());
+ }
+ if (reqEngine == null) {
+ reqEngine = new DefaultReqEngine();
+ }
+ if (equiEngine == null) {
+ equiEngine = new DefaultEquiEngine();
+ }
+ if (registry == null) {
+ registry = new PostProcessorRegistry();
+ }
+ if (conflictDetector == null) {
+ conflictDetector = new DefaultConflictDetector();
+ }
+ return new EMFCompare(this.matchEngine, this.diffEngine, this.reqEngine, this.equiEngine,
+ this.conflictDetector, this.registry);
}
- return matcher;
}
+
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareConfiguration.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareConfiguration.java
index 33d832440..35c123a86 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareConfiguration.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareConfiguration.java
@@ -10,9 +10,11 @@
*******************************************************************************/
package org.eclipse.emf.compare;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.Monitor;
-import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
/**
* Object used to configure the engines of EMFCompare (match, diff, requirement, equivalence, merge).
@@ -27,13 +29,11 @@ import org.eclipse.emf.compare.utils.EqualityHelper;
*
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
+@Deprecated
public class EMFCompareConfiguration extends AdapterImpl {
/** The monitor to report progress during the math/diff operation. */
private final Monitor fMonitor;
- /** The equality helper used to compare object during match & merge process. */
- private final EqualityHelper fEqualityHelper;
-
/**
* Constructs a configuration to be used by EMF Compare.
*
@@ -42,9 +42,9 @@ public class EMFCompareConfiguration extends AdapterImpl {
* @param helper
* The equality helper that should ne used by the comparison engine.
*/
- public EMFCompareConfiguration(Monitor monitor, EqualityHelper helper) {
- this.fMonitor = monitor;
- this.fEqualityHelper = helper;
+ @Deprecated
+ public EMFCompareConfiguration(Monitor monitor, IEqualityHelper helper) {
+ this.fMonitor = checkNotNull(monitor);
}
/**
@@ -52,17 +52,20 @@ public class EMFCompareConfiguration extends AdapterImpl {
*
* @return the Monitor (never null).
*/
+ @Deprecated
public Monitor getMonitor() {
return fMonitor;
}
/**
- * Returns the {@link EqualityHelper}.
+ * Returns the {@link IEqualityHelper}.
*
* @return the EqualityHelper (never null).
+ * @see Comparison#getEqualityHelper()
*/
- public EqualityHelper getEqualityHelper() {
- return fEqualityHelper;
+ @Deprecated
+ public IEqualityHelper getEqualityHelper() {
+ return null;
}
/**
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
index de5533468..1644bc069 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
@@ -21,6 +21,8 @@ import com.google.common.collect.Lists;
import java.util.List;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
@@ -31,7 +33,6 @@ import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.utils.EqualityHelper;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -49,18 +50,35 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
public class DefaultConflictDetector implements IConflictDetector {
- /**
- * helper used to check for equality of values or EObjects.
- */
- private EqualityHelper helper;
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.conflict.IConflictDetector#detect(org.eclipse.emf.compare.Comparison)
+ * @see #detect(Comparison, Monitor)
*/
+ @Deprecated
public void detect(Comparison comparison) {
- this.helper = comparison.getConfiguration().getEqualityHelper();
+ detect(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This is the entry point of the conflict detection process.
+ * <p>
+ * It is expected to complete the input <code>comparison</code> by iterating over the
+ * {@link org.eclipse.emf.compare.Diff differences} it contain, filling in all conflicts it can detect
+ * between those Diffs.
+ * </p>
+ * <p>
+ * This method should be pull-up in the interface in next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void detect(Comparison comparison, Monitor monitor) {
final List<Diff> differences = comparison.getDifferences();
final int diffCount = differences.size();
@@ -252,7 +270,7 @@ public class DefaultConflictDetector implements IConflictDetector {
}
if (diff.getMatch() == candidate.getMatch()) {
- if (helper.matchingValues(comparison, changedValue, candidateValue)) {
+ if (comparison.getEqualityHelper().matchingValues(changedValue, candidateValue)) {
// Same value added on both side in the same container
conflictOn(comparison, diff, candidate, ConflictKind.PSEUDO);
} else {
@@ -313,7 +331,7 @@ public class DefaultConflictDetector implements IConflictDetector {
}
if (diff.getMatch() == candidate.getMatch()
- && helper.matchingValues(comparison, changedValue, candidateValue)) {
+ && comparison.getEqualityHelper().matchingValues(changedValue, candidateValue)) {
// Same value moved in both side of the same container
if (matchingIndices(comparison, diff.getMatch(), feature, changedValue, candidateValue)) {
conflictOn(comparison, diff, candidate, ConflictKind.PSEUDO);
@@ -380,7 +398,7 @@ public class DefaultConflictDetector implements IConflictDetector {
movedValue = ((AttributeChange)candidate).getValue();
}
- if (helper.matchingValues(comparison, deletedValue, movedValue)) {
+ if (comparison.getEqualityHelper().matchingValues(deletedValue, movedValue)) {
if (candidate.getKind() == DifferenceKind.MOVE) {
conflictOn(comparison, diff, candidate, ConflictKind.REAL);
} else {
@@ -447,7 +465,8 @@ public class DefaultConflictDetector implements IConflictDetector {
candidateValue = ((AttributeChange)candidate).getValue();
}
// No diff on non unique features : multiple same values can coexist
- if (feature.isUnique() && helper.matchingValues(comparison, addedValue, candidateValue)) {
+ if (feature.isUnique()
+ && comparison.getEqualityHelper().matchingValues(addedValue, candidateValue)) {
// This is a conflict. Is it real?
if (matchingIndices(comparison, diff.getMatch(), feature, addedValue, candidateValue)) {
conflictOn(comparison, diff, candidate, ConflictKind.PSEUDO);
@@ -534,7 +553,7 @@ public class DefaultConflictDetector implements IConflictDetector {
int rightIndex = -1;
for (int i = 0; i < leftValues.size(); i++) {
final Object left = leftValues.get(i);
- if (helper.matchingValues(comparison, left, value1)) {
+ if (comparison.getEqualityHelper().matchingValues(left, value1)) {
break;
} else if (hasDiff(match, feature, left) || hasDeleteDiff(match, feature, left)) {
// Do not increment.
@@ -544,7 +563,7 @@ public class DefaultConflictDetector implements IConflictDetector {
}
for (int i = 0; i < rightValues.size(); i++) {
final Object right = rightValues.get(i);
- if (helper.matchingValues(comparison, right, value2)) {
+ if (comparison.getEqualityHelper().matchingValues(right, value2)) {
break;
} else if (hasDiff(match, feature, right) || hasDeleteDiff(match, feature, right)) {
// Do not increment.
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
index f9d840781..2223c1d33 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
@@ -20,12 +20,14 @@ import com.google.common.collect.Iterables;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.utils.DiffUtil;
-import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
@@ -51,17 +53,6 @@ public class DefaultDiffEngine implements IDiffEngine {
protected static final Object UNMATCHED_VALUE = new Object();
/**
- * helper used to check for equality of values or EObjects.
- */
- protected EqualityHelper helper;
-
- /**
- * The comparison for which we are detecting differences. Should only be accessed through
- * {@link #getComparison()}.
- */
- private Comparison currentComparison;
-
- /**
* The diff processor that will be used by this engine. Should be passed by the constructor and accessed
* by {@link #getDiffProcessor()}.
*/
@@ -69,7 +60,10 @@ public class DefaultDiffEngine implements IDiffEngine {
/**
* Create the diff engine setting up the default behavior.
+ *
+ * @see #DefaultDiffEngine(IDiffProcessor).
*/
+ @Deprecated
public DefaultDiffEngine() {
this(new DiffBuilder());
}
@@ -86,8 +80,8 @@ public class DefaultDiffEngine implements IDiffEngine {
/**
* This predicate can be used to check whether a given element is contained within the given iterable
- * according to the semantics of {@link EqualityHelper#matchingValues(Comparison, Object, Object)} before
- * returning it.
+ * according to the semantics of {@link IEqualityHelper#matchingValues(Object, Object)} before returning
+ * it.
*
* @param comparison
* This will be used in order to retrieve the Match for EObjects when comparing them.
@@ -107,7 +101,7 @@ public class DefaultDiffEngine implements IDiffEngine {
/**
* Checks whether the given {@code iterable} contains the given {@code element} according to the semantics
- * of {@link EqualityHelper#matchingValues(Comparison, Object, Object)}.
+ * of {@link IEqualityHelper#matchingValues(Comparison, Object, Object)}.
*
* @param comparison
* This will be used in order to retrieve the Match for EObjects when comparing them.
@@ -121,7 +115,7 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected <E> boolean contains(Comparison comparison, Iterable<E> iterable, E element) {
for (E candidate : iterable) {
- if (helper.matchingValues(comparison, candidate, element)) {
+ if (comparison.getEqualityHelper().matchingValues(candidate, element)) {
return true;
}
}
@@ -132,14 +126,33 @@ public class DefaultDiffEngine implements IDiffEngine {
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.diff.IDiffEngine#diff(org.eclipse.emf.compare.Comparison)
+ * @see #diff(Comparison, Monitor)
*/
+ @Deprecated
public void diff(Comparison comparison) {
- this.currentComparison = comparison;
- this.helper = comparison.getConfiguration().getEqualityHelper();
+ diff(comparison, new BasicMonitor());
+ }
+ /**
+ * This is the entry point of the differencing process.
+ * <p>
+ * It will complete the input <code>comparison</code> by iterating over the
+ * {@link org.eclipse.emf.compare.Match matches} it contain, filling in the differences it can detect for
+ * each distinct Match.
+ * </p>
+ * <p>
+ * This should be pull-up in interface in the next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation.
+ */
+ public void diff(Comparison comparison, Monitor monitor) {
for (Match rootMatch : comparison.getMatches()) {
- checkResourceAttachment(rootMatch);
- checkForDifferences(rootMatch);
+ checkResourceAttachment(rootMatch, monitor);
+ checkForDifferences(rootMatch, monitor);
}
}
@@ -149,8 +162,10 @@ public class DefaultDiffEngine implements IDiffEngine {
*
* @param match
* The match that is to be checked.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation.
*/
- protected void checkForDifferences(Match match) {
+ protected void checkForDifferences(Match match, Monitor monitor) {
final FeatureFilter featureFilter = createFeatureFilter();
final Iterator<EReference> references = featureFilter.getReferencesToCheck(match);
@@ -168,7 +183,7 @@ public class DefaultDiffEngine implements IDiffEngine {
}
for (Match submatch : match.getSubmatches()) {
- checkForDifferences(submatch);
+ checkForDifferences(submatch, monitor);
}
}
@@ -178,9 +193,12 @@ public class DefaultDiffEngine implements IDiffEngine {
*
* @param match
* The match that is to be checked.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation.
*/
- protected void checkResourceAttachment(Match match) {
+ protected void checkResourceAttachment(Match match, Monitor monitor) {
final Comparison comparison = match.getComparison();
+
if (comparison.getMatchedResources().isEmpty()) {
// This is a comparison of EObjects, do not go up to the resources
return;
@@ -239,22 +257,24 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected void computeContainmentDifferencesThreeWay(Match match, EReference reference,
boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
// We won't use iterables here since we need random access collections for fast LCS.
final List<Object> leftValues = getAsList(match.getLeft(), reference);
final List<Object> rightValues = getAsList(match.getRight(), reference);
final List<Object> originValues = getAsList(match.getOrigin(), reference);
- final List<Object> lcsOriginLeft = DiffUtil.longestCommonSubsequence(getComparison(), originValues,
+ final List<Object> lcsOriginLeft = DiffUtil.longestCommonSubsequence(comparison, originValues,
leftValues);
- final List<Object> lcsOriginRight = DiffUtil.longestCommonSubsequence(getComparison(), originValues,
+ final List<Object> lcsOriginRight = DiffUtil.longestCommonSubsequence(comparison, originValues,
rightValues);
// TODO Can we shortcut in any way?
// Which values have "changed" in any way?
- final Iterable<Object> changedLeft = Iterables.filter(leftValues, not(containedIn(getComparison(),
+ final Iterable<Object> changedLeft = Iterables.filter(leftValues, not(containedIn(comparison,
lcsOriginLeft)));
- final Iterable<Object> changedRight = Iterables.filter(rightValues, not(containedIn(getComparison(),
+ final Iterable<Object> changedRight = Iterables.filter(rightValues, not(containedIn(comparison,
lcsOriginRight)));
// Added or moved in left
@@ -263,9 +283,9 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between origin and left, we thus know it has changed. We also know
* that this is a containment reference.
*/
- final Match candidateMatch = getComparison().getMatch((EObject)diffCandidate);
+ final Match candidateMatch = comparison.getMatch((EObject)diffCandidate);
- if (contains(getComparison(), originValues, diffCandidate)) {
+ if (contains(comparison, originValues, diffCandidate)) {
// This object is contained in both the left and origin lists. It can only have moved
if (checkOrdering) {
featureChange(match, reference, diffCandidate, DifferenceKind.MOVE, DifferenceSource.LEFT);
@@ -288,9 +308,9 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between origin and right, we thus know it has changed. We also
* know that this is a containment reference.
*/
- final Match candidateMatch = getComparison().getMatch((EObject)diffCandidate);
+ final Match candidateMatch = comparison.getMatch((EObject)diffCandidate);
- if (contains(getComparison(), originValues, diffCandidate)) {
+ if (contains(comparison, originValues, diffCandidate)) {
// This object is contained in both the right and origin lists. It can only have moved
if (checkOrdering) {
featureChange(match, reference, diffCandidate, DifferenceKind.MOVE,
@@ -315,7 +335,7 @@ public class DefaultDiffEngine implements IDiffEngine {
* A value that is in the origin but not in the left/right either has been deleted or is a moved
* element which previously was in this reference. We'll detect the move on its new reference.
*/
- final Match candidateMatch = getComparison().getMatch((EObject)diffCandidate);
+ final Match candidateMatch = comparison.getMatch((EObject)diffCandidate);
if (candidateMatch == null) {
// out of scope
} else {
@@ -348,15 +368,17 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected void computeContainmentDifferencesTwoWay(Match match, EReference reference,
boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
final List<Object> leftValues = getAsList(match.getLeft(), reference);
final List<Object> rightValues = getAsList(match.getRight(), reference);
- final List<Object> lcs = DiffUtil.longestCommonSubsequence(getComparison(), rightValues, leftValues);
+ final List<Object> lcs = DiffUtil.longestCommonSubsequence(comparison, rightValues, leftValues);
// TODO Can we shortcut in any way?
// Which values have "changed" in any way?
- final Iterable<Object> changed = Iterables.filter(leftValues, not(containedIn(getComparison(), lcs)));
+ final Iterable<Object> changed = Iterables.filter(leftValues, not(containedIn(comparison, lcs)));
// Added or moved
for (Object diffCandidate : changed) {
@@ -364,9 +386,9 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between right and left, we thus know it has changed. We also know
* that this is a containment reference.
*/
- final Match candidateMatch = getComparison().getMatch((EObject)diffCandidate);
+ final Match candidateMatch = comparison.getMatch((EObject)diffCandidate);
- if (contains(getComparison(), rightValues, diffCandidate)) {
+ if (contains(comparison, rightValues, diffCandidate)) {
// This object is contained in both the left and right lists. It can only have moved
if (checkOrdering) {
featureChange(match, reference, diffCandidate, DifferenceKind.MOVE, DifferenceSource.LEFT);
@@ -389,7 +411,7 @@ public class DefaultDiffEngine implements IDiffEngine {
* A value that is in the right but not in the left either has been deleted or is a moved element
* which previously was in this reference. We'll detect the move on its new reference.
*/
- final Match candidateMatch = getComparison().getMatch((EObject)diffCandidate);
+ final Match candidateMatch = comparison.getMatch((EObject)diffCandidate);
if (candidateMatch == null) {
// out of scope
} else if (candidateMatch.getLeft() == null) {
@@ -411,9 +433,11 @@ public class DefaultDiffEngine implements IDiffEngine {
* <code>false</code> otherwise.
*/
protected void computeDifferences(Match match, EAttribute attribute, boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
// This default implementation does not care about "attribute" changes on added/removed elements
boolean shortcut = false;
- if (getComparison().isThreeWay()) {
+ if (comparison.isThreeWay()) {
shortcut = match.getOrigin() == null;
} else {
shortcut = match.getLeft() == null || match.getRight() == null;
@@ -423,7 +447,7 @@ public class DefaultDiffEngine implements IDiffEngine {
}
if (attribute.isMany()) {
- if (getComparison().isThreeWay()) {
+ if (comparison.isThreeWay()) {
computeMultiValuedFeatureDifferencesThreeWay(match, attribute, checkOrdering);
} else {
computeMultiValuedFeatureDifferencesTwoWay(match, attribute, checkOrdering);
@@ -446,20 +470,22 @@ public class DefaultDiffEngine implements IDiffEngine {
* <code>false</code> otherwise.
*/
protected void computeDifferences(Match match, EReference reference, boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
if (reference.isContainment()) {
- if (getComparison().isThreeWay()) {
+ if (comparison.isThreeWay()) {
computeContainmentDifferencesThreeWay(match, reference, checkOrdering);
} else {
computeContainmentDifferencesTwoWay(match, reference, checkOrdering);
}
} else if (reference.isMany()) {
- if (getComparison().isThreeWay()) {
+ if (comparison.isThreeWay()) {
computeMultiValuedFeatureDifferencesThreeWay(match, reference, checkOrdering);
} else {
computeMultiValuedFeatureDifferencesTwoWay(match, reference, checkOrdering);
}
} else {
- if (getComparison().isThreeWay()) {
+ if (comparison.isThreeWay()) {
computeSingleValuedReferenceDifferencesThreeWay(match, reference);
} else {
computeSingleValuedReferenceDifferencesTwoWay(match, reference);
@@ -487,20 +513,22 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected void computeMultiValuedFeatureDifferencesThreeWay(Match match, EStructuralFeature feature,
boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
// We won't use iterables here since we need random access collections for fast LCS.
final List<Object> leftValues = getAsList(match.getLeft(), feature);
final List<Object> rightValues = getAsList(match.getRight(), feature);
final List<Object> originValues = getAsList(match.getOrigin(), feature);
- final List<Object> lcsOriginLeft = DiffUtil.longestCommonSubsequence(getComparison(), originValues,
+ final List<Object> lcsOriginLeft = DiffUtil.longestCommonSubsequence(comparison, originValues,
leftValues);
- final List<Object> lcsOriginRight = DiffUtil.longestCommonSubsequence(getComparison(), originValues,
+ final List<Object> lcsOriginRight = DiffUtil.longestCommonSubsequence(comparison, originValues,
rightValues);
// Which values have "changed" in any way?
- final Iterable<Object> changedLeft = Iterables.filter(leftValues, not(containedIn(getComparison(),
+ final Iterable<Object> changedLeft = Iterables.filter(leftValues, not(containedIn(comparison,
lcsOriginLeft)));
- final Iterable<Object> changedRight = Iterables.filter(rightValues, not(containedIn(getComparison(),
+ final Iterable<Object> changedRight = Iterables.filter(rightValues, not(containedIn(comparison,
lcsOriginRight)));
// Added or moved in the left
@@ -509,7 +537,7 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between origin and left, we thus know it has changed. If it is
* present in the origin, this is a move. Otherwise, it has been added in the left list.
*/
- if (contains(getComparison(), originValues, diffCandidate)) {
+ if (contains(comparison, originValues, diffCandidate)) {
if (checkOrdering) {
featureChange(match, feature, diffCandidate, DifferenceKind.MOVE, DifferenceSource.LEFT);
}
@@ -524,7 +552,7 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between origin and right, we thus know it has changed. If it is
* present in the origin, this is a move. Otherwise, it has been added in the right list.
*/
- if (contains(getComparison(), originValues, diffCandidate)) {
+ if (contains(comparison, originValues, diffCandidate)) {
if (checkOrdering) {
featureChange(match, feature, diffCandidate, DifferenceKind.MOVE, DifferenceSource.RIGHT);
}
@@ -537,12 +565,12 @@ public class DefaultDiffEngine implements IDiffEngine {
for (Object diffCandidate : originValues) {
// A value that is in the origin but not in one of the side has been deleted.
// However, we do not want attribute changes on removed elements.
- if (!contains(getComparison(), leftValues, diffCandidate)) {
+ if (!contains(comparison, leftValues, diffCandidate)) {
if (feature instanceof EReference || match.getLeft() != null) {
featureChange(match, feature, diffCandidate, DifferenceKind.DELETE, DifferenceSource.LEFT);
}
}
- if (!contains(getComparison(), rightValues, diffCandidate)) {
+ if (!contains(comparison, rightValues, diffCandidate)) {
if (feature instanceof EReference || match.getRight() != null) {
featureChange(match, feature, diffCandidate, DifferenceKind.DELETE,
DifferenceSource.RIGHT);
@@ -571,14 +599,16 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected void computeMultiValuedFeatureDifferencesTwoWay(Match match, EStructuralFeature feature,
boolean checkOrdering) {
+ final Comparison comparison = match.getComparison();
+
// We won't use iterables here since we need random access collections for fast LCS.
final List<Object> leftValues = getAsList(match.getLeft(), feature);
final List<Object> rightValues = getAsList(match.getRight(), feature);
- final List<Object> lcs = DiffUtil.longestCommonSubsequence(getComparison(), rightValues, leftValues);
+ final List<Object> lcs = DiffUtil.longestCommonSubsequence(comparison, rightValues, leftValues);
// Which values have "changed" in any way?
- final Iterable<Object> changed = Iterables.filter(leftValues, not(containedIn(getComparison(), lcs)));
+ final Iterable<Object> changed = Iterables.filter(leftValues, not(containedIn(comparison, lcs)));
// Added or moved
for (Object diffCandidate : changed) {
@@ -586,7 +616,7 @@ public class DefaultDiffEngine implements IDiffEngine {
* This value is not in the LCS between right and left, we thus know it has changed. If it is
* present in the right, this is a move. Otherwise, it has been added in the left list.
*/
- if (contains(getComparison(), rightValues, diffCandidate)) {
+ if (contains(comparison, rightValues, diffCandidate)) {
if (checkOrdering) {
featureChange(match, feature, diffCandidate, DifferenceKind.MOVE, DifferenceSource.LEFT);
}
@@ -599,7 +629,7 @@ public class DefaultDiffEngine implements IDiffEngine {
for (Object diffCandidate : rightValues) {
// A value that is in the right but not in the left has been deleted.
// However, we do not want attribute changes on removed elements.
- if (!contains(getComparison(), leftValues, diffCandidate)) {
+ if (!contains(comparison, leftValues, diffCandidate)) {
if (feature instanceof EReference || match.getLeft() != null) {
featureChange(match, feature, diffCandidate, DifferenceKind.DELETE, DifferenceSource.LEFT);
}
@@ -617,6 +647,8 @@ public class DefaultDiffEngine implements IDiffEngine {
* The attribute which values are to be checked.
*/
protected void computeSingleValuedAttributeDifferences(Match match, EAttribute attribute) {
+ final Comparison comparison = match.getComparison();
+
Object leftValue = UNMATCHED_VALUE;
if (match.getLeft() != null) {
leftValue = safeEGet(match.getLeft(), attribute);
@@ -626,17 +658,18 @@ public class DefaultDiffEngine implements IDiffEngine {
rightValue = safeEGet(match.getRight(), attribute);
}
- if (helper.matchingValues(getComparison(), leftValue, rightValue)) {
+ IEqualityHelper helper = comparison.getEqualityHelper();
+ if (helper.matchingValues(leftValue, rightValue)) {
// Identical values in left and right. The only problematic case is if they do not match the
// origin (and left and right are defined, i.e don't detect attribute change on unmatched)
- if (leftValue != UNMATCHED_VALUE && getComparison().isThreeWay()) {
+ if (leftValue != UNMATCHED_VALUE && comparison.isThreeWay()) {
final Object originValue;
if (match.getOrigin() == null) {
originValue = null;
} else {
originValue = safeEGet(match.getOrigin(), attribute);
}
- final boolean matchingLO = helper.matchingValues(getComparison(), leftValue, originValue);
+ final boolean matchingLO = helper.matchingValues(leftValue, originValue);
/*
* if !matchingLO, the same change has been made on both side. This is actually a
@@ -659,7 +692,7 @@ public class DefaultDiffEngine implements IDiffEngine {
} else if (match.getOrigin() != null) {
final Object originValue = safeEGet(match.getOrigin(), attribute);
- if (helper.matchingValues(getComparison(), leftValue, originValue)) {
+ if (helper.matchingValues(leftValue, originValue)) {
Object changedValue = rightValue;
if (isNullOrEmptyString(rightValue)) {
changedValue = originValue;
@@ -673,7 +706,7 @@ public class DefaultDiffEngine implements IDiffEngine {
// Right is unmatched, left is the same as in the origin. No diff here : the diff is on
// the match itself, not on one of its attributes.
}
- } else if (helper.matchingValues(getComparison(), rightValue, originValue)) {
+ } else if (helper.matchingValues(rightValue, originValue)) {
Object changedValue = leftValue;
if (isNullOrEmptyString(leftValue)) {
changedValue = originValue;
@@ -721,7 +754,7 @@ public class DefaultDiffEngine implements IDiffEngine {
DifferenceSource.LEFT);
}
}
- if (getComparison().isThreeWay() && rightValue != UNMATCHED_VALUE) {
+ if (comparison.isThreeWay() && rightValue != UNMATCHED_VALUE) {
if (isNullOrEmptyString(rightValue)) {
getDiffProcessor().attributeChange(match, attribute, leftValue, DifferenceKind.CHANGE,
DifferenceSource.RIGHT);
@@ -771,6 +804,8 @@ public class DefaultDiffEngine implements IDiffEngine {
* The reference which values are to be checked.
*/
protected void computeSingleValuedReferenceDifferencesThreeWay(Match match, EReference reference) {
+ final Comparison comparison = match.getComparison();
+
Object leftValue = UNMATCHED_VALUE;
if (match.getLeft() != null) {
leftValue = safeEGet(match.getLeft(), reference);
@@ -784,7 +819,7 @@ public class DefaultDiffEngine implements IDiffEngine {
originValue = safeEGet(match.getOrigin(), reference);
}
- boolean distinctValueLO = !helper.matchingValues(getComparison(), leftValue, originValue);
+ boolean distinctValueLO = !comparison.getEqualityHelper().matchingValues(leftValue, originValue);
// consider null and unmatched as the same
distinctValueLO = distinctValueLO
&& !(isNullOrUnmatched(leftValue) && isNullOrUnmatched(originValue));
@@ -802,7 +837,7 @@ public class DefaultDiffEngine implements IDiffEngine {
}
}
- boolean distinctValueRO = !helper.matchingValues(getComparison(), rightValue, originValue);
+ boolean distinctValueRO = !comparison.getEqualityHelper().matchingValues(rightValue, originValue);
// consider null and unmatched as the same
distinctValueRO = distinctValueRO
&& !(isNullOrUnmatched(rightValue) && isNullOrUnmatched(originValue));
@@ -837,6 +872,8 @@ public class DefaultDiffEngine implements IDiffEngine {
* The reference which values are to be checked.
*/
protected void computeSingleValuedReferenceDifferencesTwoWay(Match match, EReference reference) {
+ final Comparison comparison = match.getComparison();
+
Object leftValue = UNMATCHED_VALUE;
if (match.getLeft() != null) {
leftValue = safeEGet(match.getLeft(), reference);
@@ -846,7 +883,7 @@ public class DefaultDiffEngine implements IDiffEngine {
rightValue = safeEGet(match.getRight(), reference);
}
- boolean distinctValue = !helper.matchingValues(getComparison(), leftValue, rightValue);
+ boolean distinctValue = !comparison.getEqualityHelper().matchingValues(leftValue, rightValue);
// consider null and unmatched as the same
distinctValue = distinctValue && !(isNullOrUnmatched(leftValue) && isNullOrUnmatched(rightValue));
@@ -897,15 +934,6 @@ public class DefaultDiffEngine implements IDiffEngine {
}
/**
- * Returns the comparison for which we are currently detecting differences.
- *
- * @return The comparison for which we are currently detecting differences.
- */
- protected Comparison getComparison() {
- return currentComparison;
- }
-
- /**
* This will return the diff processor that has been created through {@link #createDiffProcessor()} for
* this differencing process.
*
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
index 189dfdbfc..8c1a99de1 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
@@ -14,6 +14,8 @@ import static com.google.common.collect.Iterables.filter;
import com.google.common.base.Predicate;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
@@ -41,7 +43,28 @@ public class DefaultEquiEngine implements IEquiEngine {
*
* @see org.eclipse.emf.compare.equi.IEquiEngine#computeEquivalences(org.eclipse.emf.compare.Comparison)
*/
+ @Deprecated
public void computeEquivalences(Comparison comparison) {
+ computeEquivalences(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This is the entry point of the equivalence computing process.
+ * <p>
+ * It will complete the input <code>comparison</code> by iterating over the
+ * {@link org.eclipse.emf.compare.Diff differences} it contain, filling in the equivalence it can detect
+ * for each distinct Diff.
+ * </p>
+ * <p>
+ * This method should be pull-up in the interface in next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void computeEquivalences(Comparison comparison, Monitor monitor) {
for (Diff difference : comparison.getDifferences()) {
checkForEquivalences(comparison, difference);
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/EMFCompareExtensionRegistry.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/EMFCompareExtensionRegistry.java
deleted file mode 100644
index ff5e0a58b..000000000
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/EMFCompareExtensionRegistry.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.extension;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This will contain all of the EMF Compare extensions.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class EMFCompareExtensionRegistry {
-
- /** List of all the post processors contributed through "org.eclipse.emf.compare.postProcessor". */
- private static final List<PostProcessorDescriptor> POST_PROCESSORS = new ArrayList<PostProcessorDescriptor>();
-
- /** This class should not be instantiated. */
- protected EMFCompareExtensionRegistry() {
- }
-
- /**
- * Adds a post processor to the registry.
- *
- * @param postProcessor
- * Post Processor that is to be added to this registry.
- */
- public static void addPostProcessor(PostProcessorDescriptor postProcessor) {
- POST_PROCESSORS.add(postProcessor);
- }
-
- /**
- * Removes all extensions from this registry.
- *
- * @noreference This method is not intended to be referenced by clients.
- */
- public static void clearRegistry() {
- POST_PROCESSORS.clear();
- }
-
- /**
- * This will return a copy of the registered post processors list.
- *
- * @return A copy of the registered post processors list.
- */
- public static List<PostProcessorDescriptor> getRegisteredPostProcessors() {
- return new ArrayList<PostProcessorDescriptor>(POST_PROCESSORS);
- }
-
- /**
- * Removes a post processor from this registry.
- *
- * @param postProcessorClassName
- * Qualified class name of the post processor that is to be removed from the registry.
- */
- public static void removePostProcessor(String postProcessorClassName) {
- for (PostProcessorDescriptor descriptor : getRegisteredPostProcessors()) {
- if (descriptor.getExtensionClassName().equals(postProcessorClassName)) {
- POST_PROCESSORS.remove(descriptor);
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java
index 65c9abe59..104b0d318 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorDescriptor.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.compare.extension;
/**
* Describes an extension to make post handling at each step of the comparison. This descriptor has to be
- * added in the EMFCompareExtensionRegistry in order that the contribution be effective.
+ * added in the PostProcessorRegistry in order that the contribution be effective.
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java
new file mode 100644
index 000000000..0cb637040
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/PostProcessorRegistry.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.extension;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.eclipse.emf.compare.scope.IComparisonScope;
+
+/**
+ * This will contain all of the EMF Compare extensions.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class PostProcessorRegistry {
+
+ /** List of all the post processors contributed through "org.eclipse.emf.compare.postProcessor". */
+ private final List<PostProcessorDescriptor> postProcessors;
+
+ /**
+ * Creates a new extension registry
+ */
+ public PostProcessorRegistry() {
+ postProcessors = new CopyOnWriteArrayList<PostProcessorDescriptor>();
+ }
+
+ /**
+ * Adds a post processor to the registry.
+ *
+ * @param postProcessor
+ * Post Processor that is to be added to this registry.
+ */
+ public void addPostProcessor(PostProcessorDescriptor postProcessor) {
+ postProcessors.add(postProcessor);
+ }
+
+ /**
+ * Removes all extensions from this registry.
+ *
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public void clearRegistry() {
+ postProcessors.clear();
+ }
+
+ /**
+ * This will return a copy of the registered post processors list.
+ *
+ * @return A copy of the registered post processors list.
+ */
+ public List<PostProcessorDescriptor> getRegisteredPostProcessors() {
+ return postProcessors;
+ }
+
+ /**
+ * Removes a post processor from this registry.
+ *
+ * @param postProcessorClassName
+ * Qualified class name of the post processor that is to be removed from the registry.
+ */
+ public void removePostProcessor(String postProcessorClassName) {
+ for (PostProcessorDescriptor descriptor : getRegisteredPostProcessors()) {
+ if (descriptor.getExtensionClassName().equals(postProcessorClassName)) {
+ postProcessors.remove(descriptor);
+ }
+ }
+ }
+
+ /**
+ * Retrieve the post processor from a given <code>scope</code>. The scope provides the set of scanned
+ * namespaces and resource uris. If one of them matches with the regex of a
+ * "org.eclipse.emf.compare.postProcessor" extension point, then the associated post processor is
+ * returned.
+ *
+ * @param scope
+ * The given scope.
+ * @return The associated post processor if any.
+ */
+ public IPostProcessor getPostProcessor(IComparisonScope scope) {
+ IPostProcessor postProcessor = null;
+ final Iterator<PostProcessorDescriptor> postProcessorIterator = postProcessors.iterator();
+ while (postProcessorIterator.hasNext() && postProcessor == null) {
+ final PostProcessorDescriptor descriptor = postProcessorIterator.next();
+ if (descriptor.getNsURI() != null && descriptor.getNsURI().trim().length() != 0) {
+ final Iterator<String> nsUris = scope.getNsURIs().iterator();
+ while (nsUris.hasNext() && postProcessor == null) {
+ if (nsUris.next().matches(descriptor.getNsURI())) {
+ postProcessor = descriptor.getPostProcessor();
+ }
+ }
+ }
+ // Should probably use two loops here to prioritize NsURI matching
+ if (descriptor.getResourceURI() != null && descriptor.getResourceURI().trim().length() != 0) {
+ final Iterator<String> resourceUris = scope.getResourceURIs().iterator();
+ while (resourceUris.hasNext() && postProcessor == null) {
+ if (resourceUris.next().matches(descriptor.getResourceURI())) {
+ postProcessor = descriptor.getPostProcessor();
+ }
+ }
+ }
+ }
+ return postProcessor;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ComparisonSpec.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ComparisonSpec.java
index 3b3242c7f..c012bd741 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ComparisonSpec.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ComparisonSpec.java
@@ -16,26 +16,27 @@ import static com.google.common.collect.Iterables.transform;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
+import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import java.util.Iterator;
-import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.AbstractEList;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.EMFCompareConfiguration;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.impl.ComparisonImpl;
import org.eclipse.emf.compare.internal.DiffCrossReferencer;
import org.eclipse.emf.compare.internal.MatchCrossReferencer;
+import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
/**
* This specialization of the {@link ComparisonImpl} class allows us to define the derived features and
@@ -167,19 +168,15 @@ public class ComparisonSpec extends ComparisonImpl {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.impl.ComparisonImpl#getConfiguration()
+ * @see org.eclipse.emf.compare.impl.ComparisonImpl#getEqualityHelper()
*/
@Override
- public EMFCompareConfiguration getConfiguration() {
- EMFCompareConfiguration ret = null;
- for (Adapter eAdapter : eAdapters()) {
- if (eAdapter.isAdapterForType(EMFCompareConfiguration.class)) {
- ret = (EMFCompareConfiguration)eAdapter;
- break;
- }
- }
+ public IEqualityHelper getEqualityHelper() {
+ IEqualityHelper ret = (IEqualityHelper)EcoreUtil.getExistingAdapter(this, IEqualityHelper.class);
if (ret == null) {
- ret = EMFCompare.createDefaultConfiguration();
+ ret = new EqualityHelper(EqualityHelper.createDefaultCache(CacheBuilder.newBuilder()));
+ this.eAdapters().add(ret);
+ ret.setTarget(this);
}
return ret;
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ReferenceChangeSpec.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ReferenceChangeSpec.java
index 5b3ac0a08..a0a9d5aed 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ReferenceChangeSpec.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/ReferenceChangeSpec.java
@@ -24,7 +24,7 @@ import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.impl.ReferenceChangeImpl;
import org.eclipse.emf.compare.utils.DiffUtil;
import org.eclipse.emf.compare.utils.EMFCompareCopier;
-import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -619,11 +619,11 @@ public class ReferenceChangeSpec extends ReferenceChangeImpl {
*/
private EObject findMatchIn(List<EObject> list, EObject element) {
final Comparison comparison = getMatch().getComparison();
- final EqualityHelper helper = comparison.getConfiguration().getEqualityHelper();
+ final IEqualityHelper helper = comparison.getEqualityHelper();
final Iterator<EObject> it = list.iterator();
while (it.hasNext()) {
final EObject next = it.next();
- if (helper.matchingValues(comparison, next, element)) {
+ if (helper.matchingValues(next, element)) {
return next;
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultComparisonFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultComparisonFactory.java
new file mode 100644
index 000000000..2f6ad4d9c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultComparisonFactory.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.match;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.eclipse.emf.compare.CompareFactory;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+
+/**
+ * A default implementation of {@link IComparisonFactory} that creates a new {@link Comparison} through the
+ * {@link CompareFactory#eINSTANCE default CompareFactory}.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class DefaultComparisonFactory implements IComparisonFactory {
+
+ private final IEqualityHelperFactory equalityHelperFactory;
+
+ public DefaultComparisonFactory(IEqualityHelperFactory equalityHelperFactory) {
+ this.equalityHelperFactory = checkNotNull(equalityHelperFactory);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.match.IComparisonFactory#createComparison()
+ */
+ public Comparison createComparison() {
+ Comparison comparison = CompareFactory.eINSTANCE.createComparison();
+
+ IEqualityHelper equalityHelper = equalityHelperFactory.createEqualityHelper();
+
+ comparison.eAdapters().add(equalityHelper);
+ equalityHelper.setTarget(comparison);
+
+ return comparison;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java
new file mode 100644
index 000000000..c1ccb2b7d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.match;
+
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class DefaultEqualityHelperFactory implements IEqualityHelperFactory {
+
+ private final CacheBuilder<Object, Object> cacheBuilder;
+
+ public DefaultEqualityHelperFactory() {
+ this(CacheBuilder.newBuilder());
+ }
+
+ public DefaultEqualityHelperFactory(CacheBuilder<Object, Object> cacheBuilder) {
+ this.cacheBuilder = cacheBuilder;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.match.IEqualityHelperFactory#createEqualityHelper()
+ */
+ public IEqualityHelper createEqualityHelper() {
+ Cache<EObject, URI> cache = EqualityHelper.createDefaultCache(cacheBuilder);
+ IEqualityHelper equalityHelper = new EqualityHelper(cache);
+ return equalityHelper;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
index a49c0acbc..ab13ac570 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
@@ -13,23 +13,32 @@ package org.eclipse.emf.compare.match;
import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import java.util.Iterator;
-import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.EMFCompareConfiguration;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.match.eobject.EditionDistance;
import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
+import org.eclipse.emf.compare.match.eobject.IdentifierEObjectMatcher;
+import org.eclipse.emf.compare.match.eobject.ProximityEObjectMatcher;
import org.eclipse.emf.compare.match.resource.IResourceMatcher;
import org.eclipse.emf.compare.match.resource.StrategyResourceMatcher;
import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+import org.eclipse.emf.compare.utils.UseIdentifiers;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -43,66 +52,111 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
public class DefaultMatchEngine implements IMatchEngine {
- /** Root of this comparison, should only be accessed or instantiated through {@link #getComparison()}. */
- private Comparison comparison;
-
- /** The comparison scope that will be used by this engine. Should be accessed through {@link #getScope()}. */
- private IComparisonScope comparisonScope;
/** The delegate {@link IEObjectMatcher matcher} that will actually pair EObjects together. */
- private IEObjectMatcher eObjectMatcher;
+ private final IEObjectMatcher eObjectMatcher;
+
+ /** The factory that will be use to instantiate Comparison as return by match() methods. */
+ private final IComparisonFactory comparisonFactory;
/**
- * This default engine delegates the pairing of EObjects to an {@link IEObjectMatcher}.This constructor
- * allows initialization of this matcher.
+ * This default engine delegates the pairing of EObjects to an {@link IEObjectMatcher}.
*
* @param matcher
* The matcher that will be in charge of pairing EObjects together for this comparison process.
+ * @see #DefaultMatchEngine(IEObjectMatcher, IComparisonFactory)
*/
+ @Deprecated
public DefaultMatchEngine(IEObjectMatcher matcher) {
- checkNotNull(matcher);
- this.eObjectMatcher = matcher;
+ this(matcher, new DefaultComparisonFactory(new DefaultEqualityHelperFactory()));
+ }
+
+ /**
+ * This default engine delegates the pairing of EObjects to an {@link IEObjectMatcher}.
+ *
+ * @param matcher
+ * The matcher that will be in charge of pairing EObjects together for this comparison process.
+ * @param comparisonFactory
+ * factory that will be use to instantiate Comparison as return by match() methods.
+ */
+ public DefaultMatchEngine(IEObjectMatcher matcher, IComparisonFactory comparisonFactory) {
+ this.eObjectMatcher = checkNotNull(matcher);
+ this.comparisonFactory = checkNotNull(comparisonFactory);
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.match.IMatchEngine#match(IComparisonScope, EMFCompareConfiguration)
+ * @see org.eclipse.emf.compare.match.IMatchEngine#match(IComparisonScope, Monitor)
*/
+ @Deprecated
public Comparison match(IComparisonScope scope, EMFCompareConfiguration configuration) {
- this.comparisonScope = scope;
- associate(getComparison(), configuration);
+ final Monitor monitor;
+ if (configuration != null) {
+ monitor = configuration.getMonitor();
+ } else {
+ monitor = new BasicMonitor();
+ }
+ return match(scope, monitor);
+ }
- final Notifier left = getScope().getLeft();
- final Notifier right = getScope().getRight();
- final Notifier origin = getScope().getOrigin();
+ /**
+ * This is the entry point of a Comparison process. It is expected to use the provided scope in order to
+ * determine all objects that need to be matched.
+ * <p>
+ * The returned Comparison should include both matched an unmatched objects. It is not the match engine's
+ * responsibility to determine differences between objects, only to match them together.
+ * </p>
+ * <p>
+ * Should be pull-up to interface in next major revision.
+ * </p>
+ *
+ * @param scope
+ * The comparison scope that should be used by this engine to determine the objects to match.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ * @return An initialized {@link Comparison} model with all matches determined.
+ */
+ public Comparison match(IComparisonScope scope, Monitor monitor) {
+ Comparison comparison = comparisonFactory.createComparison();
+
+ final Notifier left = scope.getLeft();
+ final Notifier right = scope.getRight();
+ final Notifier origin = scope.getOrigin();
- getComparison().setThreeWay(origin != null);
+ comparison.setThreeWay(origin != null);
- match(left, right, origin);
+ match(comparison, scope, left, right, origin, monitor);
- return getComparison();
+ return comparison;
}
/**
* This methods will delegate to the proper "match(T, T, T)" implementation according to the types of
* {@code left}, {@code right} and {@code origin}.
*
+ * @param comparison
+ * The comparison to which will be added detected matches.
+ * @param scope
+ * The comparison scope that should be used by this engine to determine the objects to match.
* @param left
* The left {@link Notifier}.
* @param right
* The right {@link Notifier}.
* @param origin
* The common ancestor of <code>left</code> and <code>right</code>. Can be <code>null</code>.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- protected void match(final Notifier left, final Notifier right, final Notifier origin) {
+ protected void match(Comparison comparison, IComparisonScope scope, final Notifier left,
+ final Notifier right, final Notifier origin, Monitor monitor) {
// FIXME side-effect coding
if (left instanceof ResourceSet || right instanceof ResourceSet) {
- match((ResourceSet)left, (ResourceSet)right, (ResourceSet)origin);
+ match(comparison, scope, (ResourceSet)left, (ResourceSet)right, (ResourceSet)origin, monitor);
} else if (left instanceof Resource || right instanceof Resource) {
- match((Resource)left, (Resource)right, (Resource)origin);
+ match(comparison, scope, (Resource)left, (Resource)right, (Resource)origin, monitor);
} else if (left instanceof EObject || right instanceof EObject) {
- match((EObject)left, (EObject)right, (EObject)origin);
+ match(comparison, scope, (EObject)left, (EObject)right, (EObject)origin, monitor);
} else {
// TODO Cannot happen ... for now. Should we log an exception?
}
@@ -113,24 +167,31 @@ public class DefaultMatchEngine implements IMatchEngine {
* comparison scope for these resource sets children, then delegate to an {@link IResourceMatcher} to
* determine the resource mappings.
*
+ * @param comparison
+ * The comparison to which will be added detected matches.
+ * @param scope
+ * The comparison scope that should be used by this engine to determine the objects to match.
* @param left
* The left {@link ResourceSet}.
* @param right
* The right {@link ResourceSet}.
* @param origin
* The common ancestor of <code>left</code> and <code>right</code>. Can be <code>null</code>.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- protected void match(ResourceSet left, ResourceSet right, ResourceSet origin) {
- final Iterator<? extends Resource> leftChildren = getScope().getCoveredResources(left);
- final Iterator<? extends Resource> rightChildren = getScope().getCoveredResources(right);
+ protected void match(Comparison comparison, IComparisonScope scope, ResourceSet left, ResourceSet right,
+ ResourceSet origin, Monitor monitor) {
+ final Iterator<? extends Resource> leftChildren = scope.getCoveredResources(left);
+ final Iterator<? extends Resource> rightChildren = scope.getCoveredResources(right);
final Iterator<? extends Resource> originChildren;
if (origin != null) {
- originChildren = getScope().getCoveredResources(origin);
+ originChildren = scope.getCoveredResources(origin);
} else {
originChildren = Iterators.emptyIterator();
}
- final IResourceMatcher resourceMatcher = getResourceMatcher();
+ final IResourceMatcher resourceMatcher = createResourceMatcher();
final Iterable<MatchResource> mappings = resourceMatcher.createMappings(leftChildren, rightChildren,
originChildren);
@@ -139,28 +200,28 @@ public class DefaultMatchEngine implements IMatchEngine {
Iterator<? extends EObject> originEObjects = Iterators.emptyIterator();
for (MatchResource mapping : mappings) {
- getComparison().getMatchedResources().add(mapping);
+ comparison.getMatchedResources().add(mapping);
final Resource leftRes = mapping.getLeft();
final Resource rightRes = mapping.getRight();
final Resource originRes = mapping.getOrigin();
if (leftRes != null) {
- leftEObjects = Iterators.concat(leftEObjects, getScope().getCoveredEObjects(leftRes));
+ leftEObjects = Iterators.concat(leftEObjects, scope.getCoveredEObjects(leftRes));
}
if (rightRes != null) {
- rightEObjects = Iterators.concat(rightEObjects, getScope().getCoveredEObjects(rightRes));
+ rightEObjects = Iterators.concat(rightEObjects, scope.getCoveredEObjects(rightRes));
}
if (originRes != null) {
- originEObjects = Iterators.concat(originEObjects, getScope().getCoveredEObjects(originRes));
+ originEObjects = Iterators.concat(originEObjects, scope.getCoveredEObjects(originRes));
}
}
final Iterable<Match> matches = getEObjectMatcher().createMatches(leftEObjects, rightEObjects,
originEObjects);
- Iterables.addAll(getComparison().getMatches(), matches);
+ Iterables.addAll(comparison.getMatches(), matches);
}
/**
@@ -170,14 +231,21 @@ public class DefaultMatchEngine implements IMatchEngine {
* We expect at least two of the given resources not to be <code>null</code>.
* </p>
*
+ * @param comparison
+ * The comparison to which will be added detected matches.
+ * @param scope
+ * The comparison scope that should be used by this engine to determine the objects to match.
* @param left
* The left {@link Resource}. Can be <code>null</code>.
* @param right
* The right {@link Resource}. Can be <code>null</code>.
* @param origin
* The common ancestor of <code>left</code> and <code>right</code>. Can be <code>null</code>.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- protected void match(Resource left, Resource right, Resource origin) {
+ protected void match(Comparison comparison, IComparisonScope scope, Resource left, Resource right,
+ Resource origin, Monitor monitor) {
// Our "roots" are Resources. Consider them matched
final MatchResource match = CompareFactory.eINSTANCE.createMatchResource();
@@ -206,7 +274,7 @@ public class DefaultMatchEngine implements IMatchEngine {
}
}
- getComparison().getMatchedResources().add(match);
+ comparison.getMatchedResources().add(match);
// We need at least two resources to match them
if (atLeastTwo(left == null, right == null, origin == null)) {
@@ -219,19 +287,19 @@ public class DefaultMatchEngine implements IMatchEngine {
final Iterator<? extends EObject> leftEObjects;
if (left != null) {
- leftEObjects = getScope().getCoveredEObjects(left);
+ leftEObjects = scope.getCoveredEObjects(left);
} else {
leftEObjects = Iterators.emptyIterator();
}
final Iterator<? extends EObject> rightEObjects;
if (right != null) {
- rightEObjects = getScope().getCoveredEObjects(right);
+ rightEObjects = scope.getCoveredEObjects(right);
} else {
rightEObjects = Iterators.emptyIterator();
}
final Iterator<? extends EObject> originEObjects;
if (origin != null) {
- originEObjects = getScope().getCoveredEObjects(origin);
+ originEObjects = scope.getCoveredEObjects(origin);
} else {
originEObjects = Iterators.emptyIterator();
}
@@ -239,7 +307,7 @@ public class DefaultMatchEngine implements IMatchEngine {
final Iterable<Match> matches = getEObjectMatcher().createMatches(leftEObjects, rightEObjects,
originEObjects);
- Iterables.addAll(getComparison().getMatches(), matches);
+ Iterables.addAll(comparison.getMatches(), matches);
}
/**
@@ -249,27 +317,33 @@ public class DefaultMatchEngine implements IMatchEngine {
* We expect at least the <code>left</code> and <code>right</code> EObjects not to be <code>null</code>.
* </p>
*
+ * @param comparison
+ * The comparison to which will be added detected matches.
+ * @param scope
+ * The comparison scope that should be used by this engine to determine the objects to match.
* @param left
* The left {@link EObject}.
* @param right
* The right {@link EObject}.
* @param origin
* The common ancestor of <code>left</code> and <code>right</code>.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation.
*/
- protected void match(EObject left, EObject right, EObject origin) {
+ protected void match(Comparison comparison, IComparisonScope scope, EObject left, EObject right,
+ EObject origin, Monitor monitor) {
if (left == null || right == null) {
// FIXME IAE or NPE?
throw new IllegalArgumentException();
}
final Iterator<? extends EObject> leftEObjects = Iterators.concat(Iterators.singletonIterator(left),
- getScope().getChildren(left));
+ scope.getChildren(left));
final Iterator<? extends EObject> rightEObjects = Iterators.concat(
- Iterators.singletonIterator(right), getScope().getChildren(right));
+ Iterators.singletonIterator(right), scope.getChildren(right));
final Iterator<? extends EObject> originEObjects;
if (origin != null) {
- originEObjects = Iterators.concat(Iterators.singletonIterator(origin), getScope().getChildren(
- origin));
+ originEObjects = Iterators.concat(Iterators.singletonIterator(origin), scope.getChildren(origin));
} else {
originEObjects = Iterators.emptyIterator();
}
@@ -277,7 +351,7 @@ public class DefaultMatchEngine implements IMatchEngine {
final Iterable<Match> matches = getEObjectMatcher().createMatches(leftEObjects, rightEObjects,
originEObjects);
- Iterables.addAll(getComparison().getMatches(), matches);
+ Iterables.addAll(comparison.getMatches(), matches);
}
/**
@@ -286,7 +360,7 @@ public class DefaultMatchEngine implements IMatchEngine {
* @return An {@link IResourceMatcher} that can be used to retrieve the {@link MatchResource}s for this
* comparison.
*/
- protected IResourceMatcher getResourceMatcher() {
+ protected IResourceMatcher createResourceMatcher() {
return new StrategyResourceMatcher();
}
@@ -295,33 +369,11 @@ public class DefaultMatchEngine implements IMatchEngine {
*
* @return The EObject matcher associated with this match engine.
*/
- protected IEObjectMatcher getEObjectMatcher() {
+ protected final IEObjectMatcher getEObjectMatcher() {
return eObjectMatcher;
}
/**
- * Returns the root of this Comparison. This default implementation will instantiate a Comparison model
- * through the factory if needed.
- *
- * @return The root of this Comparison.
- */
- protected Comparison getComparison() {
- if (comparison == null) {
- comparison = CompareFactory.eINSTANCE.createComparison();
- }
- return comparison;
- }
-
- /**
- * Returns the comparison scope associated with this engine.
- *
- * @return The comparison scope associated with this engine.
- */
- protected IComparisonScope getScope() {
- return comparisonScope;
- }
-
- /**
* This will check that at least two of the three given booleans are <code>true</code>.
*
* @param condition1
@@ -333,34 +385,69 @@ public class DefaultMatchEngine implements IMatchEngine {
* @return <code>true</code> if at least two of the three given booleans are <code>true</code>,
* <code>false</code> otherwise.
*/
- protected static boolean atLeastTwo(boolean condition1, boolean condition2, boolean condition3) {
+ static boolean atLeastTwo(boolean condition1, boolean condition2, boolean condition3) {
// CHECKSTYLE:OFF This expression is alone in its method, and documented.
return condition1 && (condition2 || condition3) || (condition2 && condition3);
// CHECKSTYLE:ON
}
/**
- * Removes any already existing {@link EMFCompareConfiguration} adapter on the given
- * <code>comparison</code> object. Then it associates the given <code>configuration</code> with the
- * <code>comparison</code>.
+ * Helper creator method that instantiate a {@link DefaultMatchEngine} that will use identifiers as
+ * specified by the given {@code useIDs} enumeration.
*
- * @param comparison
- * the comparison receiver of the Adapter
- * @param configuration
- * the Adapter to associtate to the comparison.
+ * @param useIDs
+ * the kinds of matcher to use.
+ * @return a new {@link DefaultMatchEngine} instance.
*/
- private static void associate(Comparison comparison, EMFCompareConfiguration configuration) {
- Iterator<Adapter> eAdapters = comparison.eAdapters().iterator();
- while (eAdapters.hasNext()) {
- Adapter eAdapter = eAdapters.next();
- if (eAdapter.isAdapterForType(EMFCompareConfiguration.class)) {
- eAdapters.remove();
- if (eAdapter instanceof Adapter.Internal) {
- ((Adapter.Internal)eAdapter).unsetTarget(comparison);
- }
+ public static DefaultMatchEngine create(UseIdentifiers useIDs) {
+ final Cache<EObject, URI> defaultCache = EqualityHelper.createDefaultCache(CacheBuilder.newBuilder());
+
+ IEqualityHelperFactory helperFactory = new DefaultEqualityHelperFactory() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.match.DefaultEqualityHelperFactory#createEqualityHelper()
+ */
+ @Override
+ public IEqualityHelper createEqualityHelper() {
+ IEqualityHelper equalityHelper = new EqualityHelper(defaultCache);
+ return equalityHelper;
}
+ };
+
+ IComparisonFactory comparisonFactory = new DefaultComparisonFactory(helperFactory);
+
+ IEObjectMatcher matcher = createDefaultEObjectMatcher(useIDs, defaultCache);
+
+ final DefaultMatchEngine matchEngine = new DefaultMatchEngine(matcher, comparisonFactory);
+ return matchEngine;
+ }
+
+ /**
+ * @param useIDs
+ * @param cache
+ * @return
+ */
+ public static IEObjectMatcher createDefaultEObjectMatcher(UseIdentifiers useIDs, Cache<EObject, URI> cache) {
+ final IEObjectMatcher matcher;
+ final EditionDistance editionDistance = EditionDistance.builder(cache).build();
+ switch (useIDs) {
+ case NEVER:
+ matcher = new ProximityEObjectMatcher(editionDistance);
+ break;
+ case ONLY:
+ matcher = new IdentifierEObjectMatcher();
+ break;
+ case WHEN_AVAILABLE:
+ // fall through to default
+ default:
+ // Use an ID matcher, delegating to proximity when no ID is available
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(editionDistance);
+ matcher = new IdentifierEObjectMatcher(contentMatcher);
+ break;
+
}
- comparison.eAdapters().add(configuration);
- configuration.setTarget(comparison);
+
+ return matcher;
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IComparisonFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IComparisonFactory.java
new file mode 100644
index 000000000..524861f12
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IComparisonFactory.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.match;
+
+import org.eclipse.emf.compare.Comparison;
+
+/**
+ * A factory for {@link Comparison}. Used by the {@link org.eclipse.emf.compare.match.DefaultMatchEngine}.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public interface IComparisonFactory {
+
+ /**
+ * Returns a new {@link Comparison}.
+ *
+ * @return a new {@link Comparison}.
+ */
+ Comparison createComparison();
+
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IEqualityHelperFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IEqualityHelperFactory.java
new file mode 100644
index 000000000..3f118d8a4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IEqualityHelperFactory.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.match;
+
+import org.eclipse.emf.compare.utils.IEqualityHelper;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public interface IEqualityHelperFactory {
+
+ /**
+ * Returns a new {@link IEqualityHelper}.
+ *
+ * @return a new {@link IEqualityHelper}.
+ */
+ IEqualityHelper createEqualityHelper();
+
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java
index 9e82836a8..979e6b83d 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java
@@ -51,4 +51,5 @@ public interface IMatchEngine {
* @return An initialized {@link Comparison} model with all matches determined.
*/
Comparison match(IComparisonScope scope, EMFCompareConfiguration configuration);
+
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
index fbfab18c1..305c1dc77 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
@@ -10,7 +10,11 @@
*******************************************************************************/
package org.eclipse.emf.compare.match.eobject;
+import com.google.common.base.Function;
import com.google.common.base.Predicate;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Maps;
@@ -20,6 +24,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
@@ -32,11 +37,13 @@ import org.eclipse.emf.compare.diff.IDiffProcessor;
import org.eclipse.emf.compare.match.eobject.ProximityEObjectMatcher.DistanceFunction;
import org.eclipse.emf.compare.utils.DiffUtil;
import org.eclipse.emf.compare.utils.EqualityHelper;
+import org.eclipse.emf.compare.utils.IEqualityHelper;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
/**
* This distance function implementation will actually compare the given EObject.
@@ -75,20 +82,40 @@ public class EditionDistance implements DistanceFunction {
private Set<EStructuralFeature> toBeIgnored;
/**
- * The equality helper used to retrieve the URIs through its cache and to instanciate a specific diff
- * engine.
+ * Cache of EObject's URI (EcoreUtil.getURI() is costly).
*/
- private EqualityHelper helper;
+ private Cache<EObject, URI> cache;
/**
* Instanciate a new Edition Distance using the given equality helper.
*
* @param equalityHelper
- * the equality helper to use.
+ * this will be ignored
+ * @see #EditionDistance(Cache)
*/
- public EditionDistance(EqualityHelper equalityHelper) {
- weights = Maps.newHashMap();
- this.helper = equalityHelper;
+ @Deprecated
+ public EditionDistance(IEqualityHelper equalityHelper) {
+ this(CacheBuilder.newBuilder().build(CacheLoader.from(new Function<EObject, URI>() {
+ public URI apply(EObject input) {
+ if (input == null) {
+ return null;
+ }
+ return EcoreUtil.getURI(input);
+ }
+ })));
+ }
+
+ /**
+ * Instantiate a new Edition Distance function using the given cache to cache EObject's URI. The caller
+ * should handle the lifecycle of the given cache. No manual eviction or clearance is handled by this
+ * object.
+ *
+ * @param cache
+ * the cache to be used.
+ */
+ public EditionDistance(Cache<EObject, URI> cache) {
+ this.cache = cache;
+ this.weights = Maps.newHashMap();
this.toBeIgnored = Sets.newLinkedHashSet();
}
@@ -100,17 +127,29 @@ public class EditionDistance implements DistanceFunction {
}
/**
- * Create a new builder to instanciate and configure an EditionDistance.
+ * Create a new builder to instantiate and configure an EditionDistance.
*
* @param helper
- * the equality helper (required to instanciate an EditionDistance).
+ * the equality helper (required to instantiate an EditionDistance).
* @return a configuration builder.
*/
+ @Deprecated
public static Builder builder(EqualityHelper helper) {
return new Builder(helper);
}
/**
+ * Creates a new builder to instantiate and configure an EditionDistance.
+ *
+ * @param cache
+ * the cache to be used by this instance.
+ * @return a configuration builder.
+ */
+ public static Builder builder(Cache<EObject, URI> cache) {
+ return new Builder(cache);
+ }
+
+ /**
* Builder class to configure an EditionDistance instance.
*/
public static class Builder {
@@ -123,10 +162,21 @@ public class EditionDistance implements DistanceFunction {
* Create the builder.
*
* @param toBe
- * the equality helper (required to instanciate an EditionDistance).
+ * the equality helper (required to instantiate an EditionDistance).
*/
- public Builder(EqualityHelper toBe) {
- this.toBeBuilt = new EditionDistance(toBe);
+ @Deprecated
+ protected Builder(EqualityHelper toBe) {
+ this(toBe.getCache());
+ }
+
+ /**
+ * Create the builder.
+ *
+ * @param cache
+ * the cache.
+ */
+ protected Builder(Cache<EObject, URI> cache) {
+ this.toBeBuilt = new EditionDistance(cache);
}
/**
@@ -307,9 +357,6 @@ public class EditionDistance implements DistanceFunction {
* An implementation of a diff engine which count and measure the detected changes.
*/
class CountingDiffEngine extends DefaultDiffEngine {
- /** A fake comparison object required so that the diff engine does his job correctly. */
- private Comparison fakeComparison;
-
/**
* The maximum distance until which we just have to stop.
*/
@@ -324,8 +371,6 @@ public class EditionDistance implements DistanceFunction {
public CountingDiffEngine(int maxDistance) {
super(new CountingDiffProcessor());
this.maxDistance = maxDistance;
- this.fakeComparison = CompareFactory.eINSTANCE.createComparison();
- this.helper = EditionDistance.this.helper;
}
@@ -353,18 +398,22 @@ public class EditionDistance implements DistanceFunction {
* @return the distance between them computed using the number of changes required to change a to b.
*/
public int measureDifferences(EObject a, EObject b) {
+ Comparison fakeComparison = CompareFactory.eINSTANCE.createComparison();
Match fakeMatch = CompareFactory.eINSTANCE.createMatch();
fakeMatch.setLeft(a);
fakeMatch.setRight(b);
- URI aLocation = helper.getURI(a);
- URI bLocation = helper.getURI(b);
+
+ fakeComparison.getMatches().add(fakeMatch);
+
+ URI aLocation = cache.getUnchecked(a);
+ URI bLocation = cache.getUnchecked(b);
int changes = 0;
if (!aLocation.fragment().equals(bLocation.fragment())) {
int dist = new URIDistance().proximity(aLocation.fragment(), bLocation.fragment());
changes += dist * locationChangeCoef;
}
if (changes <= maxDistance) {
- checkForDifferences(fakeMatch);
+ checkForDifferences(fakeMatch, new BasicMonitor());
changes += getCounter().getComputedDistance();
}
// System.err.println(changes + ":max=>" + maxDistance + ":" + a + ":" + b);
@@ -377,11 +426,6 @@ public class EditionDistance implements DistanceFunction {
}
@Override
- protected Comparison getComparison() {
- return fakeComparison;
- }
-
- @Override
protected FeatureFilter createFeatureFilter() {
return new FeatureFilter() {
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ProximityEObjectMatcher.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ProximityEObjectMatcher.java
index 25d02f271..7abbe7f04 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ProximityEObjectMatcher.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ProximityEObjectMatcher.java
@@ -257,59 +257,4 @@ public class ProximityEObjectMatcher implements IEObjectMatcher {
*/
int getMaxDistance(EObject left);
}
-
- /**
- * static method returning a builder to easily specify the configuration options of an
- * {@link ProximityEObjectMatcher}.
- *
- * @param function
- * the distance function to use.
- * @return a builder to easily specify the configuration options of an {@link ProximityEObjectMatcher}.
- */
- public static Builder builder(DistanceFunction function) {
- return new Builder(function);
- }
-
- /**
- * An builder class to instanciate and configure the proximity Matcher.
- */
- public static class Builder {
- /**
- * The matcher being configured by the builder.
- */
- private ProximityEObjectMatcher beingConfigured;
-
- /**
- * Create a new builder to configure the given matcher.
- *
- * @param function
- * : the distance function to use.
- */
- public Builder(DistanceFunction function) {
- this.beingConfigured = new ProximityEObjectMatcher(function);
- }
-
- /**
- * Specify the distance function to use for the comparison.
- *
- * @param function
- * the function to use for measuring the delta between two EObjects.
- * @return the current builder so that one can chain calls.
- */
- public Builder distanceFunction(DistanceFunction function) {
- this.beingConfigured.index = new ByTypeIndex(function);
- return this;
- }
-
- /**
- * return the {@link ProximityEObjectMatcher} being configured.
- *
- * @return the {@link ProximityEObjectMatcher} being configured.
- */
- public ProximityEObjectMatcher build() {
- return this.beingConfigured;
- }
-
- }
-
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
index 87d26c7dc..2fbe2b79b 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
@@ -16,6 +16,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
@@ -43,8 +45,30 @@ public class DefaultReqEngine implements IReqEngine {
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.diff.IDiffEngine#computeRequirements(org.eclipse.emf.compare.Comparison)
+ * @see #computeRequirements(Comparison, Monitor)
*/
+ @Deprecated
public void computeRequirements(Comparison comparison) {
+ computeRequirements(comparison, new BasicMonitor());
+ }
+
+ /**
+ * This is the entry point of the requirements computing process.
+ * <p>
+ * It will complete the input <code>comparison</code> by iterating over the
+ * {@link org.eclipse.emf.compare.Diff differences} it contain, filling in the requirements it can detect
+ * for each distinct Diff.
+ * </p>
+ * <p>
+ * This method should be pull-up in the interface in next major version.
+ * </p>
+ *
+ * @param comparison
+ * The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ */
+ public void computeRequirements(Comparison comparison, Monitor monitor) {
for (Diff difference : comparison.getDifferences()) {
checkForRequiredDifferences(comparison, difference);
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/DiffUtil.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/DiffUtil.java
index e30def688..1aa8d2e85 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/DiffUtil.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/DiffUtil.java
@@ -136,7 +136,7 @@ public final class DiffUtil {
*/
public static <E> List<E> longestCommonSubsequence(Comparison comparison, Iterable<E> ignoredElements,
List<E> sequence1, List<E> sequence2) {
- final EqualityHelper equalityHelper = comparison.getConfiguration().getEqualityHelper();
+ final IEqualityHelper equalityHelper = comparison.getEqualityHelper();
final int size1 = sequence1.size();
final int size2 = sequence2.size();
final int[][] matrix = new int[size1 + 1][size2 + 1];
@@ -146,7 +146,7 @@ public final class DiffUtil {
for (int j = 1; j <= size2; j++) {
final E first = sequence1.get(i - 1);
final E second = sequence2.get(j - 1);
- if (equalityHelper.matchingValues(comparison, first, second)
+ if (equalityHelper.matchingValues(first, second)
&& !contains(comparison, equalityHelper, ignoredElements, second)) {
matrix[i][j] = 1 + matrix[i - 1][j - 1];
} else {
@@ -175,7 +175,7 @@ public final class DiffUtil {
while (current1 > 0 && current2 > 0) {
final E first = sequence1.get(current1 - 1);
final E second = sequence2.get(current2 - 1);
- if (equalityHelper.matchingValues(comparison, first, second)) {
+ if (equalityHelper.matchingValues(first, second)) {
result.add(first);
current1--;
current2--;
@@ -228,7 +228,7 @@ public final class DiffUtil {
*/
public static <E> List<E> longestCommonSubsequence(Comparison comparison, List<E> sequence1,
List<E> sequence2) {
- final EqualityHelper equalityHelper = comparison.getConfiguration().getEqualityHelper();
+ final IEqualityHelper equalityHelper = comparison.getEqualityHelper();
final int size1 = sequence1.size();
final int size2 = sequence2.size();
@@ -239,7 +239,7 @@ public final class DiffUtil {
final E first = sequence1.get(i - 1);
for (int j = 1; j <= size2; j++) {
final E second = sequence2.get(j - 1);
- if (equalityHelper.matchingValues(comparison, first, second)) {
+ if (equalityHelper.matchingValues(first, second)) {
matrix[i][j] = 1 + matrix[i - 1][j - 1];
} else {
matrix[i][j] = Math.max(matrix[i - 1][j], matrix[i][j - 1]);
@@ -267,7 +267,7 @@ public final class DiffUtil {
while (current1 > 0 && current2 > 0) {
final E first = sequence1.get(current1 - 1);
final E second = sequence2.get(current2 - 1);
- if (equalityHelper.matchingValues(comparison, first, second)) {
+ if (equalityHelper.matchingValues(first, second)) {
result.add(first);
current1--;
current2--;
@@ -321,7 +321,7 @@ public final class DiffUtil {
*/
private static <E> int findInsertionIndex(Comparison comparison, Iterable<E> ignoredElements,
List<E> source, List<E> target, E newElement) {
- EqualityHelper equalityHelper = comparison.getConfiguration().getEqualityHelper();
+ IEqualityHelper equalityHelper = comparison.getEqualityHelper();
// TODO split this into multiple sub-methods
// We assume that "newElement" is in source but not in the target yet
@@ -352,13 +352,13 @@ public final class DiffUtil {
final Iterator<E> sourceIterator = source.iterator();
for (int i = 0; sourceIterator.hasNext() && (currentIndex == -1 || lastLCSIndex == -1); i++) {
final E sourceElement = sourceIterator.next();
- if (currentIndex == -1 && equalityHelper.matchingValues(comparison, sourceElement, newElement)) {
+ if (currentIndex == -1 && equalityHelper.matchingValues(sourceElement, newElement)) {
currentIndex = i;
}
- if (firstLCSIndex == -1 && equalityHelper.matchingValues(comparison, sourceElement, firstLCS)) {
+ if (firstLCSIndex == -1 && equalityHelper.matchingValues(sourceElement, firstLCS)) {
firstLCSIndex = i;
}
- if (lastLCSIndex == -1 && equalityHelper.matchingValues(comparison, sourceElement, lastLCS)) {
+ if (lastLCSIndex == -1 && equalityHelper.matchingValues(sourceElement, lastLCS)) {
lastLCSIndex = i;
}
}
@@ -377,7 +377,7 @@ public final class DiffUtil {
for (int i = 0; i < target.size() && insertionIndex == -1; i++) {
final E targetElement = target.get(i);
- if (equalityHelper.matchingValues(comparison, targetElement, firstLCS)) {
+ if (equalityHelper.matchingValues(targetElement, firstLCS)) {
// We've reached the first element from the LCS in target. Insert here
insertionIndex = i;
}
@@ -391,7 +391,7 @@ public final class DiffUtil {
*/
for (int i = 0; i < target.size() && insertionIndex == -1; i++) {
final E targetElement = target.get(i);
- if (equalityHelper.matchingValues(comparison, targetElement, lastLCS)) {
+ if (equalityHelper.matchingValues(targetElement, lastLCS)) {
// We've reached the last element of the LCS in target. insert after it.
insertionIndex = i + 1;
}
@@ -413,7 +413,7 @@ public final class DiffUtil {
for (int j = 0; j < lcs.size() && !isInLCS; j++) {
final E lcsElement = lcs.get(j);
- if (equalityHelper.matchingValues(comparison, sourceElement, lcsElement)) {
+ if (equalityHelper.matchingValues(sourceElement, lcsElement)) {
isInLCS = true;
}
}
@@ -427,7 +427,7 @@ public final class DiffUtil {
for (int i = 0; i < target.size() && insertionIndex == -1; i++) {
final E targetElement = target.get(i);
- if (equalityHelper.matchingValues(comparison, targetElement, subsequenceStart)) {
+ if (equalityHelper.matchingValues(targetElement, subsequenceStart)) {
insertionIndex = i + 1;
}
}
@@ -643,12 +643,12 @@ public final class DiffUtil {
* {@code false} otherwise.
* @see EqualityHelper#matchingValues(Comparison, Object, Object)
*/
- private static <E> boolean contains(Comparison comparison, EqualityHelper equalityHelper,
+ private static <E> boolean contains(Comparison comparison, IEqualityHelper equalityHelper,
Iterable<E> sequence, E element) {
final Iterator<E> iterator = sequence.iterator();
while (iterator.hasNext()) {
E candidate = iterator.next();
- if (equalityHelper.matchingValues(comparison, candidate, element)) {
+ if (equalityHelper.matchingValues(candidate, element)) {
return true;
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EMFComparePredicates.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EMFComparePredicates.java
index 8ba3615a5..d95b32808 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EMFComparePredicates.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EMFComparePredicates.java
@@ -529,8 +529,8 @@ public final class EMFComparePredicates {
&& ((AttributeChange)input).getAttribute().getName().equals(attributeName)
&& ((AttributeChange)input).getAttribute().isMany() == multiValued) {
final Object value = ((AttributeChange)input).getValue();
- return input.getMatch().getComparison().getConfiguration().getEqualityHelper()
- .matchingAttributeValues(value, expectedValue);
+ return input.getMatch().getComparison().getEqualityHelper().matchingAttributeValues(
+ value, expectedValue);
}
return false;
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
index d470238ef..df78b1261 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
@@ -18,6 +18,7 @@ import com.google.common.cache.CacheLoader;
import java.lang.reflect.Array;
import java.util.concurrent.ExecutionException;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Match;
@@ -32,10 +33,38 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
-public class EqualityHelper {
+public class EqualityHelper extends AdapterImpl implements IEqualityHelper {
/** A cache keeping track of the URIs for EObjects. */
- private Cache<EObject, URI> uriCache = CacheBuilder.newBuilder().build(
- CacheLoader.from(new URICacheFunction()));
+ private final Cache<EObject, URI> uriCache;
+
+ /**
+ * Creates a new EqualityHelper.
+ */
+ @Deprecated
+ public EqualityHelper() {
+ // TODO: use weak keys ? be careful of the use of identity == instead of .equals()
+ this(createDefaultCache(CacheBuilder.newBuilder()));
+ }
+
+ /**
+ * Creates a new EqualityHelper with the given cache.
+ *
+ * @param uriCache
+ * the cache to be used for {@link EcoreUtil#getURI(EObject)} calls.
+ */
+ public EqualityHelper(Cache<EObject, URI> uriCache) {
+ this.uriCache = uriCache;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.impl.AdapterImpl#getTarget()
+ */
+ @Override
+ public Comparison getTarget() {
+ return (Comparison)super.getTarget();
+ }
/**
* Check that the two given values are "equal", considering the specifics of EMF.
@@ -47,8 +76,19 @@ public class EqualityHelper {
* @param object2
* Second of the two objects to compare here.
* @return <code>true</code> if both objects are to be considered equal, <code>false</code> otherwise.
+ * @see #matchingValues(Object, Object)
*/
+ @Deprecated
public boolean matchingValues(Comparison comparison, Object object1, Object object2) {
+ return matchingValues(object1, object2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.utils.IEqualityHelper#matchingValues(java.lang.Object, java.lang.Object)
+ */
+ public boolean matchingValues(Object object1, Object object2) {
final boolean equal;
final Object converted1 = internalFindActualObject(object1);
final Object converted2 = internalFindActualObject(object2);
@@ -62,11 +102,11 @@ public class EqualityHelper {
equal = value1.equals(value2);
} else if (converted1 instanceof EObject && converted2 instanceof EObject) {
// [248442] This will handle FeatureMapEntries detection
- equal = matchingEObjects(comparison, (EObject)converted1, (EObject)converted2);
+ equal = matchingEObjects((EObject)converted1, (EObject)converted2);
} else if (converted1 != null && converted1.getClass().isArray() && converted2 != null
&& converted2.getClass().isArray()) {
// [299641] compare arrays by their content instead of instance equality
- equal = matchingArrays(comparison, converted1, converted2);
+ equal = matchingArrays2(converted1, converted2);
} else if (isNullOrEmptyString(converted1) && isNullOrEmptyString(converted2)) {
// Special case, consider that the empty String is equal to null (unset attributes)
equal = true;
@@ -90,15 +130,13 @@ public class EqualityHelper {
/**
* Compares two values as arrays, checking that their length and content match each other.
*
- * @param comparison
- * Provides us with the Match necessary for EObject comparison.
* @param object1
* First of the two objects to compare here.
* @param object2
* Second of the two objects to compare here.
* @return <code>true</code> if these two arrays are to be considered equal, <code>false</code> otherwise.
*/
- private boolean matchingArrays(Comparison comparison, Object object1, Object object2) {
+ private boolean matchingArrays2(Object object1, Object object2) {
boolean equal = true;
final int length1 = Array.getLength(object1);
if (length1 != Array.getLength(object2)) {
@@ -107,7 +145,7 @@ public class EqualityHelper {
for (int i = 0; i < length1 && equal; i++) {
final Object element1 = Array.get(object1, i);
final Object element2 = Array.get(object2, i);
- equal = matchingValues(comparison, element1, element2);
+ equal = matchingValues(getTarget(), element1, element2);
}
}
return equal;
@@ -117,8 +155,6 @@ public class EqualityHelper {
* Compares two values as EObjects, using their Match if it can be found, comparing through their URIs
* otherwise.
*
- * @param comparison
- * Provides us with the Match necessary for EObject comparison.
* @param object1
* First of the two objects to compare here.
* @param object2
@@ -126,8 +162,8 @@ public class EqualityHelper {
* @return <code>true</code> if these two EObjects are to be considered equal, <code>false</code>
* otherwise.
*/
- private boolean matchingEObjects(Comparison comparison, EObject object1, EObject object2) {
- final Match match = comparison.getMatch(object1);
+ private boolean matchingEObjects(EObject object1, EObject object2) {
+ final Match match = getTarget().getMatch(object1);
final boolean equal;
// Match could be null if the value is out of the scope
@@ -157,15 +193,10 @@ public class EqualityHelper {
}
/**
- * This should only be used when no {@link Comparison} is available or if the two given Objects are known
- * not to be instances of EObjects. EObjects passed for comparison through here will be compared through
- * their {@link Object#equals(Object)} implementation.
+ * {@inheritDoc}
*
- * @param object1
- * First of the two objects to compare here.
- * @param object2
- * Second of the two objects to compare here.
- * @return <code>true</code> if both objects are to be considered equal, <code>false</code> otherwise.
+ * @see org.eclipse.emf.compare.utils.IEqualityHelper#matchingAttributeValues(java.lang.Object,
+ * java.lang.Object)
*/
public boolean matchingAttributeValues(Object object1, Object object2) {
final boolean equal;
@@ -225,6 +256,7 @@ public class EqualityHelper {
* any EObject.
* @return the URI of the given EObject, or {@code null} if we somehow could not compute it.
*/
+ @Deprecated
public URI getURI(EObject object) {
try {
return uriCache.get(object);
@@ -234,6 +266,16 @@ public class EqualityHelper {
}
/**
+ * Returns the cache used by this object.
+ *
+ * @return the cache used by this object.
+ */
+ @Deprecated
+ public Cache<EObject, URI> getCache() {
+ return uriCache;
+ }
+
+ /**
* This will convert any Feature map entry to its actual data value. Note that it will have no effect on
* an object that is not a {@link FeatureMap.Entry}.
*
@@ -250,6 +292,17 @@ public class EqualityHelper {
}
/**
+ * Create a cache as required by EqualityHelper.
+ *
+ * @param cacheBuilder
+ * The builder to use to instantiate the cache.
+ * @return the new cache.
+ */
+ public static Cache<EObject, URI> createDefaultCache(CacheBuilder<Object, Object> cacheBuilder) {
+ return cacheBuilder.build(CacheLoader.from(new URICacheFunction()));
+ }
+
+ /**
* This is the function that will be used by our {@link #uriCache} to compute its values.
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/IEqualityHelper.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/IEqualityHelper.java
new file mode 100644
index 000000000..56da843b7
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/IEqualityHelper.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.utils;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.compare.Comparison;
+
+/**
+ * Use to compare objects by the {@link org.eclipse.emf.compare.match.IMatchEngine}.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public interface IEqualityHelper extends Adapter {
+
+ /**
+ * Check that the two given values are "equal", considering the specifics of EMF.
+ *
+ * @param object1
+ * First of the two objects to compare here.
+ * @param object2
+ * Second of the two objects to compare here.
+ * @return <code>true</code> if both objects are to be considered equal, <code>false</code> otherwise.
+ */
+ boolean matchingValues(Object object1, Object object2);
+
+ /**
+ * This should only be used if the two given Objects are known not to be instances of EObjects. EObjects
+ * passed for comparison through here will be compared through their {@link Object#equals(Object)}
+ * implementation.
+ *
+ * @param object1
+ * First of the two objects to compare here.
+ * @param object2
+ * Second of the two objects to compare here.
+ * @return <code>true</code> if both objects are to be considered equal, <code>false</code> otherwise.
+ */
+ boolean matchingAttributeValues(Object object1, Object object2);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ */
+ Comparison getTarget();
+
+}

Back to the top