Commit 4bf7d4df authored by Simon Barner's avatar Simon Barner

ParameterTableReferenceMigrators: Traverse entire model

* Migrate also TaskArchitecture in ModelElementSnapshots (not just
  the primary root elements)

Issue-Ref: 4121
Issue-Url: #4121Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 1554e64e
Pipeline #28239 passed with stage
ParameterTableReferenceMigrationProvider.java a2e25614a4098dfe118e6818eb13cf00846e5289 YELLOW
ParameterTableReferenceMigrationProvider.java d96c1c91835882d3c86596a7092cc8d751fdd055 YELLOW
......@@ -16,7 +16,7 @@
package org.fortiss.af3.partition.migration;
import static java.util.Collections.emptyMap;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getRootElements;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import java.util.Map;
......@@ -53,7 +53,8 @@ public class ParameterTableReferenceMigrationProvider implements IMigrationProvi
public boolean needMigration(ITopLevelElement modelElement,
Map<EObject, AnyType> unknownFeatures) {
EObject topObject = modelElement.getRootModelElement();
for(PartitionArchitecture pa : getRootElements(topObject, PartitionArchitecture.class)) {
for(PartitionArchitecture pa : getChildrenWithType(topObject,
PartitionArchitecture.class)) {
if(getMemoryAreaAllocationTable(pa) != null) {
return true;
}
......@@ -67,7 +68,8 @@ public class ParameterTableReferenceMigrationProvider implements IMigrationProvi
Map<EObject, AnyType> unknownFeatures) {
EObject topObject = modelElement.getRootModelElement();
for(PartitionArchitecture pa : getRootElements(topObject, PartitionArchitecture.class)) {
for(PartitionArchitecture pa : getChildrenWithType(topObject,
PartitionArchitecture.class)) {
if(getMemoryAreaAllocationTable(pa) != null) {
pa.getParameterTables().add(getMemoryAreaAllocationTable(pa));
pa.eSet(PartitionPackage.Literals.PARTITION_ARCHITECTURE__MEMORY_AREA_ALLOCATION_TABLE,
......
ParameterTableReferenceMigrationProvider.java d962308abac0250c2ca202579a17f1c96db789c0 YELLOW
ParameterTableReferenceMigrationProvider.java 48ee5bf328897eb35931d59ae6354f2ab23aa8ba YELLOW
......@@ -16,7 +16,7 @@
package org.fortiss.af3.task.migration;
import static java.util.Collections.emptyMap;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getRootElements;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import java.util.Map;
......@@ -61,7 +61,7 @@ public class ParameterTableReferenceMigrationProvider implements IMigrationProvi
public boolean needMigration(ITopLevelElement modelElement,
Map<EObject, AnyType> unknownFeatures) {
EObject topObject = modelElement.getRootModelElement();
for(TaskArchitecture ta : getRootElements(topObject, TaskArchitecture.class)) {
for(TaskArchitecture ta : getChildrenWithType(topObject, TaskArchitecture.class)) {
if(getWcetTable(ta) != null || getMemoryAllocationTable(ta) != null) {
return true;
}
......@@ -75,7 +75,7 @@ public class ParameterTableReferenceMigrationProvider implements IMigrationProvi
Map<EObject, AnyType> unknownFeatures) {
EObject topObject = modelElement.getRootModelElement();
for(TaskArchitecture ta : getRootElements(topObject, TaskArchitecture.class)) {
for(TaskArchitecture ta : getChildrenWithType(topObject, TaskArchitecture.class)) {
if(getWcetTable(ta) != null) {
ta.getParameterTables().add(getWcetTable(ta));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment