Skip to content

Commit cc2dc55

Browse files
committed
Don't report already migrated properties when has group
Refine the fix adding commit 9629363 so that items with a group are correctly checked. Fixes gh-42068
1 parent 1085505 commit cc2dc55

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private void addMigration(ConfigurationPropertySource propertySource,
146146

147147
private boolean hasSameName(ConfigurationProperty property, ConfigurationMetadataProperty replacement) {
148148
return (property.getOrigin() instanceof PropertySourceOrigin propertySourceOrigin)
149-
&& Objects.equals(propertySourceOrigin.getPropertyName(), replacement.getName());
149+
&& Objects.equals(propertySourceOrigin.getPropertyName(), replacement.getId());
150150
}
151151

152152
private ConfigurationMetadataProperty determineReplacementMetadata(ConfigurationMetadataProperty metadata) {

Diff for: spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"groups": [
3+
{
4+
"name": "relaxed",
5+
"type": "com.example.SourceType"
6+
}
7+
],
28
"properties": [
39
{
410
"name": "test.two",
@@ -64,7 +70,8 @@
6470
},
6571
{
6672
"name": "relaxed.this-that-the-other",
67-
"type": "java.lang.String"
73+
"type": "java.lang.String",
74+
"sourceType": "com.example.SourceType"
6875
}
6976
]
7077
}

0 commit comments

Comments
 (0)