From 3ccdb4ff80bc659676cbba06c7dfbe39c4f7430f Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Wed, 16 Nov 2016 06:51:35 +0300 Subject: [PATCH] improve error report 2 --- .../openapi/vfs/ex/dummy/DummyCachingFileSystem.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java index 9d3d38412fd7..b6552220e2f7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java @@ -27,6 +27,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.BidirectionalMap; import com.intellij.util.containers.ConcurrentFactoryMap; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.FactoryMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -124,8 +125,12 @@ public abstract class DummyCachingFileSystem extends Dumm @NotNull public Project getProjectOrFail(String projectId) { List list = myProject2Id.getKeysByValue(projectId); - if (list == null || list.isEmpty()) throw new AssertionError(projectId + " project not found: " + myProject2Id.values()); - if (list.size() != 1) throw new AssertionError(projectId + " is mapped to several projects: " + list); + if (list == null || list.isEmpty()) { + throw new AssertionError(projectId + " project not found among: " + ContainerUtil.newArrayList(myProject2Id.values())); + } + if (list.size() != 1) { + throw new AssertionError(projectId + " is mapped to several projects: " + list); + } return list.get(0); }