mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 04:21:24 +07:00
cleanup [java]: introduce data class instead of Pair in ClassAncestorResolver to make code more readable (IJ-CR-188646)
Space-RevId: 677557d66e2954f5d2996fc4adab14e87f919679 GitOrigin-RevId: c9b74011da8647de7054f18f5f77b8db347caada
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a08972374a
commit
175f4430dc
@@ -43,14 +43,19 @@ internal class ClassAncestorResolver(private val classpath: List<Path>) {
|
||||
}
|
||||
|
||||
private fun collectPackagesInClasspath(classpath: List<Path>): Map<String, List<Path>> {
|
||||
data class PackageToClasspathRoot(val packageName: String, val classpathRoot: Path)
|
||||
|
||||
return classpath
|
||||
.asSequence()
|
||||
.flatMap { root ->
|
||||
withClassRootEntries(root) {
|
||||
it.map { entry -> root to entry.entryName.substringBeforeLast(delimiter = '/', missingDelimiterValue = "") }.toSet()
|
||||
.flatMap { classpathRoot ->
|
||||
withClassRootEntries(classpathRoot) {
|
||||
it.map { entry ->
|
||||
val packageName = entry.entryName.substringBeforeLast(delimiter = '/', missingDelimiterValue = "")
|
||||
PackageToClasspathRoot(packageName, classpathRoot)
|
||||
}.toSet()
|
||||
}
|
||||
}
|
||||
.groupBy({ it.second }, { it.first })
|
||||
.groupBy({ it.packageName }, { it.classpathRoot })
|
||||
}
|
||||
|
||||
private fun collectSuperclasses(binaryClassName: String): List<String> {
|
||||
|
||||
Reference in New Issue
Block a user