Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2012-10-15 07:43:07 +0000
committerMikaël Barbero2012-10-15 07:43:07 +0000
commitf4cdf5a35a514a28f016e8f57722b9bc67a322f8 (patch)
treee5d6339f9194359790875129bfceb7ca27292f5d
parent07215479ecce8809aaae1d55af967a9ae0f0a1cd (diff)
downloadorg.eclipse.emf.compare-f4cdf5a35a514a28f016e8f57722b9bc67a322f8.tar.gz
org.eclipse.emf.compare-f4cdf5a35a514a28f016e8f57722b9bc67a322f8.tar.xz
org.eclipse.emf.compare-f4cdf5a35a514a28f016e8f57722b9bc67a322f8.zip
add Monitor to all computing methods.
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffExtensionPostProcessor.java11
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java11
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/DiffStatement.java19
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/framework/junit/internal/MatchStatement.java14
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java21
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java40
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java106
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java20
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java26
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/IConflictDetector.java5
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java36
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/IDiffEngine.java6
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java26
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/IEquiEngine.java6
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java21
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java51
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/IMatchEngine.java9
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/IdentifierEObjectMatcher.java93
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java25
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/IReqEngine.java9
20 files changed, 169 insertions, 386 deletions
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffExtensionPostProcessor.java
index 571ad6381..49eb12e21 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffExtensionPostProcessor.java
@@ -7,6 +7,7 @@ import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Conflict;
@@ -34,27 +35,27 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
// TODO Auto-generated constructor stub
}
- public void postMatch(Comparison comparison) {
+ public void postMatch(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postDiff(Comparison comparison) {
+ public void postDiff(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postRequirements(Comparison comparison) {
+ public void postRequirements(Comparison comparison, Monitor monitor) {
// computeLabels
computeLabels(comparison);
}
- public void postEquivalences(Comparison comparison) {
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postConflicts(Comparison comparison) {
+ public void postConflicts(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java
index b78898e0e..41b312b53 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java
@@ -4,6 +4,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+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;
@@ -20,17 +21,17 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
// TODO Auto-generated constructor stub
}
- public void postMatch(Comparison comparison) {
+ public void postMatch(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postDiff(Comparison comparison) {
+ public void postDiff(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postRequirements(Comparison comparison) {
+ public void postRequirements(Comparison comparison, Monitor monitor) {
final Map<Class<? extends Diff>, IDiffExtensionFactory> mapUml2ExtensionFactories = DiffExtensionFactoryRegistry
.createExtensionFactories();
diagramExtensionFactories = new HashSet<IDiffExtensionFactory>(mapUml2ExtensionFactories.values());
@@ -52,12 +53,12 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
}
}
- public void postEquivalences(Comparison comparison) {
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
- public void postConflicts(Comparison comparison) {
+ public void postConflicts(Comparison comparison, Monitor monitor) {
// TODO Auto-generated method stub
}
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 4fff6a5c9..e086bc7de 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,15 +10,16 @@
*/
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;
+import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.EMFCompare;
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.match.DefaultComparisonFactory;
+import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.EditionDistance;
@@ -82,8 +83,8 @@ public class DiffStatement extends Statement {
final IComparisonScope scope = createComparisonScope(tuple, annotation);
final IMatchEngine matchEngine = createMatchEngine(annotation);
final IDiffEngine diffEngine = createDiffEngine(annotation);
- final Comparison comparison = matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
- diffEngine.diff(comparison);
+ final Comparison comparison = matchEngine.match(scope, new BasicMonitor());
+ diffEngine.diff(comparison, new BasicMonitor());
test.invokeExplosively(testObject, scope, comparison);
}
@@ -109,9 +110,11 @@ public class DiffStatement extends Statement {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
- final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder().build());
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder()
+ .build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
- engine = new DefaultMatchEngine(matcher);
+ engine = new DefaultMatchEngine(matcher, new DefaultComparisonFactory(
+ new DefaultEqualityHelperFactory()));
}
return engine;
}
@@ -137,7 +140,7 @@ public class DiffStatement extends Statement {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
- engine = new DefaultDiffEngine();
+ engine = new DefaultDiffEngine(new DiffBuilder());
}
return engine;
}
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 6093b9069..9f4e346f4 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,14 +10,14 @@
*/
package org.eclipse.emf.compare.tests.framework.junit.internal;
-import com.google.common.cache.CacheBuilder;
-
import java.lang.reflect.Constructor;
import java.util.List;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.match.DefaultComparisonFactory;
+import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.EditionDistance;
@@ -89,7 +89,7 @@ public class MatchStatement extends Statement {
final MatchTest annotation = test.getAnnotation(MatchTest.class);
final IMatchEngine engine = createMatchEngine(annotation);
final IComparisonScope scope = createComparisonScope(tuple, annotation);
- final Comparison comparison = engine.match(scope, EMFCompare.createDefaultConfiguration());
+ final Comparison comparison = engine.match(scope, new BasicMonitor());
test.invokeExplosively(testObject, scope, comparison);
}
@@ -115,9 +115,11 @@ public class MatchStatement extends Statement {
// Swallow : we'll create a default engine instead.
}
if (engine == null) {
- final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder().build());
+ final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder()
+ .build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
- engine = new DefaultMatchEngine(matcher);
+ engine = new DefaultMatchEngine(matcher, new DefaultComparisonFactory(
+ new DefaultEqualityHelperFactory()));
}
return engine;
}
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 1f1251fcf..b238307dc 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,11 +10,11 @@
*/
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.common.util.BasicMonitor;
+import org.eclipse.emf.compare.match.DefaultComparisonFactory;
+import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.EditionDistance;
@@ -65,28 +65,31 @@ public class MatchPerformanceComparisonTest {
public void warmup() throws IOException {
final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder().build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
- IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
+ IMatchEngine matchEngine = new DefaultMatchEngine(matcher, new DefaultComparisonFactory(
+ new DefaultEqualityHelperFactory()));
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
- matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
+ matchEngine.match(scope, new BasicMonitor());
}
@Test
public void matchPerIdAlmostIdenticalModels() throws IOException {
final IEObjectMatcher matcher = new IdentifierEObjectMatcher();
- IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
+ IMatchEngine matchEngine = new DefaultMatchEngine(matcher, new DefaultComparisonFactory(
+ new DefaultEqualityHelperFactory()));
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
for (int i = 0; i < nbIterations; i++) {
- matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
+ matchEngine.match(scope, new BasicMonitor());
}
}
@Test
public void matchPerContentAlmostIdenticalModels() throws IOException {
final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder().build());
- IMatchEngine matchEngine = new DefaultMatchEngine(contentMatcher);
+ IMatchEngine matchEngine = new DefaultMatchEngine(contentMatcher, new DefaultComparisonFactory(
+ new DefaultEqualityHelperFactory()));
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
for (int i = 0; i < nbIterations; i++) {
- matchEngine.match(scope, EMFCompare.createDefaultConfiguration());
+ matchEngine.match(scope, new BasicMonitor());
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
index 210807c58..f13261d4e 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.tests.postprocess.data;
import java.util.List;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Match;
@@ -25,12 +26,7 @@ import org.eclipse.emf.compare.extension.IPostProcessor;
*/
public class TestPostProcessor implements IPostProcessor {
- /**
- * {@inheritDoc}.
- *
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison)
- */
- public void postMatch(Comparison comparison) {
+ public void postMatch(Comparison comparison, Monitor monitor) {
final List<Match> matches = comparison.getMatches();
final Match lastMatch = matches.get(matches.size() - 1);
final Match copyLastMatch = CompareFactory.eINSTANCE.createMatch();
@@ -41,38 +37,46 @@ public class TestPostProcessor implements IPostProcessor {
}
/**
- * {@inheritDoc}.
+ * {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison)
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
- public void postDiff(Comparison comparison) {
+ public void postConflicts(Comparison comparison, Monitor monitor) {
+ // TODO Auto-generated method stub
}
/**
- * {@inheritDoc}.
+ * {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison)
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
- public void postRequirements(Comparison comparison) {
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
+ // TODO Auto-generated method stub
}
/**
- * {@inheritDoc}.
+ * {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison)
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
- public void postEquivalences(Comparison comparison) {
+ public void postRequirements(Comparison comparison, Monitor monitor) {
+ // TODO Auto-generated method stub
}
/**
- * {@inheritDoc}.
+ * {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison)
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
- public void postConflicts(Comparison comparison) {
+ public void postDiff(Comparison comparison, Monitor monitor) {
+ // TODO Auto-generated method stub
}
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 94fc161ab..c5f675cc9 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,7 +4,6 @@ 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;
@@ -28,25 +27,8 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison)
- * @see #postMatch(Comparison, Monitor)
- */
- @Deprecated
- public void postMatch(Comparison comparison) {
- 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
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void postMatch(Comparison comparison, Monitor monitor) {
@@ -55,25 +37,8 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@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
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void postDiff(Comparison comparison, Monitor monitor) {
@@ -82,25 +47,8 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@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
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void postRequirements(Comparison comparison, Monitor monitor) {
final Map<Class<? extends Diff>, IDiffExtensionFactory> mapUml2ExtensionFactories = DiffExtensionFactoryRegistry
@@ -127,25 +75,8 @@ 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) {
- 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
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void postEquivalences(Comparison comparison, Monitor monitor) {
@@ -154,25 +85,8 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison)
- * @see #postConflicts(Comparison, Monitor)
- */
- @Deprecated
- public void postConflicts(Comparison comparison) {
- 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
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void postConflicts(Comparison comparison, Monitor monitor) {
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 e4388777e..63c557e8a 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
@@ -176,37 +176,37 @@ public class EMFCompare {
"ConflictDetector must not be null to compute a 3-way comparison");
}
- final Comparison comparison = matchEngine.match(scope, null/* monitor */);
+ final Comparison comparison = matchEngine.match(scope, monitor);
IPostProcessor postProcessor = postProcessorRegistry.getPostProcessor(scope);
if (postProcessor != null) {
- postProcessor.postMatch(comparison/* , monitor */);
+ postProcessor.postMatch(comparison, monitor);
}
- diffEngine.diff(comparison/* , monitor */);
+ diffEngine.diff(comparison, monitor);
if (postProcessor != null) {
- postProcessor.postDiff(comparison/* , monitor */);
+ postProcessor.postDiff(comparison, monitor);
}
- reqEngine.computeRequirements(comparison/* , monitor */);
+ reqEngine.computeRequirements(comparison, monitor);
if (postProcessor != null) {
- postProcessor.postRequirements(comparison/* , monitor */);
+ postProcessor.postRequirements(comparison, monitor);
}
- equiEngine.computeEquivalences(comparison/* , monitor */);
+ equiEngine.computeEquivalences(comparison, monitor);
if (postProcessor != null) {
- postProcessor.postEquivalences(comparison/* , monitor */);
+ postProcessor.postEquivalences(comparison, monitor);
}
if (comparison.isThreeWay()) {
- conflictDetector.detect(comparison/* , monitor */);
+ conflictDetector.detect(comparison, monitor);
if (postProcessor != null) {
- postProcessor.postConflicts(comparison/* , monitor */);
+ postProcessor.postConflicts(comparison, monitor);
}
}
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 50dd04b93..dac86321e 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,7 +21,6 @@ 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;
@@ -55,29 +54,8 @@ public class DefaultConflictDetector implements IConflictDetector {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.conflict.IConflictDetector#detect(org.eclipse.emf.compare.Comparison)
- * @see #detect(Comparison, Monitor)
- */
- @Deprecated
- public void detect(Comparison comparison) {
- 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
+ * @see org.eclipse.emf.compare.conflict.IConflictDetector#detect(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void detect(Comparison comparison, Monitor monitor) {
final List<Diff> differences = comparison.getDifferences();
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/IConflictDetector.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/IConflictDetector.java
index ead51d1cb..a5ecfeea4 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/IConflictDetector.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/IConflictDetector.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.conflict;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
/**
@@ -38,6 +39,8 @@ public interface IConflictDetector {
*
* @param comparison
* The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void detect(Comparison comparison);
+ void detect(Comparison comparison, Monitor monitor);
}
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 2223c1d33..6914cb921 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,7 +20,6 @@ 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;
@@ -59,16 +58,6 @@ public class DefaultDiffEngine implements IDiffEngine {
private IDiffProcessor diffProcessor;
/**
- * Create the diff engine setting up the default behavior.
- *
- * @see #DefaultDiffEngine(IDiffProcessor).
- */
- @Deprecated
- public DefaultDiffEngine() {
- this(new DiffBuilder());
- }
-
- /**
* Create the diff engine.
*
* @param processor
@@ -125,29 +114,8 @@ 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) {
- 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.
+ * @see org.eclipse.emf.compare.diff.IDiffEngine#diff(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
*/
public void diff(Comparison comparison, Monitor monitor) {
for (Match rootMatch : comparison.getMatches()) {
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/IDiffEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/IDiffEngine.java
index 37ec9b27c..e78788a59 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/IDiffEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/IDiffEngine.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.diff;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
/**
@@ -29,6 +30,7 @@ import org.eclipse.emf.compare.Comparison;
* @see DefaultDiffEngine
*/
public interface IDiffEngine {
+
/**
* This is the entry point of the differencing process.
* <p>
@@ -39,6 +41,8 @@ public interface IDiffEngine {
*
* @param comparison
* The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation.
*/
- void diff(Comparison comparison);
+ void diff(Comparison comparison, Monitor monitor);
}
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 672c2b9d5..afc7e68c8 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,7 +14,6 @@ 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;
@@ -41,28 +40,9 @@ public class DefaultEquiEngine implements IEquiEngine {
/**
* {@inheritDoc}
*
- * @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
+ * @see org.eclipse.emf.compare.equi.IEquiEngine#computeEquivalences(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ * @since 3.0
*/
public void computeEquivalences(Comparison comparison, Monitor monitor) {
for (Diff difference : comparison.getDifferences()) {
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/IEquiEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/IEquiEngine.java
index f03dfaef4..3036f6ac0 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/IEquiEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/IEquiEngine.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.equi;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
/**
@@ -29,6 +30,9 @@ public interface IEquiEngine {
*
* @param comparison
* The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
- void computeEquivalences(Comparison comparison);
+ void computeEquivalences(Comparison comparison, Monitor monitor);
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
index a03f0791b..0d0309966 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.extension;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
/**
@@ -26,8 +27,10 @@ public interface IPostProcessor {
*
* @param comparison
* The comparison after the match step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void postMatch(Comparison comparison);
+ void postMatch(Comparison comparison, Monitor monitor);
/**
* This will be called by EMF Compare in order to execute the specified behavior after the difference
@@ -35,8 +38,10 @@ public interface IPostProcessor {
*
* @param comparison
* The comparison after the difference step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void postDiff(Comparison comparison);
+ void postDiff(Comparison comparison, Monitor monitor);
/**
* This will be called by EMF Compare in order to execute the specified behavior after the requirements
@@ -44,8 +49,10 @@ public interface IPostProcessor {
*
* @param comparison
* The comparison after the requirements step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void postRequirements(Comparison comparison);
+ void postRequirements(Comparison comparison, Monitor monitor);
/**
* This will be called by EMF Compare in order to execute the specified behavior after the equivalences
@@ -53,8 +60,10 @@ public interface IPostProcessor {
*
* @param comparison
* The comparison after the equivalences step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void postEquivalences(Comparison comparison);
+ void postEquivalences(Comparison comparison, Monitor monitor);
/**
* This will be called by EMF Compare in order to execute the specified behavior after the conflicts step,
@@ -62,7 +71,9 @@ public interface IPostProcessor {
*
* @param comparison
* The comparison after the conflicts step.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
*/
- void postConflicts(Comparison comparison);
+ void postConflicts(Comparison comparison, Monitor monitor);
}
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 40978ba65..9a578fb46 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
@@ -21,12 +21,10 @@ import java.util.Iterator;
import java.util.List;
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;
@@ -67,20 +65,9 @@ public class DefaultMatchEngine implements IMatchEngine {
*
* @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) {
- 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.
+ * @since 3.0
*/
public DefaultMatchEngine(IEObjectMatcher matcher, IComparisonFactory comparisonFactory) {
this.eObjectMatcher = checkNotNull(matcher);
@@ -90,35 +77,9 @@ public class DefaultMatchEngine implements IMatchEngine {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.match.IMatchEngine#match(IComparisonScope, Monitor)
- */
- @Deprecated
- public Comparison match(IComparisonScope scope, EMFCompareConfiguration configuration) {
- final Monitor monitor;
- if (configuration != null) {
- monitor = configuration.getMonitor();
- } else {
- monitor = new BasicMonitor();
- }
- return match(scope, monitor);
- }
-
- /**
- * 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.
+ * @see org.eclipse.emf.compare.match.IMatchEngine#match(org.eclipse.emf.compare.scope.IComparisonScope,
+ * org.eclipse.emf.common.util.Monitor)
+ * @since 3.0
*/
public Comparison match(IComparisonScope scope, Monitor monitor) {
Comparison comparison = comparisonFactory.createComparison();
@@ -406,12 +367,12 @@ public class DefaultMatchEngine implements IMatchEngine {
* the kinds of matcher to use.
* @return a new {@link DefaultMatchEngine} instance.
*/
- public static DefaultMatchEngine create(UseIdentifiers useIDs) {
+ public static IMatchEngine create(UseIdentifiers useIDs) {
final IComparisonFactory comparisonFactory = new DefaultComparisonFactory(
new DefaultEqualityHelperFactory());
final IEObjectMatcher matcher = createDefaultEObjectMatcher(useIDs);
- final DefaultMatchEngine matchEngine = new DefaultMatchEngine(matcher, comparisonFactory);
+ final IMatchEngine matchEngine = new DefaultMatchEngine(matcher, comparisonFactory);
return matchEngine;
}
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 979e6b83d..8617c1839 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
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.emf.compare.match;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.EMFCompareConfiguration;
import org.eclipse.emf.compare.scope.IComparisonScope;
/**
@@ -36,6 +36,7 @@ import org.eclipse.emf.compare.scope.IComparisonScope;
* @see DefaultMatchEngine
*/
public interface IMatchEngine {
+
/**
* 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.
@@ -46,10 +47,10 @@ public interface IMatchEngine {
*
* @param scope
* The comparison scope that should be used by this engine to determine the objects to match.
- * @param configuration
- * The configuration object from which the engine will be configured.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
* @return An initialized {@link Comparison} model with all matches determined.
*/
- Comparison match(IComparisonScope scope, EMFCompareConfiguration configuration);
+ Comparison match(IComparisonScope scope, Monitor monitor);
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/IdentifierEObjectMatcher.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/IdentifierEObjectMatcher.java
index b671f322d..c05566bf4 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/IdentifierEObjectMatcher.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/IdentifierEObjectMatcher.java
@@ -55,21 +55,44 @@ public class IdentifierEObjectMatcher implements IEObjectMatcher {
private Function<EObject, String> idComputation = new DefaultIDFunction();
/**
- * Create an ID based matcher without any delegate.
+ * Creates an ID based matcher without any delegate.
*/
public IdentifierEObjectMatcher() {
- this.delegate = Optional.absent();
+ this(null, new DefaultIDFunction());
+ }
+
+ /**
+ * Creates an ID based matcher with the given delegate when no ID can be found.
+ *
+ * @param delegateWhenNoID
+ * the matcher to delegate to when no ID is found.
+ */
+ public IdentifierEObjectMatcher(IEObjectMatcher delegateWhenNoID) {
+ this(delegateWhenNoID, new DefaultIDFunction());
+ }
+
+ /**
+ * Creates an ID based matcher computing the ID with the given function.
+ *
+ * @param idComputation
+ * the function used to compute the ID.
+ */
+ public IdentifierEObjectMatcher(Function<EObject, String> idComputation) {
+ this(null, idComputation);
}
/**
* Create an ID based matcher with a delegate which is going to be called when no ID is found for a given
- * EObject.
+ * EObject. It is computing the ID with the given function
*
* @param delegateWhenNoID
* the delegate matcher to use when no ID is found.
+ * @param idComputation
+ * the function used to compute the ID.
*/
- public IdentifierEObjectMatcher(IEObjectMatcher delegateWhenNoID) {
- this.delegate = Optional.of(delegateWhenNoID);
+ public IdentifierEObjectMatcher(IEObjectMatcher delegateWhenNoID, Function<EObject, String> idComputation) {
+ this.delegate = Optional.fromNullable(delegateWhenNoID);
+ this.idComputation = idComputation;
}
/**
@@ -273,64 +296,4 @@ public class IdentifierEObjectMatcher implements IEObjectMatcher {
return identifier;
}
}
-
- /**
- * Returns a new Builder to construct an {@link IdentifierEObjectMatcher}.
- *
- * @return the new Builder instance.
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * An utility class to configure an instance of {@link IdentifierEObjectMatcher}.
- */
- public static class Builder {
- /**
- * The instance under construction.
- */
- private IdentifierEObjectMatcher toBe;
-
- /**
- * Create the builder.
- */
- public Builder() {
- this.toBe = new IdentifierEObjectMatcher();
- }
-
- /**
- * Specify the function to use to compute the ID of an EObject.
- *
- * @param idFunction
- * the function to use to compute the IDs.
- * @return the current builder to ease chain calls.
- */
- public Builder idFunction(Function<EObject, String> idFunction) {
- this.toBe.idComputation = idFunction;
- return this;
- }
-
- /**
- * Specify the delegate to call when no ID is found.
- *
- * @param delegateWhenNoID
- * the matcher to call when no id is found.
- * @return the current builder to ease chain calls.
- */
- public Builder delegateWhenNoId(IEObjectMatcher delegateWhenNoID) {
- this.toBe.delegate = Optional.of(delegateWhenNoID);
- return this;
- }
-
- /**
- * return the instance under construction.
- *
- * @return the instance under construction.
- */
- public IdentifierEObjectMatcher build() {
- return this.toBe;
- }
-
- }
}
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 f69c65b98..3641d353b 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
@@ -21,7 +21,6 @@ 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;
@@ -50,29 +49,7 @@ 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
+ * @see org.eclipse.emf.compare.req.IReqEngine#computeRequirements(Comparison, Monitor)
*/
public void computeRequirements(Comparison comparison, Monitor monitor) {
for (Diff difference : comparison.getDifferences()) {
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/IReqEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/IReqEngine.java
index d9c6c8e5d..451780775 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/IReqEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/IReqEngine.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.req;
+import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
/**
@@ -28,16 +29,20 @@ import org.eclipse.emf.compare.Comparison;
* @see DefaultReqEngine
*/
public interface IReqEngine {
+
/**
* 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
+ * {@link org.eclipse.emf.compare.Diff differences} it contains, filling in the requirements it can detect
* for each distinct Diff.
* </p>
*
* @param comparison
* The comparison this engine is expected to complete.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
- void computeRequirements(Comparison comparison);
+ void computeRequirements(Comparison comparison, Monitor monitor);
}

Back to the top