improve error report 2 dbe/171.1003 idea/171.1004 pycharm/171.1005 pycharm/171.1006
authorGregory.Shrago <gregory.shrago@jetbrains.com>
Wed, 16 Nov 2016 03:51:35 +0000 (06:51 +0300)
committerGregory.Shrago <gregory.shrago@jetbrains.com>
Wed, 16 Nov 2016 03:51:35 +0000 (06:51 +0300)
platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java

index 9d3d38412fd7ee2286dac42f5b2c60c28ffb0576..b6552220e2f7bc5d141453f9458c60da911ccbfe 100644 (file)
@@ -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<T extends VirtualFile> extends Dumm
   @NotNull
   public Project getProjectOrFail(String projectId) {
     List<Project> 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);
   }