-
|
We have been working with EMF model to convert from one legacy application to ECOA model stored internally as EMF. The fact is that it generates random xml output (Structure is ok, but it's layed out randomly between runs). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
The method org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.useIDs() is specialized to return true so new XMI IDs will be generated when you do |
Beta Was this translation helpful? Give feedback.
-
|
Apparently I fixed the issue by overriding the Factory, here is my code. My preliminary tests shows that the output is from now on deterministic. |
Beta Was this translation helpful? Give feedback.
I'm not sure from where exactly the non-determistic behavior comes because you've not shown any reproducible examples nor samples of serializations that are difference in some way.
Maybe this map in org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.getEObjectToExtensionMap() should be a LinkedHashMap
Perhaps the ID map as well, but I don't know how the ID map's order has any impact on serialization; I think it does...
Can you try in an override as the only change: