You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update `ConfigurationPropertySource` adapters so accessing the
`SystemEnvironmentPropertySource` is handled by directly calling
the source.
This saves potentially expensive calls to `resolvePropertyName`
which are unnecessary since mappings are handled directly.
Closesgh-44862
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ public MapConfigurationPropertySource() {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java
+33-17
Original file line number
Diff line number
Diff line change
@@ -59,17 +59,22 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource {
59
59
60
60
privatefinalPropertySource<?> propertySource;
61
61
62
+
privatefinalbooleansystemEnvironmentSource;
63
+
62
64
privatefinalPropertyMapper[] mappers;
63
65
64
66
/**
65
67
* Create a new {@link SpringConfigurationPropertySource} implementation.
66
68
* @param propertySource the source property source
69
+
* @param systemEnvironmentSource if the source is from the system environment
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java
+61-39
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@
19
19
importjava.util.Arrays;
20
20
importjava.util.Collections;
21
21
importjava.util.ConcurrentModificationException;
22
+
importjava.util.HashMap;
22
23
importjava.util.HashSet;
23
24
importjava.util.Iterator;
24
25
importjava.util.LinkedHashMap;
@@ -27,7 +28,6 @@
27
28
importjava.util.Objects;
28
29
importjava.util.Set;
29
30
importjava.util.function.BiPredicate;
30
-
importjava.util.function.Supplier;
31
31
importjava.util.stream.Stream;
32
32
33
33
importorg.springframework.boot.origin.Origin;
@@ -59,11 +59,13 @@ class SpringIterableConfigurationPropertySource extends SpringConfigurationPrope
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourceTests.java
+8-5
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ class SpringConfigurationPropertySourceTests {
0 commit comments