Skip to content

Commit 386d5fb

Browse files
committed
fix java doc for CommandLineArgs
1 parent 309f5be commit 386d5fb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Diff for: spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
* <p>That is, options must be prefixed with "{@code --}" and may or may not
2929
* specify a value. If a value is specified, the name and value must be separated
3030
* <em>without spaces</em> by an equals sign ("="). The value may optionally be
31-
* an empty string.
31+
* an empty string. if the option is present and has multiple values (e. g. "--foo=bar --foo=baz"),
32+
* the values are parsed as a collection.
3233
*
3334
* <h4>Valid examples of option arguments</h4>
3435
* <pre class="code">
@@ -37,14 +38,14 @@
3738
* --foo=""
3839
* --foo=bar
3940
* --foo="bar then baz"
40-
* --foo=bar,baz,biz</pre>
41+
* --foo=bar,baz,biz
42+
* --foo=bar --foo=baz --foo=biz</pre>
4143
*
4244
* <h4>Invalid examples of option arguments</h4>
4345
* <pre class="code">
4446
* -foo
4547
* --foo bar
46-
* --foo = bar
47-
* --foo=bar --foo=baz --foo=biz</pre>
48+
* --foo = bar</pre>
4849
*
4950
* <h3>End of option arguments</h3>
5051
* <p>This parser supports the POSIX "end of options" delimiter, meaning that any

Diff for: spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
* <p>That is, options must be prefixed with "{@code --}" and may or may not
4242
* specify a value. If a value is specified, the name and value must be separated
4343
* <em>without spaces</em> by an equals sign ("="). The value may optionally be
44-
* an empty string.
44+
* an empty string. if the option is present and has multiple values (e. g. "--foo=bar --foo=baz"),
45+
* the values are parsed as a collection.
4546
*
4647
* <h4>Valid examples of option arguments</h4>
4748
* <pre class="code">
@@ -50,14 +51,14 @@
5051
* --foo=""
5152
* --foo=bar
5253
* --foo="bar then baz"
53-
* --foo=bar,baz,biz</pre>
54+
* --foo=bar,baz,biz
55+
* --foo=bar --foo=baz --foo=biz</pre>
5456
*
5557
* <h4>Invalid examples of option arguments</h4>
5658
* <pre class="code">
5759
* -foo
5860
* --foo bar
59-
* --foo = bar
60-
* --foo=bar --foo=baz --foo=biz</pre>
61+
* --foo = bar</pre>
6162
*
6263
* <h3>End of option arguments</h3>
6364
* <p>The underlying parser supports the POSIX "end of options" delimiter, meaning

0 commit comments

Comments
 (0)