Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2019-09-05 09:29:11 -0400
committerlgoubet2019-09-06 11:16:03 -0400
commite19f31d1091ef35e3e8f5bdc3ce7da239e64cd6e (patch)
treef90d7d1c44bef48a0e67245f2695b2720d9a6bcd
parent34cab1322813ebb9c0103552485d50eb536f7c01 (diff)
downloadorg.eclipse.emf.compare-e19f31d1091ef35e3e8f5bdc3ce7da239e64cd6e.tar.gz
org.eclipse.emf.compare-e19f31d1091ef35e3e8f5bdc3ce7da239e64cd6e.tar.xz
org.eclipse.emf.compare-e19f31d1091ef35e3e8f5bdc3ce7da239e64cd6e.zip
MOVE differences also need to take into account the FeatureFilter
Containment moves may have (in)significant ordering as well, so we need to check what the FeatureFilter tells us on those Change-Id: I97f2a5f90db3483f3965a13e4dbc1df2d2ad7453
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java
index 9cc4c16c5..15eb58eeb 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java
@@ -283,9 +283,22 @@ public class ContainmentRefChangeConflictSearch {
for (ReferenceChange candidate : Iterables.filter(refChanges,
and(possiblyConflictingWith(diff), ofKind(MOVE)))) {
if (candidate.getReference().isContainment()) {
- if (candidate.getReference() == feature && candidate.getMatch() == diff.getMatch()
- && matchingIndices(diff.getMatch(), feature, value, candidate.getValue())) {
- conflict(candidate, PSEUDO);
+ // This is a containment move. It is the only case in which we could have a "move"
+ // difference in a reference where order is not significant
+ if (candidate.getReference() == feature && candidate.getMatch() == diff.getMatch()) {
+ // Same element has been moved into the same container on both sides. If we care about
+ // ordering in this new containment reference, check the indices to detect potential
+ // real conflicts.
+ FeatureFilter featureFilter = getFeatureFilter(comparison);
+ if (featureFilter == null || featureFilter.checkForOrderingChanges(feature)) {
+ if (matchingIndices(diff.getMatch(), feature, value, candidate.getValue())) {
+ conflict(candidate, PSEUDO);
+ } else {
+ conflict(candidate, REAL);
+ }
+ } else {
+ conflict(candidate, PSEUDO);
+ }
} else {
conflict(candidate, REAL);
}

Back to the top