Add own PathStringDescriptor to compare paths properly on case-insensitive filesystems

This commit is contained in:
Zalim Bashorov
2016-01-20 18:43:53 +03:00
parent c585d91e79
commit 1e6b3c5ae1
2 changed files with 7 additions and 2 deletions
@@ -496,8 +496,7 @@ open class IncrementalCacheImpl<Target>(
override fun dumpValue(value: String): String = value
}
// TODO: find how to deal with PathStringDescriptor - it seems too deeply rooted in jps
inner class SourceToClassesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, /* PathStringDescriptor.INSTANCE,*/ StringCollectionExternalizer) {
inner class SourceToClassesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
}
@@ -171,6 +171,12 @@ object IntExternalizer : DataExternalizer<Int> {
}
}
object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun getHashCode(value: String) = FileUtil.pathHashCode(value)
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())