https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java#L103
When I use EnvironmentChangeEvent
to refresh the map configuration, only additions and modifications succeed, while deletions and modifications to keys do not apply to my configuration.
I noticed that CollectionBinder
uses #clear
before putAll
, and I believe this can prevent the above error. Why doesn’t MapBinder
use clear
before putAll
?
I know @RefreshScope can solve the problem of map deletion, but I want to know if there is a bug here? Or is it to comply with some rule?