Followups below
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?
Followup 1
I recreated this example in a fresh workspace, but I added an UUID to the A and B type (as my "real" model has, too), and this works as expected. Now on to finding out why my "real" model doesn't...