Community
Participate
Working Groups
I found this issue while investigating tests failures of org.eclipse.sirius.tests.unit.table.unit.export.ExportToCsvTest after migrating it to AQL. Issue : some metamodels are "unknown" by a specific interpreter whereas it is explicitely referenced in the .odesign in such specific conditions. Symptoms : failures to parse or evaluate Analysis : in DViewOperations.updateSelectedViewpointsData(IProgressMonitor) the metamodels are gathered and then passed to the model accessor and to the interpreters for initialization : Collection<MetamodelDescriptor> metamodels = MetamodelDescriptorManager.INSTANCE.provides(getSelectedViewpoints(false)); if (accessor != null) { accessor.activateMetamodels(metamodels); } session.getInterpreter().activateMetamodels(metamodels); Accessor first and then the interpreter. Initializing the ModelAccessor ends up calling EcoreIntrinsicExtender.updateMetamodels(Collection<? extends MetamodelDescriptor>) which will diff the given list of metamodel descriptors with the one which has been previously registered BUT the diff is done by modifying the list passed as a parameters. Because of this some descriptors might have been removed when the interpreter.activiateMetamodels() method is called. You might wonder : how come we have not seen this problem before ? First this might explain some "hard to reproduce" problems with the MTL interpreter not knowing some metamodels. These are typically hard to reproduce as the bug will only manifest itself depending on the previously selected viewpoints. Second : up until the fix for Bug 474807 AQL would not drop the AST's when the metamodel would change, hence would have been very likely to keep a valid one even if the next "activateMetamdels" call would not contain the needed EPackage instance. To validate this ticket : just make sure ExportToCsvTest, migrated to AQL, is green.
New Gerrit change created: https://git.eclipse.org/r/57288
Gerrit change https://git.eclipse.org/r/57288 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=5ceb2cbcbdac11efca918232809c6b216244c3fc
Cédric could you provide a simple test case or scenario for the validation of the correction ?
(In reply to Maxime Porhel from comment #3) > Cédric could you provide a simple test case or scenario for the validation > of the correction ? org.eclipse.sirius.tests.unit.table.unit.export.ExportToCsvTest once migrated to AQL (which it is now that https://git.eclipse.org/r/#/c/57274/ is merged) reveal this issue by failling with a table which has no elements whereas it should have lines for all the classes. That's the simplest reproduction case. To reproduce it "by hand" you would need to 1°) initialize a modeling project with an UML model for instance and a Viewpoint not using AQL at all but refering to the UML metamodel 2°) enable a Viewpoint with a reference to the same metamodel but which uses AQL with expressions leveraging type literals (self.eAllContents(uml::Class) for instance), these expression will fail at runtime.
Fixed for 3.1.0
The test passed on Sirius master
Available in Sirius 3.1.0.