diff --git a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java index 7f35d1b3c50..98b80011f5f 100644 --- a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java +++ b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java @@ -28,7 +28,8 @@ package org.springframework.core.env; *
That is, options must be prefixed with "{@code --}" and may or may not * specify a value. If a value is specified, the name and value must be separated * without spaces by an equals sign ("="). The value may optionally be - * an empty string. + * an empty string. if the option is present and has multiple values (e. g. "--foo=bar --foo=baz"), +* the values are parsed as a collection. * *
@@ -37,14 +38,14 @@ package org.springframework.core.env; * --foo="" * --foo=bar * --foo="bar then baz" - * --foo=bar,baz,biz+ * --foo=bar,baz,biz + * --foo=bar --foo=baz --foo=biz * *
* -foo * --foo bar - * --foo = bar - * --foo=bar --foo=baz --foo=biz+ * --foo = bar * *
This parser supports the POSIX "end of options" delimiter, meaning that any diff --git a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java index 767d9b6211f..17121c29734 100644 --- a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java @@ -40,7 +40,8 @@ import org.springframework.util.StringUtils; *
That is, options must be prefixed with "{@code --}" and may or may not * specify a value. If a value is specified, the name and value must be separated * without spaces by an equals sign ("="). The value may optionally be - * an empty string. + * an empty string. if the option is present and has multiple values (e. g. "--foo=bar --foo=baz"), + * the values are parsed as a collection. * *
@@ -49,14 +50,14 @@ import org.springframework.util.StringUtils; * --foo="" * --foo=bar * --foo="bar then baz" - * --foo=bar,baz,biz+ * --foo=bar,baz,biz + * --foo=bar --foo=baz --foo=biz * *
* -foo * --foo bar - * --foo = bar - * --foo=bar --foo=baz --foo=biz+ * --foo = bar * *
The underlying parser supports the POSIX "end of options" delimiter, meaning