From 06c3d2ef3d5f46567ea7138d41b933062c5be5f9 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Fri, 13 Nov 2009 15:55:02 +0300 Subject: [PATCH] cosmetics, remove redundant refresh --- .../javaCompiler/BackendCompilerWrapper.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java index aa32160eda0d..c94739f31f39 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java @@ -239,11 +239,6 @@ public class BackendCompilerWrapper { private void compileModules(final Map> moduleToFilesMap) throws CompilerException { myProcessedFilesCount = 0; - //myTotalFilesToCompile = 0; - //for (List list : moduleToFilesMap.values()) { - // myTotalFilesToCompile += list.size(); - //} - try { compileChunk(new ModuleChunk(myCompileContext, myChunk, moduleToFilesMap)); } @@ -262,7 +257,8 @@ public class BackendCompilerWrapper { try { for (final OutputDir outputDir : outs) { - doCompile(chunk, outputDir.getPath(), outputDir.getKind()); + chunk.setSourcesFilter(outputDir.getKind()); + doCompile(chunk, outputDir.getPath()); } } finally { @@ -295,7 +291,7 @@ public class BackendCompilerWrapper { } @Nullable - private File getOutputDirsToCompileTo(ModuleChunk chunk, final List pairs) throws IOException { + private File getOutputDirsToCompileTo(ModuleChunk chunk, final List dirs) throws IOException { File fileToDelete = null; if (chunk.getModuleCount() == 1) { // optimization final Module module = chunk.getModules()[0]; @@ -304,14 +300,14 @@ public class BackendCompilerWrapper { final String sourcesOutputDir = getOutputDir(module); if (shouldCompileTestsSeparately(module)) { if (sourcesOutputDir != null) { - pairs.add(new OutputDir(sourcesOutputDir, ModuleChunk.SOURCES)); + dirs.add(new OutputDir(sourcesOutputDir, ModuleChunk.SOURCES)); } final String testsOutputDir = getTestsOutputDir(module); if (testsOutputDir == null) { LOG.error("Tests output dir is null for module \"" + module.getName() + "\""); } else { - pairs.add(new OutputDir(testsOutputDir, ModuleChunk.TEST_SOURCES)); + dirs.add(new OutputDir(testsOutputDir, ModuleChunk.TEST_SOURCES)); } } else { // both sources and test sources go into the same output @@ -319,7 +315,7 @@ public class BackendCompilerWrapper { LOG.error("Sources output dir is null for module \"" + module.getName() + "\""); } else { - pairs.add(new OutputDir(sourcesOutputDir, ModuleChunk.ALL_SOURCES)); + dirs.add(new OutputDir(sourcesOutputDir, ModuleChunk.ALL_SOURCES)); } } } @@ -328,7 +324,7 @@ public class BackendCompilerWrapper { else { // chunk has several modules final File outputDir = FileUtil.createTempDirectory("compile", "output"); fileToDelete = outputDir; - pairs.add(new OutputDir(outputDir.getPath(), ModuleChunk.ALL_SOURCES)); + dirs.add(new OutputDir(outputDir.getPath(), ModuleChunk.ALL_SOURCES)); } return fileToDelete; } @@ -408,9 +404,8 @@ public class BackendCompilerWrapper { } } - private void doCompile(@NotNull final ModuleChunk chunk, @NotNull String outputDir, int sourcesFilter) throws IOException { + private void doCompile(@NotNull final ModuleChunk chunk, @NotNull String outputDir) throws IOException { myCompileContext.getProgressIndicator().checkCanceled(); - chunk.setSourcesFilter(sourcesFilter); if (ApplicationManager.getApplication().runReadAction(new Computable() { public Boolean compute() { @@ -645,7 +640,6 @@ public class BackendCompilerWrapper { it.remove(); // to free memory } } - CompilerUtil.refreshIOFiles(toRefresh); myFileNameToSourceMap.clear(); // clear the map before the next use }