[Edapt] XML parsing issue when migrating older model [message #1790176] |
Wed, 06 June 2018 09:41  |
Eclipse User |
|
|
|
Hi all,
I am currently trying to use Edapt for my project. I applied my model changes via the history and made a release. I gave it a new ns like , reloaded the genmodel and re-generated the model and edit code from the genmodel.
Next I implemented the code snippet from https://www.eclipse.org/edapt/libraryexample.php, Listing 3, into my editor.
When it calls migrator.migrateAndLoad() it correctly detects that the model needs to be migrated and start the migration. But then the XML produces a lot of errors like
...
Caused by: java.lang.IllegalArgumentException: The value '9.24976;9.2752;9.33836;9.3642;9.38996;9.41578;9.44151;9.49413;9.51994;9.54568;9.57144;9.5973;9.62304;9.66056;9.68629;9.71203;9.7378;9.76356;9.78928;9.85162;9.87743;9.90318;9.9289;9.95463;9.98048;10.00634;10.03122;10.05705;10.09294;10.11871;10.14454;10.17027;10.196;10.22181;10.24759;10.27344;10.29921;10.32507;10.35083;10.3767;10.40248;10.42834;10.4541;10.47995;10.50581;10.53154;10.55727;10.58301;10.60878;10.63456;10.66033;10.68615;10.71192;10.73769;10.76346;10.78928;10.81505;10.84078;10.86656;10.8923;10.91803;10.9438;10.96956;10.99543;11.02119;11.047;11.07277;11.09854;11.12431;11.15007;11.17589;11.20162;11.22746;11.25329;11.27906;11.30489;11.33062;11.35639;11.38215;11.40792;11.43365;11.45937;11.48522;11.51108;11.5369;11.56264;11.58841;11.61413;11.63986;11.6656;11.69141;11.71718' is invalid.
at org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:470)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(XMLHelperImpl.java:1615)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1156)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2692)
These numbers should be parsed and converted to a double array. The corresponding method is implemented in and works on the previous model. However, for the migration code it seems that is called on only.
Can someone help on that, please?
Thank and best regards,
Gernot.
|
|
|
|
|
|
|
Re: [Edapt] XML parsing issue when migrating older model [message #1790998 is a reply to message #1790913] |
Thu, 21 June 2018 04:45   |
Eclipse User |
|
|
|
Hi!
I was able to nail the problem down:
Actually, the load options will not stay empty. There will be a merge with the default load options which contain the EXTENDED_META_DATA=true flag. So this was not the problem.
The validation fails when it checks classes that are contained via a feature map in the ecore model. The containment check is done in the MigrationValidator.validate_validContainment() method:

My model looks like this:

The classes TestA, TestB, TestC have BaseTest as super type. The class TestRun has a bi-directional relation to BaseTest but no containment. The BaseTest - or better - the respective Test* classes are contained by class Experiment via a feature map.
When the valid containment check runs, i.e. TestA is passed as the instance. In line 278 the call instance.getReferences() returns all references from other classes to the TestA instance. Using the debugger I can see that all references from TestRun to TestA are returned. However, none of these is a containment.
Unfortunately, the (containment) reference from Experiment to TestA is not returned. Thus, since TestA is also not directly contained by a resource (lines 284-290) the method finally returns valid=false.
Obviously, the references from feature maps are not considered in this containment check. Bug or feature?
Thanks for your help.
Best regards,
Gernot.
|
|
|
|
Powered by
FUDForum. Page generated in 0.05880 seconds