From bda6f9e0048d3fce74926712e7fe6d691655419c Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 24 Oct 2013 20:31:47 +0200 Subject: [PATCH] IDEA-114478 (refresh a directory before attempting to open a project from it) --- .../src/com/intellij/ide/impl/ProjectUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java index 10ca4943ca03..3c6861c8fcc2 100644 --- a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,10 +94,11 @@ public class ProjectUtil { * null otherwise */ @Nullable - public static Project openOrImport(@NotNull final String path, final Project projectToClose, boolean forceOpenInNewFrame) { - final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); - + public static Project openOrImport(@NotNull String path, Project projectToClose, boolean forceOpenInNewFrame) { + VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); if (virtualFile == null) return null; + virtualFile.refresh(false, false); + ProjectOpenProcessor strong = ProjectOpenProcessor.getStrongImportProvider(virtualFile); if (strong != null) { return strong.doOpenProject(virtualFile, projectToClose, forceOpenInNewFrame); @@ -137,6 +138,7 @@ public class ProjectUtil { return project; } + return null; }