do not run automake in alarm's thread
authorEugene Zhuravlev <jeka@intellij.com>
Tue, 31 Jan 2012 17:09:15 +0000 (18:09 +0100)
committerEugene Zhuravlev <jeka@intellij.com>
Tue, 31 Jan 2012 17:12:22 +0000 (18:12 +0100)
java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java
java/compiler/impl/src/com/intellij/compiler/impl/CompilerUtil.java

index 05aaeb88f46d7b5f790f63e3f2604bab71660c8a..d2862e6289eadceb4b724b2be0096d327d369905 100644 (file)
@@ -128,12 +128,17 @@ public class CompileServerManager implements ApplicationComponent{
             @Override
             public void run() {
               if (!myAutoMakeInProgress.getAndSet(true)) {
-                try {
-                  runAutoMake();
-                }
-                finally {
-                  myAutoMakeInProgress.set(false);
-                }
+                ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+                  @Override
+                  public void run() {
+                    try {
+                      runAutoMake();
+                    }
+                    finally {
+                      myAutoMakeInProgress.set(false);
+                    }
+                  }
+                });
               }
               else {
                 scheduleMake(this);
index a7637185dc21b0652b0cd226f173c05e62fb2610..066baa7ea5381f2ee936c7c6cfd2fe38a2ae4fe1 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.compiler.CompilerBundle;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.CharsetToolkit;
 import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VfsUtil;
@@ -155,7 +156,7 @@ public class CompilerUtil {
 
   public static void addSourceCommandLineSwitch(final Sdk jdk, LanguageLevel chunkLanguageLevel, @NonNls final List<String> commandLine) {
     final String versionString = jdk.getVersionString();
-    if (versionString == null || "".equals(versionString)) {
+    if (StringUtil.isEmpty(versionString)) {
       throw new IllegalArgumentException(CompilerBundle.message("javac.error.unknown.jdk.version", jdk.getName()));
     }