EA-73474 - assert: DummyCachingFileSystem.onProjectOpened

This commit is contained in:
Gregory.Shrago
2015-12-02 00:25:49 +03:00
parent 477828b249
commit 355a056b4d
@@ -101,6 +101,9 @@ public class ProjectUtil {
if (virtualFile == null) return null;
virtualFile.refresh(false, false);
Project existing = findAndFocusExistingProjectForPath(path);
if (existing != null) return existing;
ProjectOpenProcessor strong = ProjectOpenProcessor.getStrongImportProvider(virtualFile);
if (strong != null) {
return strong.doOpenProject(virtualFile, projectToClose, forceOpenInNewFrame);
@@ -158,14 +161,10 @@ public class ProjectUtil {
return null;
}
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
for (Project project : openProjects) {
if (!project.isDefault() && isSameProject(path, project)) {
focusProjectWindow(project, false);
return project;
}
}
Project existing = findAndFocusExistingProjectForPath(path);
if (existing != null) return existing;
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
if (!forceOpenInNewFrame && openProjects.length > 0) {
int exitCode = confirmOpenNewProject(false);
if (exitCode == GeneralSettings.OPEN_PROJECT_SAME_WINDOW) {
@@ -199,6 +198,18 @@ public class ProjectUtil {
return project;
}
@Nullable
private static Project findAndFocusExistingProjectForPath(String path) {
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
for (Project project : openProjects) {
if (!project.isDefault() && isSameProject(path, project)) {
focusProjectWindow(project, false);
return project;
}
}
return null;
}
/**
* @return {@link com.intellij.ide.GeneralSettings#OPEN_PROJECT_SAME_WINDOW}
* {@link com.intellij.ide.GeneralSettings#OPEN_PROJECT_NEW_WINDOW}