[EMF] XMI loading option XMLResource.OPTION_DEFER_IDREF_RESOLUTION and "non unique" ERefer [message #1801362] |
Thu, 17 January 2019 13:33 |
Fabien Giquel Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Hi,
We use some ecore definitions with EReference having the property "unique=false".
We also use the option XMLResource.OPTION_DEFER_IDREF_RESOLUTION=true when loading from XMI file (for better time loading).
It seems that the both do not work well together -> when our EReference is valued with two references to the same object, xmi loading throws some IllegalValueException (caused by IndexOutOfBoundException in XMLHelperImpl#setValue(..) on list.move(..) call).
When i look into XMLHelperImpl#setValue(..), I see that exception would be avoided if the XMLHelperImpl.checkForDuplicates was not set to true because of OPTION_DEFER_IDREF_RESOLUTION option.... So beyond the exception thrown, i wonder why the option OPTION_DEFER_IDREF_RESOLUTION seems to force behavior as if "unique=true" for all EReference.. ?
( We finally succeded in XMI loading, with some post-processing which detects all the related IllegalValueException and fix model by straightforward "addUnique(..)" in order to get the whished multiple {source; target} references)
Regards,
Fabien.
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
|
|
|
|
Powered by
FUDForum. Page generated in 0.04081 seconds