提交 1931d824 编写于 作者: E Evgeny Gerashchenko

Changed keys for FileSystem.fileToInfo map (because of fixed compiler bugs)

上级 6772df32
......@@ -23,12 +23,10 @@ public object FileSystem {
private val lock = ReentrantReadWriteLock()
internal val watchedDirectories = ArrayList<VirtualFile>
// 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<String, VirtualFileInfo>()
internal val fileToInfo = HashMap<VirtualFile, VirtualFileInfo>()
private val listeners = ArrayList<VirtualFileListener>()
/**
......@@ -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) }
}
......
......@@ -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) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册