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 c83f80ed8320..d730b2687ae4 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -32,7 +32,7 @@ import com.intellij.openapi.compiler.ex.CompilerPathsEx; import com.intellij.openapi.deployment.DeploymentUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.module.LanguageLevelUtil; +import com.intellij.openapi.module.EffectiveLanguageLevelUtil; import com.intellij.openapi.module.Module; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; @@ -295,12 +295,14 @@ public class CompileDriver { switch (eventType) { case FILES_GENERATED: final List generated = event.getGeneratedFilesList(); - final CompilationStatusListener publisher = messageBus.syncPublisher(CompilerTopics.COMPILATION_STATUS); + final CompilationStatusListener publisher = myProject.isDisposed()? messageBus.syncPublisher(CompilerTopics.COMPILATION_STATUS) : null; Set writtenArtifactOutputPaths = outputToArtifact != null ? new THashSet(FileUtil.PATH_HASHING_STRATEGY) : null; for (CmdlineRemoteProto.Message.BuilderMessage.BuildEvent.GeneratedFile generatedFile : generated) { final String root = FileUtil.toSystemIndependentName(generatedFile.getOutputRoot()); final String relativePath = FileUtil.toSystemIndependentName(generatedFile.getRelativePath()); - publisher.fileGenerated(root, relativePath); + if (publisher != null) { + publisher.fileGenerated(root, relativePath); + } if (outputToArtifact != null) { Collection artifacts = outputToArtifact.get(root); if (!artifacts.isEmpty()) { @@ -508,7 +510,7 @@ public class CompileDriver { messageType.toNotificationType(), new MessagesActivationListener(compileContext) ).setImportant(false); - compileContext.getBuildSession().registerCloseAction(() -> notification.expire()); + compileContext.getBuildSession().registerCloseAction(notification::expire); notification.notify(myProject); if (_status != ExitStatus.UP_TO_DATE && compileContext.getMessageCount(null) > 0) { @@ -614,7 +616,7 @@ public class CompileDriver { statusBar.setInfo(""); } if (progressIndicator instanceof CompilerTask) { - ApplicationManager.getApplication().invokeLater(() -> ((CompilerTask)progressIndicator).showCompilerContent()); + ApplicationManager.getApplication().invokeLater(((CompilerTask)progressIndicator)::showCompilerContent); } } return true; @@ -690,7 +692,7 @@ public class CompileDriver { } } - LanguageLevel moduleLanguageLevel = LanguageLevelUtil.getEffectiveLanguageLevel(module); + LanguageLevel moduleLanguageLevel = EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(module); if (languageLevel == null) { languageLevel = moduleLanguageLevel; }