| Summary: | Copy/paste of UML2 models with stereotypes using EcoreUtil.Copier sometimes changes order of stereotype applications | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Alain Le Guennec <alain.leguennec> |
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse-bugzilla, Kenn.Hussey, rschnekenburger, sebastien.gerard |
| Version: | 2.8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 397324 | ||
|
Description
Alain Le Guennec
Given that a LinkedHashMap extends HashMap, I could change the base class of the Copier without binary incompatibility. In any "normal" model the order in which the references are copied are irrelevant, in the case of bidirectional references that can be modified from both ends, the code already checks if the reference has already been added and moves it to the right place. It's not clear why that ordering process isn't working for the reference you mention. Perhaps it's marked as derived so it's simply not copied at all. Of course it's possible to specialize the copier, so one could specialize it to iterate over the copied objects to modify the order of this feature in the copy to match that of the order in original. That seems better than relying on some type of ordering in the copier... I'd like Kenn's opinion before I make any changes that aren't based on a test case I can evaluate. (In reply to comment #1) > I'd like Kenn's opinion before I make any changes that aren't based on a > test case I can evaluate. I think it would be great if the Copier were a LinkedHashMap; indeed, UML2 has at least one case where ugly overrides had to be added to work around a similar issue. The fix is committed to master: http://git.eclipse.org/c/emf/org.eclipse.emf.git/commit/?id=a5c329f69313927ecba5c9bac6aef5fbccf55b2f The changes are available in Kepler. |