diff --git a/plugins/package-managers/bower/src/main/kotlin/Bower.kt b/plugins/package-managers/bower/src/main/kotlin/Bower.kt index 1857afcbfd95a..3801a288cb102 100644 --- a/plugins/package-managers/bower/src/main/kotlin/Bower.kt +++ b/plugins/package-managers/bower/src/main/kotlin/Bower.kt @@ -194,7 +194,7 @@ private val PackageInfo.key: String? } -private fun getNodesWithCompleteDependencies(info: PackageInfo): Map { +private fun getPackageInfosWithCompleteDependencies(info: PackageInfo): Map { val result = mutableMapOf() val stack = Stack().apply { push(info) } @@ -218,26 +218,27 @@ private fun getNodesWithCompleteDependencies(info: PackageInfo): Map = getNodesWithCompleteDependencies(info) + alternativeInfos: Map = getPackageInfosWithCompleteDependencies(info) ): Set { val result = mutableSetOf() if (!hasCompleteDependencies(info, scopeName)) { - // Bower leaves out a dependency entry for a child if there exists a similar node to its parent node + // Bower leaves out a dependency entry for a child if there exists a similar entry to its parent entry // with the exact same name and resolved target. This makes it necessary to retrieve the information - // about the subtree rooted at the parent from that other node containing the full dependency + // about the subtree rooted at the parent from that other entry containing the full dependency // information. // See https://github.com/bower/bower/blob/6bc778d/lib/core/Manager.js#L557 and below. - val alternativeNode = alternativeNodes.getValue(info.key!!) - return parseDependencyTree(alternativeNode, scopeName, alternativeNodes) + + val alternativeInfo = alternativeInfos.getValue(info.key!!) + return parseDependencyTree(alternativeInfo, scopeName, alternativeInfos) } info.pkgMeta.getDependencies(scopeName).keys.forEach { - val childNode = info.dependencies.getValue(it) + val childInfo = info.dependencies.getValue(it) val childScope = SCOPE_NAME_DEPENDENCIES - val childDependencies = parseDependencyTree(childNode, childScope, alternativeNodes) + val childDependencies = parseDependencyTree(childInfo, childScope, alternativeInfos) val packageReference = PackageReference( - id = parsePackageId(childNode), + id = parsePackageId(childInfo), dependencies = childDependencies ) result += packageReference