From 65e4edeb023283190040dcf9b1566e8991dbe0da Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 15 Nov 2016 01:57:02 +0300 Subject: [PATCH] improve error report --- .../openapi/vfs/ex/dummy/DummyCachingFileSystem.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 40bde0ea332f..9d3d38412fd7 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 @@ -121,6 +121,14 @@ public abstract class DummyCachingFileSystem extends Dumm return list == null || list.size() > 1 ? null : list.get(0); } + @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); + return list.get(0); + } + @NotNull public Collection getCachedFiles() { return myCachedFiles.notNullValues();