Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Dirix2014-12-09 17:56:23 +0000
committerAxel RICHARD2014-12-16 08:22:28 +0000
commit1b4a8d4327212a5c6f5c335c7209120c3f849963 (patch)
tree979dbeb4b8c6a2157b951745e3fed87624b54004 /plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data
parent8699a79682ac29b873ab9281e1edea5d194f4127 (diff)
downloadorg.eclipse.emf.compare-1b4a8d4327212a5c6f5c335c7209120c3f849963.tar.gz
org.eclipse.emf.compare-1b4a8d4327212a5c6f5c335c7209120c3f849963.tar.xz
org.eclipse.emf.compare-1b4a8d4327212a5c6f5c335c7209120c3f849963.zip
[454579] Fix Nullpointer when element is moved out of FeatureMap
The FeatureMapChangeMerger is intended to handle manipulations of FeatureMaps. When used to work on the Non-Feature-Map side of an operation a NullPointerException is thrown. This patch changes the AbstractMerger so that equivalent ReferenceChanges will be preferred in this scenario. The AbstractMerger is also modified to first search for the master equivalence and only after that to check for equivalences with conflicts. This avoids an issue where multiple equivalences with conflicts exist and the less fitting one is chosen. Includes 2-way and 3-way testcases. Bug: 454579 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I8a264b09a7a8011121c341673638eda052afb422
Diffstat (limited to 'plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data')
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/IndividualDiffInputData.java13
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/ancestor.nodes13
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/inside.nodes14
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/outside.nodes14
4 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/IndividualDiffInputData.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/IndividualDiffInputData.java
index 748a5b24e..0fd2f79a0 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/IndividualDiffInputData.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/IndividualDiffInputData.java
@@ -713,4 +713,17 @@ public class IndividualDiffInputData extends AbstractInputData {
return loadFromClassLoader("featuremapscope/noncontainment/pseudoconflicts/moveorder/ancestor.nodes",
resourceSet);
}
+
+ public Resource getFeatureMapContainmentMoveInsideOutsideOrigin(ResourceSet resourceSet)
+ throws IOException {
+ return loadFromClassLoader("featuremapscope/containment/moveinandout/ancestor.nodes", resourceSet);
+ }
+
+ public Resource getFeatureMapContainmentMoveOutside(ResourceSet resourceSet) throws IOException {
+ return loadFromClassLoader("featuremapscope/containment/moveinandout/outside.nodes", resourceSet);
+ }
+
+ public Resource getFeatureMapContainmentMoveInside(ResourceSet resourceSet) throws IOException {
+ return loadFromClassLoader("featuremapscope/containment/moveinandout/inside.nodes", resourceSet);
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/ancestor.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/ancestor.nodes
new file mode 100644
index 000000000..61235fbc3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/ancestor.nodes
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_root"
+ name="Root">
+ <containmentRef1 xsi:type="nodes:NodeMultipleContainment" xmi:id="_a" name="a"/>
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n" name="n"/>
+ <containmentRef1 xsi:type="nodes:NodeMultipleContainment" xmi:id="_b" name="b"/>
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n2" name="n2"/>
+</nodes:Node> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/inside.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/inside.nodes
new file mode 100644
index 000000000..e312b2b21
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/inside.nodes
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_root"
+ name="Root">
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n" name="n">
+ <multiple xmi:id="_a" name="a"/>
+ <multiple xmi:id="_b" name="b"/>
+ </containmentRef1>
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n2" name="n2"/>
+</nodes:Node> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/outside.nodes b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/outside.nodes
new file mode 100644
index 000000000..918a05709
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/merge/data/featuremapscope/containment/moveinandout/outside.nodes
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes"
+ xmi:id="_root"
+ name="Root">
+ <containmentRef1 xsi:type="nodes:NodeMultipleContainment" xmi:id="_a" name="a"/>
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n" name="n"/>
+ <containmentRef1 xsi:type="nodes:NodeFeatureMapContainment2" xmi:id="_n2" name="n2">
+ <multiple xmi:id="_b" name="b"/>
+ </containmentRef1>
+</nodes:Node> \ No newline at end of file

Back to the top