summaryrefslogtreecommitdiff
path: root/analysis
diff options
context:
space:
mode:
authorPavel Kirpichenkov <pavel.kirpichenkov@jetbrains.com>2020-10-27 16:51:50 +0300
committerkotlin-ide-monorepo-bot <kotlin-ide-monorepo-bot-no-reply@jetbrains.com>2020-10-27 14:05:19 +0000
commitbf564b08bca4ac9a3a02afe8d1536b59c4f0e96f (patch)
treeec50f636ee82488622c76d84b42b19cea9ce7aa4 /analysis
parent3823a6cc96d37c635d664ea8ed2b5143fb59b3af (diff)
downloadintellij-kotlin-bf564b08bca4ac9a3a02afe8d1536b59c4f0e96f.tar.gz
ModuleInfos: update LibraryInfo comparison
Drop kind and properties, compare based on roots and excluded roots. Libraries with the same roots should be equal in terms of analysis. KT-42607 GitOrigin-RevId: 7c595e5387da352df526be442d4c9b11b3ab4283
Diffstat (limited to 'analysis')
-rw-r--r--analysis/src/org/jetbrains/kotlin/idea/caches/project/IdeaModuleInfos.kt2
-rw-r--r--analysis/src/org/jetbrains/kotlin/idea/caches/project/moduleInfosFromIdeaModel.kt6
2 files changed, 3 insertions, 5 deletions
diff --git a/analysis/src/org/jetbrains/kotlin/idea/caches/project/IdeaModuleInfos.kt b/analysis/src/org/jetbrains/kotlin/idea/caches/project/IdeaModuleInfos.kt
index 9b31b906d8fb..06e5b9c05635 100644
--- a/analysis/src/org/jetbrains/kotlin/idea/caches/project/IdeaModuleInfos.kt
+++ b/analysis/src/org/jetbrains/kotlin/idea/caches/project/IdeaModuleInfos.kt
@@ -381,7 +381,7 @@ abstract class LibraryInfo(override val project: Project, val library: Library)
if (this === other) return true
if (other !is LibraryInfo) return false
- return library.asLibraryEx().equalsIgnoreNames(other.library.asLibraryEx())
+ return library.asLibraryEx().hasEqualRoots(other.library.asLibraryEx())
}
override fun hashCode(): Int = library.asLibraryEx().rootBasedHashCode()
diff --git a/analysis/src/org/jetbrains/kotlin/idea/caches/project/moduleInfosFromIdeaModel.kt b/analysis/src/org/jetbrains/kotlin/idea/caches/project/moduleInfosFromIdeaModel.kt
index a26494d60479..3800d8b9be46 100644
--- a/analysis/src/org/jetbrains/kotlin/idea/caches/project/moduleInfosFromIdeaModel.kt
+++ b/analysis/src/org/jetbrains/kotlin/idea/caches/project/moduleInfosFromIdeaModel.kt
@@ -68,7 +68,7 @@ private class LibraryWrapper(val library: LibraryEx) {
if (this === other) return true
if (other !is LibraryWrapper) return false
- return library.equalsIgnoreNames(other.library)
+ return library.hasEqualRoots(other.library)
}
override fun hashCode(): Int = library.rootBasedHashCode()
@@ -88,10 +88,8 @@ internal val LibraryEx.allRootUrls: Set<String>
}
}
-internal fun LibraryEx.equalsIgnoreNames(other: LibraryEx): Boolean {
+internal fun LibraryEx.hasEqualRoots(other: LibraryEx): Boolean {
if (allRootUrls != other.allRootUrls) return false
- if (kind != other.kind) return false
- if (properties != other.properties) return false
return excludedRootUrls.contentEquals(other.excludedRootUrls)
}