Community
Participate
Working Groups
When you have a Java service in an odesign file, the Acceleo bridge will create an Acceleo module representing this service. For example, this class: import a.b.c.d.MyType; package a.b.c; public class MyClass { public boolean doStuff(Lis<MyType> myType) { return true; } } would be "transformed" to this module: [comment encoding=utf-8/] [module myClass(<all the accessible meta-models>)] [query public doStuff(myType: Sequence(MyType)): Boolean = invoke('a.b.c.MyClass', 'doStuff(a.b.c.d.MyType)', Sequence{myType}) /] The problem occurs if the list of accessible meta-models contains two meta-models with the EClass MyType. Acceleo will take the first EClass accessible with the name MyType. The correct solution would be: "[query public doStuff(myType: Sequence(myMetamodel::MyType)): Boolean =" instead of "[query public doStuff(myType: Sequence(MyType)): Boolean =" This issue does not occur during the execution of the representation since the operation will be recompiled with the proper type. It only occurs during the validation of the odesign.
Created attachment 238854 [details] bugzilla425185.model : models to reproduce the issue
Created attachment 238855 [details] bugzilla425185.description : VSM to reproduce the issue
Steps to reproduce: - Import the 3 projects contained in bugzilla425185.model.zip - Launch a new runtime including those 3 projects - Import the Viewpoint Specification project contained in bugzilla425185.description.zip - Validate the VSM => Expecting one validation issue on the condtional style of bugzilla425185-oneCore Diagram, as the service isValidClass() is defined for bugzilla425185.EClass and not ecore.EClass
Hints for a fix: - The class in charge of generating the module corresponding to a java service class is org.eclipse.sirius.common.acceleo.mtl.business.api.extension.JavaImportHandler - in the createImport() method, it uses the signatures obtained from getPublicSignaresFrom() to generate the module by calling DynamicJavaModuleCreator.createModule() - the issues comes from DynamicJavaModuleCreator.extractArgumentSignatureString() which does not use Eclass's package for the argument signature