From 5b141a4b154a3273d124e1cb3fd34859e7cbf6ea Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 3 Apr 2013 20:06:51 +0200 Subject: [PATCH] Gevent debugging compatibility option (PY-9372). --- .../configurations/GeneralCommandLine.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java index 908c5c4d8535..ecd900483c93 100644 --- a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java +++ b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java @@ -26,6 +26,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.containers.HashMap; import com.intellij.util.text.CaseInsensitiveStringHashingStrategy; import gnu.trove.THashMap; import org.jetbrains.annotations.NonNls; @@ -42,13 +43,16 @@ import java.util.Map; /** * OS-independent way of executing external processes with complex parameters. - * + *

* Main idea of the class is to accept parameters "as-is", just as they should look to an external process, and quote/escape them * as required by the underlying platform. */ public class GeneralCommandLine implements UserDataHolder { - /** @deprecated use {@linkplain #inescapableQuote(String)} (to remove in IDEA 13) */ - @SuppressWarnings("UnusedDeclaration") public static Key DO_NOT_ESCAPE_QUOTES = Key.create("GeneralCommandLine.do.not.escape.quotes"); + /** + * @deprecated use {@linkplain #inescapableQuote(String)} (to remove in IDEA 13) + */ + @SuppressWarnings("UnusedDeclaration") public static Key DO_NOT_ESCAPE_QUOTES = + Key.create("GeneralCommandLine.do.not.escape.quotes"); private static final Logger LOG = Logger.getInstance("#com.intellij.execution.configurations.GeneralCommandLine"); private static final char QUOTE = '\uEFEF'; @@ -63,7 +67,8 @@ public class GeneralCommandLine implements UserDataHolder { private boolean myRedirectErrorStream = false; private Map myUserData = null; - public GeneralCommandLine() { } + public GeneralCommandLine() { + } public GeneralCommandLine(final String... command) { this(Arrays.asList(command)); @@ -104,6 +109,14 @@ public class GeneralCommandLine implements UserDataHolder { return myEnvParams; } + @NotNull + public Map getEnvParamsNotNull() { + if (myEnvParams == null) { + myEnvParams = new HashMap(); + } + return myEnvParams; + } + public void setEnvParams(@Nullable final Map envParams) { myEnvParams = envParams; } @@ -245,7 +258,8 @@ public class GeneralCommandLine implements UserDataHolder { return; } if (!myWorkDirectory.exists()) { - throw new ExecutionException(IdeBundle.message("run.configuration.error.working.directory.does.not.exist", myWorkDirectory.getAbsolutePath())); + throw new ExecutionException( + IdeBundle.message("run.configuration.error.working.directory.does.not.exist", myWorkDirectory.getAbsolutePath())); } if (!myWorkDirectory.isDirectory()) { throw new ExecutionException(IdeBundle.message("run.configuration.error.working.directory.not.directory"));