From 4f75a5afb3105a4a79c6eb1c5b4db6bce6dc3bca Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 6 Jul 2009 15:39:46 +0400 Subject: [PATCH] changed the way VirtualFiles for generation dirs are searched on make startup --- .../impl/com/intellij/compiler/impl/CompileDriver.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/impl/com/intellij/compiler/impl/CompileDriver.java b/compiler/impl/com/intellij/compiler/impl/CompileDriver.java index 57a05ba36c..6232725588 100644 --- a/compiler/impl/com/intellij/compiler/impl/CompileDriver.java +++ b/compiler/impl/com/intellij/compiler/impl/CompileDriver.java @@ -1862,14 +1862,18 @@ public class CompileDriver { private static VirtualFile lookupVFile(final IntermediateOutputCompiler compiler, final Module module, final boolean forTestSources) { final File file = new File(CompilerPaths.getGenerationOutputPath(compiler, module, forTestSources)); - final VirtualFile vFile; - if (file.mkdirs()) { - vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file); - } - else { - vFile = LocalFileSystem.getInstance().findFileByIoFile(file); + final LocalFileSystem lfs = LocalFileSystem.getInstance(); + + VirtualFile vFile = lfs.findFileByIoFile(file); + if (vFile != null) { + return vFile; } - assert vFile != null: "Virtual file not found for " + file.getPath(); + + final boolean justCreated = file.mkdirs(); + vFile = lfs.refreshAndFindFileByIoFile(file); + + assert vFile != null: "Virtual file not found for " + file.getPath() + "; mkdirs() exit code is " + justCreated; + return vFile; } -- 2.11.4.GIT