Hi, I found that PropertySourcesPropertyResolver (a resolver that does not support short-circuiting) is used in these places:
LoggingSystemProperties
https://github.com/spring-projects/spring-boot/blob/08ce0919cd7895a9551018c072985d014b8cd295/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java#L165
- When the key is not a property name, such as when it is a SpEL expression:
https://github.com/spring-projects/spring-boot/blob/5817c8441d4a24ca0ad6efe70bec64d22875b652/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorProperties.java#L35
In this case ConfigurationPropertyName.of(key, true) will return null, and then defaultResolver (inherited from PropertySourcesPropertyResolver) will be used for resolution.
https://github.com/spring-projects/spring-boot/blob/5817c8441d4a24ca0ad6efe70bec64d22875b652/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertyResolver.java#L87-L97
However the entire process property value will only be retrieved once, the current implementation is fine and we don't need to make any changes.
https://github.com/spring-projects/spring-boot/blob/5817c8441d4a24ca0ad6efe70bec64d22875b652/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.java#L66-L68
- As @philwebb commented, Boot auto-configures
PropertySourcesPlaceholderConfigurer, may need to wait spring-projects/spring-framework#30304 to fix
https://github.com/spring-projects/spring-boot/blob/5817c8441d4a24ca0ad6efe70bec64d22875b652/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/PropertyPlaceholderAutoConfiguration.java#L43
Closes gh-28687