improve error report

This commit is contained in:
Gregory.Shrago
2016-11-15 01:58:56 +03:00
parent 43c81ef35d
commit 65e4edeb02
@@ -121,6 +121,14 @@ public abstract class DummyCachingFileSystem<T extends VirtualFile> extends Dumm
return list == null || list.size() > 1 ? null : list.get(0);
}
@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);
return list.get(0);
}
@NotNull
public Collection<T> getCachedFiles() {
return myCachedFiles.notNullValues();