Summary
End-to-end flow instantiation fails when a data or subprogram access feature resolves to more than one eligible semantic connection instance.
CreateEndToEndFlowsSwitch.processAccess branches over the eligible connection instances. The first branch clears and repopulates the shared declarative connections list and advances traversal state. Although the end-to-end flow instance and iterator stack are cloned for another branch, the connection state needed by the next branch is not restored. The next iteration can therefore evaluate connections.get(connections.size() - 1) with an empty list.
Reproduction
Use a component flow that passes through an access feature which is connected externally to two accessed data components. Both external connections are valid semantic continuations through the same internal access connection.
Instantiation currently fails in processAccess with:
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
The failing access is connections.get(connections.size() - 1) after the first candidate has cleared the shared list.
Expected behavior
Instantiation should create one correctly named end-to-end flow instance for each eligible semantic connection path. Each branch should continue with an independent copy of all traversal state, including the declarative connection filter.
Relevant code
core/org.osate.aadl2.instantiation/src/org/osate/aadl2/instantiation/CreateEndToEndFlowsSwitch.java, method processAccess.
Summary
End-to-end flow instantiation fails when a data or subprogram access feature resolves to more than one eligible semantic connection instance.
CreateEndToEndFlowsSwitch.processAccessbranches over the eligible connection instances. The first branch clears and repopulates the shared declarativeconnectionslist and advances traversal state. Although the end-to-end flow instance and iterator stack are cloned for another branch, the connection state needed by the next branch is not restored. The next iteration can therefore evaluateconnections.get(connections.size() - 1)with an empty list.Reproduction
Use a component flow that passes through an access feature which is connected externally to two accessed data components. Both external connections are valid semantic continuations through the same internal access connection.
Instantiation currently fails in
processAccesswith:The failing access is
connections.get(connections.size() - 1)after the first candidate has cleared the shared list.Expected behavior
Instantiation should create one correctly named end-to-end flow instance for each eligible semantic connection path. Each branch should continue with an independent copy of all traversal state, including the declarative connection filter.
Relevant code
core/org.osate.aadl2.instantiation/src/org/osate/aadl2/instantiation/CreateEndToEndFlowsSwitch.java, methodprocessAccess.