@@ -1624,43 +1624,44 @@ internal fun getCommonEnvVars(
16241624 return (minimalEnvVars + commonEnvVars).toMutableMap()
16251625}
16261626
1627- private fun getNewDependenciesIfExist (
1627+ private fun getReplacedDependenciesFromPreviousStackedContainer (
16281628 mergedContainerNames : MutableMap <String , String >,
16291629 container : ScenarioRunContainer
16301630): ScenarioRunContainer {
1631- var tmp : ScenarioRunContainer = container
1632- var dependencies: MutableList < String > = mutableListOf ()
1631+ var copyOfCurrentContainer : ScenarioRunContainer = container
1632+ var dependencies = mutableListOf< String > ()
16331633 container.dependencies?.forEach {
16341634 if (mergedContainerNames.containsKey(it)) {
16351635 dependencies.add(mergedContainerNames.get(it)!! )
16361636 }
16371637 }
16381638 if (dependencies.isNotEmpty()) {
1639- tmp = container.copy(dependencies = dependencies)
1639+ copyOfCurrentContainer = container.copy(dependencies = dependencies)
16401640 }
1641- return tmp
1641+ return copyOfCurrentContainer
16421642}
16431643
16441644private fun stackSolutionContainers (
16451645 containers : MutableList <ScenarioRunContainer >
16461646): MutableList <ScenarioRunContainer > {
1647- val stackedContainers: MutableList < ScenarioRunContainer > = mutableListOf ()
1647+ val stackedContainers = mutableListOf< ScenarioRunContainer > ()
16481648 var stackedContainer: ScenarioRunContainer ? = null
16491649 var stackedIndex = 1
1650- val mergedContainerNames: MutableMap <String , String > = mutableMapOf ()
1650+ val mergedContainerNames = mutableMapOf <String , String >()
16511651 for (container in containers) {
16521652 if (container.solutionContainer != true ) {
1653- var tmpContainer : ScenarioRunContainer = container
1653+ var copyOfCurrentContainer : ScenarioRunContainer = container
16541654 if (stackedContainer != null ) {
16551655 stackedContainers.add(stackedContainer)
1656- tmpContainer = container.copy(dependencies = mutableListOf (stackedContainer.name))
1656+ copyOfCurrentContainer = container.copy(dependencies = mutableListOf (stackedContainer.name))
16571657 stackedIndex++
16581658 }
16591659 stackedContainer = null
1660- stackedContainers.add(tmpContainer )
1660+ stackedContainers.add(copyOfCurrentContainer )
16611661 } else {
16621662 if (stackedContainer == null ) {
1663- stackedContainer = getNewDependenciesIfExist(mergedContainerNames, container)
1663+ stackedContainer =
1664+ getReplacedDependenciesFromPreviousStackedContainer(mergedContainerNames, container)
16641665 } else {
16651666 val previousStackedContainer = stackedContainer
16661667 stackedContainer = mergeSolutionContainer(stackedIndex, stackedContainer, container)
0 commit comments