Browse Source

Don't report already migrated properties when has group

Refine the fix adding commit 962936370a so that items with a group
are correctly checked.

Fixes gh-42068
pull/42868/head
Phillip Webb 2 years ago
parent
commit
cc2dc558f1
  1. 2
      spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java
  2. 9
      spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json

2
spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java

@ -146,7 +146,7 @@ class PropertiesMigrationReporter { @@ -146,7 +146,7 @@ class PropertiesMigrationReporter {
private boolean hasSameName(ConfigurationProperty property, ConfigurationMetadataProperty replacement) {
return (property.getOrigin() instanceof PropertySourceOrigin propertySourceOrigin)
&& Objects.equals(propertySourceOrigin.getPropertyName(), replacement.getName());
&& Objects.equals(propertySourceOrigin.getPropertyName(), replacement.getId());
}
private ConfigurationMetadataProperty determineReplacementMetadata(ConfigurationMetadataProperty metadata) {

9
spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
{
"groups": [
{
"name": "relaxed",
"type": "com.example.SourceType"
}
],
"properties": [
{
"name": "test.two",
@ -64,7 +70,8 @@ @@ -64,7 +70,8 @@
},
{
"name": "relaxed.this-that-the-other",
"type": "java.lang.String"
"type": "java.lang.String",
"sourceType": "com.example.SourceType"
}
]
}

Loading…
Cancel
Save