Skip to content

Commit 2f1f964

Browse files
committed
Merge branch '3.4.x' into 3.5.x
Closes gh-48130
2 parents c90f61c + afa2af1 commit 2f1f964

File tree

1 file changed

+2
-6
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features

1 file changed

+2
-6
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,8 @@ NOTE: The properties that map to javadoc:org.springframework.boot.context.proper
795795
Such arrangement relies on a default empty constructor and getters and setters are usually mandatory, since binding is through standard Java Beans property descriptors, just like in Spring MVC.
796796
A setter may be omitted in the following cases:
797797
798-
* Maps, as long as they are initialized, need a getter but not necessarily a setter, since they can be mutated by the binder.
799-
* Collections and arrays can be accessed either through an index (typically with YAML) or by using a single comma-separated value (properties).
800-
In the latter case, a setter is mandatory.
801-
We recommend to always add a setter for such types.
802-
If you initialize a collection, make sure it is not immutable (as in the preceding example).
803-
* If nested POJO properties are initialized (like the `Security` field in the preceding example), a setter is not required.
798+
* Pre-initialized Maps and Collections, as long as they are initialized with a mutable implementation (like the `roles` field in the preceding example).
799+
* Pre-initialized nested POJOs (like the `Security` field in the preceding example).
804800
If you want the binder to create the instance on the fly by using its default constructor, you need a setter.
805801
806802
Some people use Project Lombok to add getters and setters automatically.

0 commit comments

Comments
 (0)