|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
|
|
|
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
|
|
|
import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepository;
|
|
|
|
import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepository;
|
|
|
@ -82,9 +81,7 @@ class PropertiesMigrationReporter {
|
|
|
|
private PropertySource<?> mapPropertiesWithReplacement(PropertiesMigrationReport report, String name,
|
|
|
|
private PropertySource<?> mapPropertiesWithReplacement(PropertiesMigrationReport report, String name,
|
|
|
|
List<PropertyMigration> properties) {
|
|
|
|
List<PropertyMigration> properties) {
|
|
|
|
report.add(name, properties);
|
|
|
|
report.add(name, properties);
|
|
|
|
List<PropertyMigration> renamed = properties.stream()
|
|
|
|
List<PropertyMigration> renamed = properties.stream().filter(PropertyMigration::isCompatibleType).toList();
|
|
|
|
.filter(PropertyMigration::isCompatibleType)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (renamed.isEmpty()) {
|
|
|
|
if (renamed.isEmpty()) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -118,10 +115,7 @@ class PropertiesMigrationReporter {
|
|
|
|
private Map<String, List<PropertyMigration>> getMatchingProperties(
|
|
|
|
private Map<String, List<PropertyMigration>> getMatchingProperties(
|
|
|
|
Predicate<ConfigurationMetadataProperty> filter) {
|
|
|
|
Predicate<ConfigurationMetadataProperty> filter) {
|
|
|
|
MultiValueMap<String, PropertyMigration> result = new LinkedMultiValueMap<>();
|
|
|
|
MultiValueMap<String, PropertyMigration> result = new LinkedMultiValueMap<>();
|
|
|
|
List<ConfigurationMetadataProperty> candidates = this.allProperties.values()
|
|
|
|
List<ConfigurationMetadataProperty> candidates = this.allProperties.values().stream().filter(filter).toList();
|
|
|
|
.stream()
|
|
|
|
|
|
|
|
.filter(filter)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
getPropertySourcesAsMap().forEach((propertySourceName, propertySource) -> candidates.forEach((metadata) -> {
|
|
|
|
getPropertySourcesAsMap().forEach((propertySourceName, propertySource) -> candidates.forEach((metadata) -> {
|
|
|
|
ConfigurationPropertyName metadataName = ConfigurationPropertyName.isValid(metadata.getId())
|
|
|
|
ConfigurationPropertyName metadataName = ConfigurationPropertyName.isValid(metadata.getId())
|
|
|
|
? ConfigurationPropertyName.of(metadata.getId())
|
|
|
|
? ConfigurationPropertyName.of(metadata.getId())
|
|
|
|