Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-04-06 18:00:27 +0000
committerEike Stepper2013-04-06 18:00:27 +0000
commit093c097cb4f5c3845d85d11eb2c1015292fe31fc (patch)
tree9d9f0df915157dd70d46b9fc57916947171eaaa9 /plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo
parentee8267e20d6304affe2a1567adaee0e2282f883d (diff)
downloadcdo-093c097cb4f5c3845d85d11eb2c1015292fe31fc.tar.gz
cdo-093c097cb4f5c3845d85d11eb2c1015292fe31fc.tar.xz
cdo-093c097cb4f5c3845d85d11eb2c1015292fe31fc.zip
[405084] NoSuchMethodError:drops/I20130406-1405
org.eclipse.emf.compare.EMFCompare$Builder.setMatchEngine() https://bugs.eclipse.org/bugs/show_bug.cgi?id=405084
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo')
-rw-r--r--plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo/compare/CDOCompare.java62
1 files changed, 56 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo/compare/CDOCompare.java b/plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo/compare/CDOCompare.java
index 2e7093dbe6..975e6c6168 100644
--- a/plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo/compare/CDOCompare.java
+++ b/plugins/org.eclipse.emf.cdo.compare/src/org/eclipse/emf/cdo/compare/CDOCompare.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.compare.match.IEqualityHelperFactory;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
import org.eclipse.emf.compare.match.eobject.IdentifierEObjectMatcher;
+import org.eclipse.emf.compare.match.impl.MatchEngineFactoryRegistryImpl;
import org.eclipse.emf.compare.postprocessor.IPostProcessor;
import org.eclipse.emf.compare.req.IReqEngine;
import org.eclipse.emf.compare.scope.IComparisonScope;
@@ -85,10 +86,11 @@ public class CDOCompare
{
Builder builder = EMFCompare.builder();
- IMatchEngine matchEngine = createMatchEngine(matcher, comparisonFactory);
- if (matchEngine != null)
+ IMatchEngine.Factory.Registry matchEngineFactoryRegistry = createMatchEngineFactoryRegistry(matcher,
+ comparisonFactory);
+ if (matchEngineFactoryRegistry != null)
{
- builder.setMatchEngine(matchEngine);
+ builder.setMatchEngineFactoryRegistry(matchEngineFactoryRegistry);
}
IDiffEngine diffEngine = createDiffEngine();
@@ -124,9 +126,12 @@ public class CDOCompare
return builder.build();
}
- protected CDOMatchEngine createMatchEngine(IEObjectMatcher matcher, IComparisonFactory comparisonFactory)
+ protected IMatchEngine.Factory.Registry createMatchEngineFactoryRegistry(IEObjectMatcher matcher,
+ IComparisonFactory comparisonFactory)
{
- return new CDOMatchEngine(matcher, comparisonFactory);
+ IMatchEngine.Factory.Registry registry = new MatchEngineFactoryRegistryImpl();
+ registry.add(new CDOMatchEngine.Factory(matcher, comparisonFactory));
+ return registry;
}
protected IDiffEngine createDiffEngine()
@@ -188,7 +193,7 @@ public class CDOCompare
*
* @author Eike Stepper
*/
- public static final class CDOMatchEngine extends DefaultMatchEngine
+ public static class CDOMatchEngine extends DefaultMatchEngine
{
CDOMatchEngine(IEObjectMatcher matcher, IComparisonFactory comparisonFactory)
{
@@ -201,6 +206,51 @@ public class CDOCompare
{
match(comparison, scope, (EObject)left, (EObject)right, (EObject)origin, monitor);
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Factory implements IMatchEngine.Factory
+ {
+ private final IMatchEngine matchEngine;
+
+ private int ranking;
+
+ public Factory(IEObjectMatcher matcher, IComparisonFactory comparisonFactory)
+ {
+ matchEngine = createMatchEngine(matcher, comparisonFactory);
+ }
+
+ protected Factory(IMatchEngine matchEngine)
+ {
+ this.matchEngine = matchEngine;
+ }
+
+ protected CDOMatchEngine createMatchEngine(IEObjectMatcher matcher, IComparisonFactory comparisonFactory)
+ {
+ return new CDOMatchEngine(matcher, comparisonFactory);
+ }
+
+ public IMatchEngine getMatchEngine()
+ {
+ return matchEngine;
+ }
+
+ public int getRanking()
+ {
+ return ranking;
+ }
+
+ public void setRanking(int ranking)
+ {
+ this.ranking = ranking;
+ }
+
+ public boolean isMatchEngineFactoryFor(IComparisonScope scope)
+ {
+ return scope instanceof CDOComparisonScope;
+ }
+ }
}
/**

Back to the top