From afac95ab3e3c3308478072b7cd2bec71f94f6c8a Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 21 Jan 2019 10:11:00 +0100 Subject: [PATCH] run expensive VirtualDirectoryImpl.assertConsistency less frequently in tests --- .../openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java index 8f4bf404f1db..8357e84f5ecc 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java @@ -324,13 +324,17 @@ public class VirtualDirectoryImpl extends VirtualFileSystemEntry { if (!isValid()) { throw new InvalidVirtualFileAccessException(this); } - NewVirtualFileSystem delegate = getFileSystem(); - final boolean caseSensitive = delegate.isCaseSensitive(); if (allChildrenLoaded()) { - assertConsistency(caseSensitive, ""); return getArraySafely(); } + return loadAllChildren(); + } + + @NotNull + private VirtualFile[] loadAllChildren() { + NewVirtualFileSystem delegate = getFileSystem(); + boolean caseSensitive = delegate.isCaseSensitive(); synchronized (myData) { final boolean wasChildrenLoaded = ourPersistence.areChildrenLoaded(this); final FSRecords.NameId[] childrenIds = ourPersistence.listAll(this);