diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java index 247b7e0c64..f0b3adf195 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java @@ -115,9 +115,7 @@ class SpringIterableConfigurationPropertySource extends SpringConfigurationPrope String[] names = getPropertySource().getPropertyNames(); List mappings = new ArrayList<>(names.length * 2); for (String name : names) { - for (PropertyMapping mapping : getMapper().map(name)) { - mappings.add(mapping); - } + Collections.addAll(mappings, getMapper().map(name)); } result = mappings.toArray(new PropertyMapping[0]); if (cache != null) {