mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[gradle][debugger][IDEA-359503] do not append an empty string to the task's JVM args
GitOrigin-RevId: bd45c71d374774d99c9868a60d2aad932320a4f8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c796e05468
commit
e77c74fdd4
@@ -16,11 +16,24 @@ class GradleDebuggerUtil {
|
||||
}
|
||||
|
||||
static List<String> getProcessOptions() {
|
||||
String options = requireNonNullElse(System.getenv("PROCESS_OPTIONS"), "")
|
||||
return options.split(", ")
|
||||
String envValue = requireNonNullElse(System.getenv("PROCESS_OPTIONS"), "")
|
||||
if (isBlank(envValue)) {
|
||||
return Collections.emptyList()
|
||||
}
|
||||
List<String> options = new ArrayList<>()
|
||||
for (final def option in envValue.split(", ")) {
|
||||
if (!isBlank(option)) {
|
||||
options.add(option.trim())
|
||||
}
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
private static <T> T requireNonNullElse(T object, T fallback) {
|
||||
return (object != null) ? object : Objects.requireNonNull(fallback, "The fallback value must not be null!")
|
||||
}
|
||||
|
||||
private static boolean isBlank(String value) {
|
||||
return value == null || value.trim().isEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user