Skip to content

Commit 89a6f83

Browse files
committed
Fix and improve SpringApplicationBuilder javadoc
Update SpringApplicationBuilder.properties method javadoc to fix inaccuracies and apply more consistency. Closes gh-22962
1 parent 3e939cb commit 89a6f83

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,12 @@ public SpringApplicationBuilder lazyInitialization(boolean lazyInitialization) {
394394

395395
/**
396396
* Default properties for the environment in the form {@code key=value} or
397-
* {@code key:value}.
397+
* {@code key:value}. Multiple calls to this method are cumulative and will not clear
398+
* any previously set properties.
398399
* @param defaultProperties the properties to set.
399400
* @return the current builder
401+
* @see SpringApplicationBuilder#properties(Properties)
402+
* @see SpringApplicationBuilder#properties(Map)
400403
*/
401404
public SpringApplicationBuilder properties(String... defaultProperties) {
402405
return properties(getMapFromKeyValuePairs(defaultProperties));
@@ -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)