diff --git a/examples/example-vfs/src/FileSystem.kt b/examples/example-vfs/src/FileSystem.kt index f056cd21ea8..f51edd33b74 100644 --- a/examples/example-vfs/src/FileSystem.kt +++ b/examples/example-vfs/src/FileSystem.kt @@ -23,12 +23,10 @@ public object FileSystem { private val lock = ReentrantReadWriteLock() internal val watchedDirectories = ArrayList - // FIXME VirtualFiles should be used as hashmap keys themselves, - // but overriden hashCode() method fails in runtime with ClassCastException (KT-1134) /** * Mapping from virtual files to metainformation */ - internal val fileToInfo = HashMap() + internal val fileToInfo = HashMap() private val listeners = ArrayList() /** @@ -85,7 +83,7 @@ public object FileSystem { require(FileSystem.fileToInfo[file.path] == null) val fileInfo = VirtualFileInfo(file) - FileSystem.fileToInfo[file.path] = fileInfo + FileSystem.fileToInfo[file] = fileInfo fileInfo.children.forEach{ scanAndAddRecursivelyNoEvents(it) } } diff --git a/examples/example-vfs/src/RefreshQueue.kt b/examples/example-vfs/src/RefreshQueue.kt index 925136ed9f6..4fe52a47a3c 100644 --- a/examples/example-vfs/src/RefreshQueue.kt +++ b/examples/example-vfs/src/RefreshQueue.kt @@ -86,7 +86,7 @@ internal object RefreshQueue { val fileInfo = VirtualFileInfo(file) - FileSystem.fileToInfo[file.path] = fileInfo + FileSystem.fileToInfo[file] = fileInfo FileSystem.notifyEventHappened(VirtualFileCreateEvent(file)) fileInfo.children.forEach{ addRecursively(it) }