Commit c47ba70c authored by Sascha Niklas Schneiders's avatar Sascha Niklas Schneiders
Browse files

fixed multiple addition of same information into ExpandedComponentSymbol

parent 42a56cc5
......@@ -117,7 +117,7 @@ public class EmbeddedMontiArcExpandedComponentInstanceSymbolCreator {
createInstance(inst.getComponentType(), filters, inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols())
.setName(inst.getName())
.addActualTypeArguments(inst.getComponentType().getFormalTypeParameters(),
inst.getComponentType().getActualTypeArguments()).addResolvingFilters(filters).addResolutionDeclarationSymbols(inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols()).addParameters(inst.getComponentType().getReferencedSymbol().getParameters()).build());
inst.getComponentType().getActualTypeArguments()).addResolvingFilters(filters).addResolutionDeclarationSymbols(inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols()).addParameters(inst.getComponentType().getReferencedSymbol().getParameters()).addArguments(inst.getComponentType().getReferencedSymbol().getArguments()).build());
Log.debug(inst.getInstanceInformation().get().getInstanceNumberForArgumentIndex(0) + "", "InstanceInformation:");
Log.debug(inst.toString(), "ComponentInstance CreateInstance PostSub");
......
......@@ -292,7 +292,11 @@ public class ExpandedComponentInstanceBuilder {
}
public ExpandedComponentInstanceBuilder addResolutionDeclarationSymbols(List<ResolutionDeclarationSymbol> resolutionDeclarationSymbols) {
this.resolutionDeclarationSymbols.addAll(resolutionDeclarationSymbols);
for (ResolutionDeclarationSymbol symbol : resolutionDeclarationSymbols) {
if (!this.resolutionDeclarationSymbols.contains(symbol))
this.resolutionDeclarationSymbols.add(symbol);
}
return this;
}
......@@ -301,7 +305,10 @@ public class ExpandedComponentInstanceBuilder {
}
public ExpandedComponentInstanceBuilder addParameters(List<EMAVariable> parameters) {
this.parameters.addAll(parameters);
for (EMAVariable parameter : parameters) {
if (!this.parameters.contains(parameter))
this.parameters.add(parameter);
}
return this;
}
......@@ -310,7 +317,10 @@ public class ExpandedComponentInstanceBuilder {
}
public ExpandedComponentInstanceBuilder addArguments(List<ASTExpression> arguments) {
this.arguments.addAll(arguments);
for (ASTExpression argument : arguments) {
if (!this.arguments.contains(argument))
this.arguments.add(argument);
}
return this;
}
}
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