We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5785923 commit a1d3e5bCopy full SHA for a1d3e5b
spring-core/src/main/java/org/springframework/core/env/CommandLineArgs.java
@@ -46,11 +46,9 @@ class CommandLineArgs {
46
* without an associated value — for example, "--foo" vs. "--foo=bar".
47
*/
48
public void addOptionArg(String optionName, @Nullable String optionValue) {
49
- if (!this.optionArgs.containsKey(optionName)) {
50
- this.optionArgs.put(optionName, new ArrayList<>());
51
- }
+ List<String> values = this.optionArgs.computeIfAbsent(optionName, key -> new ArrayList<>());
52
if (optionValue != null) {
53
- this.optionArgs.get(optionName).add(optionValue);
+ values.add(optionValue);
54
}
55
56
0 commit comments