Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2019-06-07 15:00:57 -0400
committerOlivier Constant2019-06-10 03:47:03 -0400
commit88071697ed1cfbba1e8a3ff5471864dc68d71c2d (patch)
treeec3a1f4aaee7817fc3b725a8ffcfe97ce80a9564
parent19aab425d7da198c151be6fc88c0e5ceed3c0f4a (diff)
downloadorg.eclipse.emf.diffmerge.core-88071697ed1cfbba1e8a3ff5471864dc68d71c2d.tar.gz
org.eclipse.emf.diffmerge.core-88071697ed1cfbba1e8a3ff5471864dc68d71c2d.tar.xz
org.eclipse.emf.diffmerge.core-88071697ed1cfbba1e8a3ff5471864dc68d71c2d.zip
Bug 548072 - [Regression] Git-based comparison fails
Change-Id: I0603a62798bbe318e0ec20b4ccac45c437108ac4 Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
-rw-r--r--plugins/org.eclipse.emf.diffmerge.connector.core/src/org/eclipse/emf/diffmerge/connector/core/ext/AbstractURIConvertingScopeDefinitionFactory.java3
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/ComparisonSetupManager.java16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/specification/IModelScopeDefinitionFactory.java8
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.ui/.project11
4 files changed, 33 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.connector.core/src/org/eclipse/emf/diffmerge/connector/core/ext/AbstractURIConvertingScopeDefinitionFactory.java b/plugins/org.eclipse.emf.diffmerge.connector.core/src/org/eclipse/emf/diffmerge/connector/core/ext/AbstractURIConvertingScopeDefinitionFactory.java
index 1ecc70d8..8335508c 100644
--- a/plugins/org.eclipse.emf.diffmerge.connector.core/src/org/eclipse/emf/diffmerge/connector/core/ext/AbstractURIConvertingScopeDefinitionFactory.java
+++ b/plugins/org.eclipse.emf.diffmerge.connector.core/src/org/eclipse/emf/diffmerge/connector/core/ext/AbstractURIConvertingScopeDefinitionFactory.java
@@ -35,7 +35,8 @@ import org.eclipse.emf.ecore.resource.URIConverter;
* the URI. The scope definition obtained through that factory is wrapped into a dedicated
* scope definition that alters its behavior through a URIConverter.
*/
-public abstract class AbstractURIConvertingScopeDefinitionFactory extends URIScopeDefinitionFactory {
+public abstract class AbstractURIConvertingScopeDefinitionFactory
+extends URIScopeDefinitionFactory implements IModelScopeDefinitionFactory.Delegating {
/**
* @see org.eclipse.emf.diffmerge.ui.specification.ext.URIScopeDefinitionFactory#createScopeDefinition(java.lang.Object, java.lang.String, boolean)
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/ComparisonSetupManager.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/ComparisonSetupManager.java
index 64c402f3..a1904ec1 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/ComparisonSetupManager.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/ComparisonSetupManager.java
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -245,12 +246,19 @@ public class ComparisonSetupManager {
*/
public List<IModelScopeDefinitionFactory> getApplicableModelScopeFactories(
Object entrypoint_p) {
- List<IModelScopeDefinitionFactory> result = new ArrayList<IModelScopeDefinitionFactory>();
+ LinkedList<IModelScopeDefinitionFactory> expandedResult =
+ new LinkedList<IModelScopeDefinitionFactory>();
for (IModelScopeDefinitionFactory factory : getRegisteredModelScopeDefinitionFactories()) {
- if (factory.isApplicableTo(entrypoint_p))
- result.add(factory);
+ if (factory.isApplicableTo(entrypoint_p)) {
+ if (factory instanceof IModelScopeDefinitionFactory.Delegating) {
+ // Delegating factories have priority
+ expandedResult.addFirst(factory);
+ } else {
+ expandedResult.addLast(factory);
+ }
+ }
}
- result = reduceByOverride(result, _scopeFactories);
+ List<IModelScopeDefinitionFactory> result = reduceByOverride(expandedResult, _scopeFactories);
return Collections.unmodifiableList(result);
}
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/specification/IModelScopeDefinitionFactory.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/specification/IModelScopeDefinitionFactory.java
index c6b96041..4d6daabe 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/specification/IModelScopeDefinitionFactory.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/specification/IModelScopeDefinitionFactory.java
@@ -35,4 +35,12 @@ public interface IModelScopeDefinitionFactory extends IOverridableFactory {
*/
boolean isApplicableTo(Object entrypoint_p);
+
+ /**
+ * A factory that delegates to others and should therefore have priority over them.
+ */
+ interface Delegating extends IModelScopeDefinitionFactory {
+ // Nothing added
+ }
+
}
diff --git a/tests/org.eclipse.emf.diffmerge.tests.ui/.project b/tests/org.eclipse.emf.diffmerge.tests.ui/.project
index b79e4ab7..fd7de3be 100644
--- a/tests/org.eclipse.emf.diffmerge.tests.ui/.project
+++ b/tests/org.eclipse.emf.diffmerge.tests.ui/.project
@@ -25,4 +25,15 @@
<nature>org.eclipse.rcptt.core.rcpttnature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
+ <filteredResources>
+ <filter>
+ <id>1559637872411</id>
+ <name></name>
+ <type>10</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-target</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
</projectDescription>

Back to the top