Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why 2.2.0+ version change YamlPropertySourceLoader & PropertiesPropertySourceLoader #28855

Closed
winyiwin opened this issue Nov 30, 2021 · 1 comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid

Comments

@winyiwin
Copy link

winyiwin commented Nov 30, 2021

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));
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 30, 2021
@wilkinsona
Copy link
Member

The change was made in 3bfc923 as part of #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.

@wilkinsona wilkinsona added for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants