Skip to content

Commit 1675b47

Browse files
committed
Merge branch '2.2.x' into 2.3.x
Closes gh-22964
2 parents 03d4b89 + 89a6f83 commit 1675b47

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,6 @@ public SpringApplicationBuilder setAddConversionService(boolean addConversionSer
381381
return this;
382382
}
383383

384-
/**
385-
* Default properties for the environment in the form {@code key=value} or
386-
* {@code key:value}.
387-
* @param defaultProperties the properties to set.
388-
* @return the current builder
389-
*/
390-
public SpringApplicationBuilder properties(String... defaultProperties) {
391-
return properties(getMapFromKeyValuePairs(defaultProperties));
392-
}
393-
394384
/**
395385
* Flag to control whether the application should be initialized lazily.
396386
* @param lazyInitialization the flag to set. Defaults to false.
@@ -402,6 +392,19 @@ public SpringApplicationBuilder lazyInitialization(boolean lazyInitialization) {
402392
return this;
403393
}
404394

395+
/**
396+
* Default properties for the environment in the form {@code key=value} or
397+
* {@code key:value}. Multiple calls to this method are cumulative and will not clear
398+
* any previously set properties.
399+
* @param defaultProperties the properties to set.
400+
* @return the current builder
401+
* @see SpringApplicationBuilder#properties(Properties)
402+
* @see SpringApplicationBuilder#properties(Map)
403+
*/
404+
public SpringApplicationBuilder properties(String... defaultProperties) {
405+
return properties(getMapFromKeyValuePairs(defaultProperties));
406+
}
407+
405408
private Map<String, Object> getMapFromKeyValuePairs(String[] properties) {
406409
Map<String, Object> map = new HashMap<>();
407410
for (String property : properties) {
@@ -425,10 +428,12 @@ private int lowestIndexOf(String property, String... candidates) {
425428
}
426429

427430
/**
428-
* Default properties for the environment in the form {@code key=value} or
429-
* {@code key:value}.
431+
* Default properties for the environment.Multiple calls to this method are cumulative
432+
* and will not clear any previously set properties.
430433
* @param defaultProperties the properties to set.
431434
* @return the current builder
435+
* @see SpringApplicationBuilder#properties(String...)
436+
* @see SpringApplicationBuilder#properties(Map)
432437
*/
433438
public SpringApplicationBuilder properties(Properties defaultProperties) {
434439
return properties(getMapFromProperties(defaultProperties));
@@ -444,10 +449,11 @@ private Map<String, Object> getMapFromProperties(Properties properties) {
444449

445450
/**
446451
* Default properties for the environment. Multiple calls to this method are
447-
* cumulative.
452+
* cumulative and will not clear any previously set properties.
448453
* @param defaults the default properties
449454
* @return the current builder
450455
* @see SpringApplicationBuilder#properties(String...)
456+
* @see SpringApplicationBuilder#properties(Properties)
451457
*/
452458
public SpringApplicationBuilder properties(Map<String, Object> defaults) {
453459
this.defaultProperties.putAll(defaults);

0 commit comments

Comments
 (0)