diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/launcher/GuiTestLocalLauncher.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/launcher/GuiTestLocalLauncher.kt index e5cad939a4bb..0a922d7ea456 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/launcher/GuiTestLocalLauncher.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/launcher/GuiTestLocalLauncher.kt @@ -223,7 +223,7 @@ object GuiTestLocalLauncher { .plus("-Didea.config.path=${GuiTestOptions.getConfigPath()}") .plus("-Didea.system.path=${GuiTestOptions.getSystemPath()}") .plus("-Dfile.encoding=${GuiTestOptions.getEncoding()}") - .plus(if (ide.ideType.platformPrefix.isNullOrEmpty()) "" else "-Didea.platform.prefix=${ide.ideType.platformPrefix}") + .plusIf(!ide.ideType.platformPrefix.isNullOrEmpty(), "-Didea.platform.prefix=${ide.ideType.platformPrefix}") .plus(customVmOptions) .plus("-Xdebug") .plus("-Xrunjdwp:transport=dt_socket,server=y,suspend=${GuiTestOptions.suspendDebug()},address=${GuiTestOptions.getDebugPort()}") @@ -390,4 +390,16 @@ object GuiTestLocalLauncher { return Paths.get(this.toURI()).toFile().path } + /** + * Returns a list containing all elements of the original collection and then the given [element]. + */ + private fun List.plusIf(condition: Boolean, element: T): List { + if (!condition) return this + val result = ArrayList(size + 1) + result.addAll(this) + result.add(element) + return result + } + + } \ No newline at end of file