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;
@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);
}