diff --git a/AlgebraicDataflowArchitectureModel/src/generators/CodeGenerator.java b/AlgebraicDataflowArchitectureModel/src/generators/CodeGenerator.java index cd3f385..acfbf44 100644 --- a/AlgebraicDataflowArchitectureModel/src/generators/CodeGenerator.java +++ b/AlgebraicDataflowArchitectureModel/src/generators/CodeGenerator.java @@ -259,7 +259,7 @@ } protected void updateMainComponent(TypeDeclaration mainType, MethodDeclaration mainConstructor, Node componentNode, - MethodDeclaration constructor, ILanguageSpecific langSpec) { + MethodDeclaration constructor, final List depends, ILanguageSpecific langSpec) { // Declare the field to refer to each object in the main type. ResourceNode resNode = null; String nodeName = null; @@ -275,6 +275,9 @@ } // Add a statement to instantiate each object to the main constructor. List parameters = new ArrayList<>(); + for (ResourceHierarchy res: depends) { + parameters.add(res.getResourceName()); + } if (constructor.getParameters() != null) { for (VariableDeclaration var: constructor.getParameters()) { parameters.add(var.getName());