[IC] Revert the paths hashing introduced in 5562c95155f30f7ff3e7bd33cd17a49bcc778890 `File.hashCode()` behavior is OS-dependent. This can lead to the loss of mapping between a path and its related data in PersistentHashMap — for instance, when a map generated on Microsoft Windows is used on macOS. Notably, this can occur even though both systems use case-insensitive filesystems by default. This commit returns the hashing based on OS-independent path strings ^KT-64016 Verification Pending
diff --git a/build-common/src/org/jetbrains/kotlin/incremental/storage/FileToPathConverter.kt b/build-common/src/org/jetbrains/kotlin/incremental/storage/FileToPathConverter.kt index bb2eeab..1bff695 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/storage/FileToPathConverter.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/storage/FileToPathConverter.kt
@@ -47,9 +47,7 @@ // If we use a RelocatableFileToPathConverter instead, the file paths will be normalized first, so we'll get the same hash codes: // [In "/path/to/project1"] File("src/foo.kt").hashCode() = 789 // [In "/path/to/project2"] File("src/foo.kt").hashCode() = 789 - // It's also important to get the hash code using `File.hashCode()` instead of `String.hashCode()` because the hashCode() method - // needs to account for case-insensitive filesystems. - return File(pathConverter.toPath(file)).hashCode() + return pathConverter.toPath(file).hashCode() } override fun isEqual(file1: File, file2: File): Boolean {