IDEA-143013 Compound RC: StackOverflowError on enabling Compound RC inside another...
authorVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Wed, 29 Jul 2015 18:41:58 +0000 (21:41 +0300)
committerVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Wed, 29 Jul 2015 18:59:50 +0000 (21:59 +0300)
platform/lang-impl/src/com/intellij/execution/compound/CompoundRunConfiguration.java
platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java
platform/lang-impl/src/com/intellij/execution/impl/SingleConfigurationConfigurable.java

index 97d77a9c6c4d3eee00f97fcf18616952b476fc8a..af6cd2fe4ddacf6a7a385d199ea8ee015e3ed8ba 100644 (file)
@@ -61,7 +61,7 @@ public class CompoundRunConfiguration extends RunConfigurationBase implements Wi
     RunManagerImpl manager = RunManagerImpl.getInstanceImpl(getProject());
     for (Pair<String, String> pair : myPairs) {
       RunnerAndConfigurationSettings settings = manager.findConfigurationByTypeAndName(pair.first, pair.second);
-      if (settings != null) {
+      if (settings != null && settings.getConfiguration() != this) {
         mySetToRun.add(settings.getConfiguration());
       }
     }
index d44a549341e82c10b3611d61298f3bf1a20209ed..29ae43243dd0231bc7e051acd97bc405c32b224b 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.execution.configurations.*;
 import com.intellij.icons.AllIcons;
 import com.intellij.ide.DataManager;
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.options.*;
@@ -399,6 +400,12 @@ class RunConfigurable extends BaseConfigurable {
     myRightPanel.add(scrollPane, BorderLayout.CENTER);
     if (configurable instanceof SingleConfigurationConfigurable) {
       myRightPanel.add(((SingleConfigurationConfigurable)configurable).getValidationComponent(), BorderLayout.SOUTH);
+      ApplicationManager.getApplication().invokeLater(new Runnable() {
+        @Override
+        public void run() {
+          ((SingleConfigurationConfigurable)configurable).updateWarning();
+        }
+      });
       if (configurableComponent != null) {
         DataProvider dataProvider = DataManager.getDataProvider(configurableComponent);
         if (dataProvider != null) {
index 33778d58d7895ff165b9d2e7c1fe9e2fa9834b3b..3136493baa637ac5a593e9539ec9e9c5ec65537a 100644 (file)
@@ -125,6 +125,13 @@ public final class SingleConfigurationConfigurable<Config extends RunConfigurati
     myComponent.doReset(configuration);
   }
 
+  void updateWarning() {
+    myValidationResultValid = false;
+    if (myComponent != null) {
+      myComponent.updateWarning();
+    }
+  }
+
   @Override
   public final JComponent createComponent() {
     myComponent.myNameText.setEnabled(!myBrokenConfiguration);