Community
Participate
Working Groups
Build Identifier: 1.1.0.v201005050957 (EMF Compare Version) Comparing two objects don't work properly since EcoreIDSimilarityChecker is unable to find similarity between these two objects. The problem is when initializing the checker these 2 objects are not included in the left and right iterators. I propose the solution below. 1- Added method to EcoreIDSimilarityChecker : protected AbstractTreeIterator<EObject> getAllContentsIncludingRoot(EObject contextObject) { AbstractTreeIterator<EObject> allContents = new AbstractTreeIterator<EObject>(contextObject, true) { private static final long serialVersionUID = 1L; @Override public Iterator<EObject> getChildren(Object object) { return ((EObject) object).eContents().iterator(); } }; return allContents; } 2 - Modified EcoreIDSimilarityChecker#init(EObject, EObject) to call the added method public void init(EObject obj1, EObject obj2) throws FactoryException { leftToRight.clear(); nonIdentified.clear(); final Iterator<EObject> leftIterator = getAllContentsIncludingRoot(obj1); final Iterator<EObject> rightIterator = getAllContentsIncludingRoot(obj2); browseComputingId(leftIterator, rightIterator); delegate.init(obj1, obj2); } Reproducible: Always
Hi, it's been fixed since the 18th of May, please have a try with the last build.