Comparing two structurally equal EObjects yields PSEUDO conflict [updated] [message #1757980] |
Wed, 22 March 2017 14:06 |
Jens Rabe Messages: 81 Registered: September 2013 |
Member |
|
|
Let's say I have this simple model (Xcore syntax):
class A {
contains B[] bs opposite a
}
class B {
String foo
container A a opposite bs
}
I now have three A's, created like the following:
A a1 = ModelFactory.eINSTANCE.createA();
B b1 = ModelFactory.eINSTANCE.createB();
b1.setFoo("foo");
b1.setA(a1);
A a2 = ModelFactory.eINSTANCE.createA();
B b2 = ModelFactory.eINSTANCE.createB();
b2.setFoo("bar");
b2.setA(a2);
A a3 = ModelFactory.eINSTANCE.createA();
B b3 = ModelFactory.eINSTANCE.createB();
b3.setFoo("bar");
b3.setA(a3);
When I try to compare them like this:
DefaultComparisonScope scope = new DefaultComparisonScope(a1, a2, a3);
Comparison comp = EMFCompare.builder().build().compare(scope);
EList<Diff> diffs = comp.getDifferences();
I am expecting to get one attribute change on the B__FOO EAttribute, but I get two pseudo conflicts for the ADD kind for A__BS. I think this is because of how EMF handles equality, and the A's and B's are, technically, different.
How do I achieve that I get the "correct" differences?
EDIT: I now started with a clean project with this very simple example (but with a UUID property added to each of the classes as it is also the case with my "real" model I cannot post here) and it worked.
So can anyone guide me what can be the culprit that the diffs get recognized incorrectly in my real model? Things to look at to narrow down the origin of the problem?
[Updated on: Wed, 22 March 2017 17:24] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03269 seconds