Summary
Forward references to nested end-to-end flows bypass normal cleanup and clone naming during instance-model construction.
When a parent end-to-end flow references a nested flow that has not yet been instantiated, processEndToEndFlow creates another CreateEndToEndFlowsSwitch and calls instantiateEndToEndFlow directly. This bypasses the cleanup performed by caseComponentInstance, including removal of incomplete instances and assignment of unique names to cloned instances.
The result depends on declaration order. Feature-group expansion or other branching can leave multiple nested end-to-end flow instances with the same name, and failed nested instances can remain attached to the component instance.
Reproduction
Declare a parent end-to-end flow before the nested flow that it references. Make the nested flow expand into multiple valid instances, for example by passing through feature-group connections with multiple members.
The nested instances are created through the direct forward-reference path and retain duplicate names instead of receiving the usual numeric suffixes.
Expected behavior
Nested flow instantiation should have the same cleanup and clone-naming behavior regardless of declaration order. All retained clones should have unique names, and incomplete instances should be removed.
Relevant code
core/org.osate.aadl2.instantiation/src/org/osate/aadl2/instantiation/CreateEndToEndFlowsSwitch.java, methods caseComponentInstance and processEndToEndFlow.
Summary
Forward references to nested end-to-end flows bypass normal cleanup and clone naming during instance-model construction.
When a parent end-to-end flow references a nested flow that has not yet been instantiated,
processEndToEndFlowcreates anotherCreateEndToEndFlowsSwitchand callsinstantiateEndToEndFlowdirectly. This bypasses the cleanup performed bycaseComponentInstance, including removal of incomplete instances and assignment of unique names to cloned instances.The result depends on declaration order. Feature-group expansion or other branching can leave multiple nested end-to-end flow instances with the same name, and failed nested instances can remain attached to the component instance.
Reproduction
Declare a parent end-to-end flow before the nested flow that it references. Make the nested flow expand into multiple valid instances, for example by passing through feature-group connections with multiple members.
The nested instances are created through the direct forward-reference path and retain duplicate names instead of receiving the usual numeric suffixes.
Expected behavior
Nested flow instantiation should have the same cleanup and clone-naming behavior regardless of declaration order. All retained clones should have unique names, and incomplete instances should be removed.
Relevant code
core/org.osate.aadl2.instantiation/src/org/osate/aadl2/instantiation/CreateEndToEndFlowsSwitch.java, methodscaseComponentInstanceandprocessEndToEndFlow.