Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Delaigue2016-05-17 02:25:12 -0400
committerLaurent Delaigue2016-05-30 04:42:38 -0400
commitba05fbe16ff981d81606211525810ed4c8b32648 (patch)
treeb3d541c7dd75d071e0de6d5ec55557ee40890676
parentecb72749dfc9b273b736655cea3a3c4b1629f87d (diff)
downloadorg.eclipse.emf.compare-ba05fbe16ff981d81606211525810ed4c8b32648.tar.gz
org.eclipse.emf.compare-ba05fbe16ff981d81606211525810ed4c8b32648.tar.xz
org.eclipse.emf.compare-ba05fbe16ff981d81606211525810ed4c8b32648.zip
Fix wrong conflict detections
Change-Id: I7fb71c5412cf6fb6ae89ac2148882888c1692fa5 Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ContainmentRefChangeConflictSearch.java2
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ResourceAttachmentChangeConflictSearch.java8
2 files changed, 6 insertions, 4 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 f8cbee558..b1f6fde01 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
@@ -88,7 +88,7 @@ public class ContainmentRefChangeConflictSearch {
EList<Diff> diffsInSameMatch = diff.getMatch().getDifferences();
if (!feature.isMany()) {
for (Diff candidate : Iterables.filter(diffsInSameMatch, and(possiblyConflictingWith(diff),
- instanceOf(ReferenceChange.class), onFeature(feature)))) {
+ instanceOf(ReferenceChange.class), onFeature(feature), ofKind(ADD, CHANGE)))) {
if (comparison.getEqualityHelper().matchingValues(
((ReferenceChange)candidate).getValue(), diff.getValue())) {
conflict(candidate, PSEUDO);
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ResourceAttachmentChangeConflictSearch.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ResourceAttachmentChangeConflictSearch.java
index 3e812b81b..6e55020aa 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ResourceAttachmentChangeConflictSearch.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/conflict/ResourceAttachmentChangeConflictSearch.java
@@ -74,9 +74,11 @@ public class ResourceAttachmentChangeConflictSearch {
Collection<ReferenceChange> refChanges = index.getReferenceChangesByValue(value);
for (ReferenceChange candidate : Iterables.filter(refChanges, possiblyConflictingWith(diff))) {
if (candidate.getReference().isContainment()) {
- // The element is a new root on one side, but it has been moved to an EObject
- // container on the other
- conflict(candidate, REAL);
+ if (candidate.getValue().eContainer() == null) {
+ // The element is a new root on one side, but it has been moved to an EObject
+ // container on the other
+ conflict(candidate, REAL);
+ }
} else {
// [477607] DELETE does not necessarily mean that the element is removed from the
// model

Back to the top