below 2.2.0.RELEASE i use 2.1.18.RELEASE
YamlPropertySourceLoader
List<PropertySource<?>> propertySources = new ArrayList<>(loaded.size());
for (int i = 0; i < loaded.size(); i++) {
String documentNumber = (loaded.size() != 1) ? " (document #" + i + ")" : "";
propertySources.add(new OriginTrackedMapPropertySource(name + documentNumber, loaded.get(i)));
}
return propertySources;
but on version 2.2.0.RELEASE YamlPropertySourceLoader
List<PropertySource<?>> propertySources = new ArrayList<>(loaded.size());
for (int i = 0; i < loaded.size(); i++) {
String documentNumber = (loaded.size() != 1) ? " (document #" + i + ")" : "";
propertySources.add(new OriginTrackedMapPropertySource(name + documentNumber,
Collections.unmodifiableMap(loaded.get(i)), true));
}
return propertySources;
why make a change unmodifiableMap
propertySources.add(new OriginTrackedMapPropertySource(name + documentNumber, loaded.get(i)));
Collections.unmodifiableMap(loaded.get(i)), true)
between
propertySources.add(new OriginTrackedMapPropertySource(name + documentNumber,
Collections.unmodifiableMap(loaded.get(i)), true));
Comment From: wilkinsona
The change was made in https://github.com/spring-projects/spring-boot/commit/3bfc9235df8fb2a921866c240a05d1dca46ea1b8 as part of https://github.com/spring-projects/spring-boot/pull/16717 which improved the performance of property binding.
Please note that OSS support for Spring Boot 2.2 is no longer available. For OSS support, you should upgrade to 2.5 or 2.6 at your earliest convenience.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.