diff --git a/platform/projectModel-impl/src/com/intellij/util/io/path.kt b/platform/projectModel-impl/src/com/intellij/util/io/path.kt index 712ca78a0347..5d848030323a 100644 --- a/platform/projectModel-impl/src/com/intellij/util/io/path.kt +++ b/platform/projectModel-impl/src/com/intellij/util/io/path.kt @@ -223,50 +223,4 @@ inline fun Path.directoryStreamIfExists(noinline filter: ((path: Path) -> Bo return null } -private val LOG = Logger.getInstance("#com.intellij.openapi.util.io.FileUtil") - -class PathMatcherEx(pattern: String) : PathMatcher { - private val matcher: PathMatcher - - val negate = pattern.startsWith('!') - val rawPattern: String - - init { - rawPattern = if (negate) pattern.substring(1) else pattern - matcher = FileSystems.getDefault().getPathMatcher("glob:$rawPattern") - } - - override fun matches(path: Path) = if (negate) !matcher.matches(path) else matcher.matches(path) - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other?.javaClass != javaClass) return false - - other as PathMatcherEx - - if (negate != other.negate) return false - if (rawPattern != other.rawPattern) return false - - return true - } - - override fun hashCode(): Int { - var result = negate.hashCode() - result = 31 * result + rawPattern.hashCode() - return result - } -} - -fun minimatchAll(path: Path, patterns: List): Boolean { - var match = false - for (pattern in patterns) { - // If we've got a match, only re-test for exclusions. - // if we don't have a match, only re-test for inclusions. - if (match !== pattern.negate) { - continue - } - - match = pattern.matches(path) - } - return match -} \ No newline at end of file +private val LOG = Logger.getInstance("#com.intellij.openapi.util.io.FileUtil") \ No newline at end of file diff --git a/platform/util/src/com/intellij/util/execution/ParametersListUtil.java b/platform/util/src/com/intellij/util/execution/ParametersListUtil.java index 2aea48de96fa..8a234ff00489 100644 --- a/platform/util/src/com/intellij/util/execution/ParametersListUtil.java +++ b/platform/util/src/com/intellij/util/execution/ParametersListUtil.java @@ -183,6 +183,10 @@ public class ParametersListUtil { @NotNull private static String encode(@NotNull final List parameters) { + if (parameters.isEmpty()) { + return ""; + } + final StringBuilder buffer = new StringBuilder(); for (final String parameter : parameters) { if (buffer.length() > 0) {