Summary: | Issue with serialisation code in Generic Editor | ||||||
---|---|---|---|---|---|---|---|
Product: | [Modeling] ECP | Reporter: | Hallvard Traetteberg <hal> | ||||
Component: | EMF Forms | Assignee: | Alexandra Buzila <abuzila> | ||||
Status: | CLOSED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | abuzila, eneufeld | ||||
Version: | 1.14.0 | Keywords: | noteworthy, test | ||||
Target Milestone: | 1.19.0 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
See Also: |
https://git.eclipse.org/r/124027 https://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/commit/?id=c955244debb12c65ebbd25785a842e017038e523 |
||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Hallvard Traetteberg
2017-11-10 06:00:34 EST
Thank you for the report. We will discuss this and post updates here. Hallvard, could you please provide a small example to reproduce the issue? Thank you! Created attachment 273078 [details] Project that demonstrates the bug This is a minimal project demonstrating the bug. It contains two models, one using XML annotions that changes how models are serialized, the other depending on the first, but using XMI serialization. Two examples instances are provided, one (model/Path.xmi) extension) that can be read by the Sample Reflective Ecore Editor, but not by ECF's Generic Editor (it can be read, but some attributes are ignored), and another (model/Path.bug527110b) that can be read by the Generic Editor (is in fact, written by it), but not by the Sample Reflective Ecore Editor. The project declares the Generic Editor as the editor for the bug527110b extension, so it a runtime Eclipse can be launched and used to open Path.bug527110b with either editor. New Gerrit change created: https://git.eclipse.org/r/124027 The fix seems to force all Resources to be save with XMLResource.OPTION_EXTENDED_META_DATA set to false. But won't this break Resources that should be serialized as XML? Resources that (already) are (supposed to be) stored as XML should be loaded and saved as XML. It's the (default) Resource implementation (the one registered for the file extension in the global or ResourceSet registry) that should decide, not the editor. The test needs to check that both cases work properly, when the resource is an XMLResource it should be serialized as XML, when the resource is an XMIResource, it should be serialized as XMI. Hallvard, could you please test the Gerrit change and see if this fixes your issue? I have to move it as we have to release next week. We will merge it after a thorough test after the current release. Gerrit change https://git.eclipse.org/r/124027 was merged to [develop]. Commit: http://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/commit/?id=c955244debb12c65ebbd25785a842e017038e523 We deprecated the save/load methods of ResourceSetHelpers that did not accept resource load/save options and introduce new methods to replace them, that expect these as a parameter. Clients are now responsible for passing in the expected options and the helper class should not specify any. This affects the GenericEditor and its subclasses. The GenericEditor also throws a new PartInitException, if there were errors while loading the resource. |