[IC] Revert the paths hashing introduced in 5562c95155

`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
This commit is contained in:
Alexander.Likhachev
2023-12-11 20:40:29 +01:00
committed by Space Team
parent 0944e8fc36
commit 0d4dfbcf0c
@@ -47,9 +47,7 @@ private class FileDescriptor(private val pathConverter: FileToPathConverter) : K
// 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 {