Skip to content

why 2.2.0+ version change YamlPropertySourceLoader & PropertiesPropertySourceLoader #28855

Closed
@winyiwin

Description

@winyiwin

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions