From cb669b5900c9382d65c246700e0af44d061c4371 Mon Sep 17 00:00:00 2001 From: Eights-LI Date: Mon, 16 Nov 2020 20:34:32 +0800 Subject: [PATCH] deal with magic value --- .../apache/dolphinscheduler/server/utils/ProcessUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java index 40dd24239f..672ea7c70b 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java @@ -57,6 +57,8 @@ public class ProcessUtils { private static final Pattern WINDOWSATTERN = Pattern.compile("(\\d+)"); + private static final String LOCAL_PROCESS_EXEC = "jdk.lang.Process.allowAmbiguousCommands"; + /** * build command line characters. * @@ -115,9 +117,9 @@ public class ProcessUtils { boolean allowAmbiguousCommands = false; if (security == null) { allowAmbiguousCommands = true; - String value = System.getProperty("jdk.lang.Process.allowAmbiguousCommands"); + String value = System.getProperty(LOCAL_PROCESS_EXEC); if (value != null) { - allowAmbiguousCommands = !"false".equalsIgnoreCase(value); + allowAmbiguousCommands = !Constants.STRING_FALSE.equalsIgnoreCase(value); } } return allowAmbiguousCommands;