remove workaround for EMAComponentInstanceBuider::clone

parent ac05acfa
Pipeline #98278 passed with stages
in 8 minutes and 21 seconds
......@@ -18,15 +18,13 @@
<!-- .. SE-Libraries .................................................. -->
<se-commons.version>1.7.7</se-commons.version>
<!--TODO: remove with update to next emam version -->
<struct.version>0.0.18-SNAPSHOT</struct.version>
<embedded-montiarc.version>0.1.9-SNAPSHOT</embedded-montiarc.version>
<Embedded-montiarc-math-generator.version>0.1.3-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-montiarc-math-roscpp-generator.version>0.1.1-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version>
<EMADL.version>0.2.4</EMADL.version>
<EMADL2CPP.version>0.2.6-SNAPSHOT</EMADL2CPP.version>
<!--TODO: remove with update to new emam version-->
<Tagging.version>0.0.6</Tagging.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
......@@ -55,8 +53,8 @@
<dependencies>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>struct</artifactId>
<version>${struct.version}</version>
<artifactId>embedded-montiarc</artifactId>
<version>${embedded-montiarc.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
......@@ -109,13 +107,6 @@
</dependency>
<!-- MontiCore Dependencies -->
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>Tagging</artifactId>
<version>${Tagging.version}</version>
</dependency>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-groovy</artifactId>
......
......@@ -135,7 +135,7 @@ public class ClusterHelper {
.collect(Collectors.toList());
Set<ResolvingFilter<? extends Symbol>> resolvingFilters = inst.getSpannedScope().getResolvingFilters();
List<EMAComponentInstanceSymbol> tmpSubcomps = cluster.stream().map(ClusterHelper::realClone).collect(Collectors.toList());
List<EMAComponentInstanceSymbol> tmpSubcomps = cluster.stream().map(EMAComponentInstanceBuilder::clone).collect(Collectors.toList());
tmpSubcomps.forEach(sc -> ((CommonScope) sc.getSpannedScope()).setResolvingFilters(resolvingFilters));
EMAComponentInstanceSymbol res = new EMAComponentInstanceBuilder()
.setName(clusterName)
......@@ -152,24 +152,4 @@ public class ClusterHelper {
return res;
}
//TODO: ports, package name are not cloned in EMAComponentInstanceBuilder::clone
private static EMAComponentInstanceSymbol realClone(EMAComponentInstanceSymbol inst) {
Collection<EMAComponentInstanceSymbol> subcomps = inst.getSubComponents().stream().map(ClusterHelper::realClone).collect(Collectors.toList());
Collection<EMAConnectorSymbol> connectors = inst.getConnectorInstances().stream().map(EMAConnectorBuilder::clone).collect(Collectors.toList());
Collection<EMAPortSymbol> ports = inst.getPortInstanceList().stream().map(EMAPortBuilder::clone).collect(Collectors.toList());
EMAComponentInstanceBuilder res = (new EMAComponentInstanceBuilder());
ports.forEach(res::addPort);
res.setName(inst.getName())
.setPackageName(inst.getPackageName())
.setSymbolReference(inst.getComponentType())
.addConnectors(connectors)
.addSubComponents(subcomps)
.addResolutionDeclarationSymbols(inst.getResolutionDeclarationSymbols());
return res.build();
}
}
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