| Summary: | UML Comparison Engine doesnt handle conflictual UpdateAttribute and UpdateReference | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMFCompare | Reporter: | Mikaël Barbero <mikael.barbero> | ||||
| Component: | Core | Assignee: | EMF Compare <emf.compare-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | laurent.goubet | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Thanks for the patch, this has now been contributed on master |
Created attachment 200258 [details] The new fixtures as patch to the tests plug-in The UML2DiffEngine#applyManagedTypes(DiffElement) method has to be changed with the following which handles Conflicting elements gracefully: void applyManagedTypes(DiffElement element) { for (IDiffExtensionFactory factory : uml2ExtensionFactories) { if (factory.handles(element)) { AbstractDiffExtension extension = factory.create(element); DiffElement diffParent = factory.getParentDiff(element); if (element.isConflicting()) { ConflictingDiffElement conflictingDiffElement = null; if (element.eContainer() != null && element.eContainer() instanceof ConflictingDiffElement) { conflictingDiffElement = (ConflictingDiffElement)element.eContainer(); } else { conflictingDiffElement = DiffFactory.eINSTANCE.createConflictingDiffElement(); } conflictingDiffElement.getSubDiffElements().add((DiffElement)extension); diffParent.getSubDiffElements().add((DiffElement)conflictingDiffElement); } else { diffParent.getSubDiffElements().add((DiffElement)extension); } } } } Find attached also a bunch of unittests for this behavior.