From 1931d8241666c7c760467b22f16e431cf2f6f84c Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Sun, 8 Apr 2012 16:42:34 +0400 Subject: [PATCH] Changed keys for FileSystem.fileToInfo map (because of fixed compiler bugs) --- examples/example-vfs/src/FileSystem.kt | 6 ++---- examples/example-vfs/src/RefreshQueue.kt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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) }