JVM: restore incorrect DFS logic in JavaModuleGraph for compatibility

The problem is tracked in KT-66622. It should be fixed later, with a
proper deprecation, because otherwise it can potentially break a lot of
code.
This commit is contained in:
Alexander Udalov
2024-03-18 15:47:29 +01:00
committed by Space Team
parent 94e5cafb61
commit 621fe41b17
19 changed files with 64 additions and 0 deletions
@@ -78,6 +78,9 @@ class JavaModuleGraph(finder: JavaModuleFinder) {
for ((dependencyModuleName, isTransitive) in module.moduleInfo.requires) {
if (dependencyModuleName == dependencyName) return true
if (isTransitive && dfs(dependencyModuleName)) return true
// This is incorrect, but is left for compatibility, see KT-66622.
if (isTransitive && dfs(dependencyName)) return true
}
return false
}