diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java index 5c6aff8553d3..18ab048233b4 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -104,7 +104,8 @@ import org.jetbrains.jps.cmdline.ClasspathBootstrap; import org.jetbrains.jps.incremental.Utils; import org.jetbrains.jps.model.serialization.JpsGlobalLoader; -import javax.tools.*; +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; import java.awt.*; import java.io.File; import java.io.IOException; @@ -734,7 +735,7 @@ public class BuildManager implements ApplicationComponent{ myBuildsInProgress.remove(projectPath); notifySessionTerminationIfNeeded(sessionId, execFailure); - if (Registry.is("compiler.process.preload") && !project.isDisposed()) { + if (isProcessPreloadingEnabled() && !project.isDisposed()) { runCommand(new Runnable() { public void run() { if (!myPreloadedBuilds.containsKey(projectPath)) { @@ -763,6 +764,11 @@ public class BuildManager implements ApplicationComponent{ return _future; } + private static boolean isProcessPreloadingEnabled() { + // automatically disable process preloading when debugging + return Registry.is("compiler.process.preload") && Registry.intValue("compiler.process.debug.port") <= 0 ; + } + private void notifySessionTerminationIfNeeded(UUID sessionId, @Nullable Throwable execFailure) { if (myMessageDispatcher.getAssociatedChannel(sessionId) == null) { // either the connection has never been established (process not started or execution failed), or no messages were sent from the launched process.