diff --git a/AlgebraicDataflowArchitectureModel/src/generators/JavaCodeGenerator.java b/AlgebraicDataflowArchitectureModel/src/generators/JavaCodeGenerator.java index 32b9289..a15057e 100644 --- a/AlgebraicDataflowArchitectureModel/src/generators/JavaCodeGenerator.java +++ b/AlgebraicDataflowArchitectureModel/src/generators/JavaCodeGenerator.java @@ -1088,11 +1088,7 @@ if (res.getInitialValue() != null) { initializer = res.getInitialValue().toImplementation(new String[] {""}); } else if (stateType != null) { - if (DataConstraintModel.typeList.isAncestorOf(stateType)) { - initializer = "new " + res.getResourceStateType().getImplementationTypeName() + "()"; - } else if (DataConstraintModel.typeMap.isAncestorOf(stateType)) { - initializer = "new " + res.getResourceStateType().getImplementationTypeName() + "()"; - } + initializer = DataConstraintModel.getDefaultValue(stateType); } return initializer; }