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
This commit is contained in:
Phillip Webb 2024-08-31 11:18:47 -07:00
parent 10855056cc
commit cc2dc558f1
2 changed files with 9 additions and 2 deletions

View File

@ -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) {

View File

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