Community
Participate
Working Groups
= Problem description = Before transforming models using Xtend, the required Xtend MetaModels need to be configured for this operation. This configuration is expected to be done via project properties/preferences provided by Xpand for that purpose (right-click on project with Xtend template(s) > Properties > Xtend/Xpand for details). The resulting information is twofold: a) '''which''' Xtend MetaModels that are to be used b) '''the precedence''' of the Xtend MetaModels which becomes vital in cases where multiple of them are applicable to the same model object under transformation In the Xpand project properties/preferences dialog, the precedence can be adjusted via the Up/Down buttons right to the "Activated metamodel contributors" list. At API level, the precedence is expressed by the position of the Xtend MetaModels in the list returned by org.eclipse.xtend.shared.ui.core.metamodel.MetamodelContributorRegistry#getActiveMetamodelContributors(IJavaProject). When running Xtend-based model to model transformations using the Xtend/Xpand runtime enhancements provided by Sphinx (BasicM2MAction, M2MConfigurationWizard and XtendJob), the Xtend MetaModels to be used are directly retrieved from the Xpand project properties/preferences. However, Sphinx stores them in a set rather than a list and hands them around as a collection. Consequently, the precedence information configured in the Xpand project properties/preferences gets lost and the order in which the Xtend MetaModels are invoked for finding the Xtend type for a given model object under transformation is quite arbitrary. = Proposed resolution = * Use an ArrayList rather than a HashSet for storing the Xtend MetaModels in BasicM2MAction#getMetaModels() * Change all methods in BasicM2MAction, M2MConfigurationWizard and XtendJob supporting multiple Xtend MetaModels to be passed as parameter so that the Xtend MetaModels are passed as list but not as collection * Change BasicM2TAction, M2TConfigurationWizard, XpandJob and CheckJob correspondingly
Fixed as proposed in description.
For the same reasons as explained in the description of this bug, the MetamodelContributors passed to the ConvertToXtendXpandEnabledProjectJob must be hold in a list instead of a set.
Fixed by incorporating modification proposed in comment #2. Additionally, revised implementation of ConvertToXtendXpandEnabledProjectJob (redesigned overriding points and getters/setters, improved of naming, fixed progress monitor issues) and renamed it to ConvertToXtendXpandEnabledPluginProjectJob.
Mass-closing Resolved tickets