diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java index b3a7fb1ce535..6efb8555b579 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -950,6 +950,7 @@ public class CompileDriver { } })); + final DumbService dumbService = DumbService.getInstance(myProject); try { VirtualFile[] snapshot = null; final Map, Collection> chunkMap = new HashMap, Collection>(); @@ -963,6 +964,7 @@ public class CompileDriver { final Set allDependent = new HashSet(); try { int round = 0; + boolean compiledSomethingForThisChunk = false; Collection dependentFiles = Collections.emptyList(); final Function>, Pair>> dependencyFilter = new DependentClassesCumulativeFilter(); @@ -973,8 +975,8 @@ public class CompileDriver { if (context.getProgressIndicator().isCanceled()) { throw new ExitException(ExitStatus.CANCELLED); } - context.getProgressIndicator().setText("Preparing sources for " + compiler.getDescription()); - DumbService.getInstance(myProject).waitForSmartMode(); + + dumbService.waitForSmartMode(); if (round == 0) { if (snapshot == null || ContainerUtil.intersects(generatedTypes, compilerManager.getRegisteredInputTypes(compiler))) { @@ -1022,10 +1024,11 @@ public class CompileDriver { } didSomething |= compiledSomething; + compiledSomethingForThisChunk |= didSomething; } final boolean hasUnprocessedTraverseRoots = context.getDependencyCache().hasUnprocessedTraverseRoots(); - if (!isRebuild && (didSomething || hasUnprocessedTraverseRoots)) { + if (!isRebuild && (compiledSomethingForThisChunk || hasUnprocessedTraverseRoots)) { final Set compiledWithSuccess; final Set compiledWithErrors = CacheUtils.getFilesCompiledWithErrors(context); if (compiledWithErrors.isEmpty()) { @@ -1516,7 +1519,7 @@ public class CompileDriver { }); if (ex[0] != null) { throw ex[0]; - } + } if (onlyCheckStatus) { if (toGenerate.isEmpty() && pathsToRemove.isEmpty()) {