From 563a156e0499bb026f3b8437b21cd77880c08f5c Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Fri, 25 Sep 2009 19:18:09 +0400 Subject: [PATCH] avoid calling VirtualFile.getChildren() when processing beforeDeletion events. Use getInDbChildren() instead --- .../src/com/intellij/util/indexing/FileBasedIndex.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java index 9115ade5ce42..56d9f8a7b2ac 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java @@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.*; import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.NewVirtualFile; +import com.intellij.openapi.vfs.newvfs.impl.NullVirtualFile; import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; @@ -1320,8 +1321,11 @@ public class FileBasedIndex implements ApplicationComponent { } if (file.isDirectory()) { if (isMock(file) || myManagingFS.wereChildrenAccessed(file)) { - for (VirtualFile child : file.getChildren()) { - invalidateIndices(child, markForReindex); + final Collection children = (file instanceof NewVirtualFile)? ((NewVirtualFile)file).getInDbChildren() : Arrays.asList(file.getChildren()); + for (VirtualFile child : children) { + if (NullVirtualFile.INSTANCE != child) { + invalidateIndices(child, markForReindex); + } } } }