Skip to content

Commit

Permalink
Don't report already migrated properties when has group
Browse files Browse the repository at this point in the history
Refine the fix adding commit 9629363 so that items with a group
are correctly checked.

Fixes gh-42068
  • Loading branch information
philwebb committed Aug 31, 2024
1 parent 1085505 commit cc2dc55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void addMigration(ConfigurationPropertySource propertySource,

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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"groups": [
{
"name": "relaxed",
"type": "com.example.SourceType"
}
],
"properties": [
{
"name": "test.two",
Expand Down Expand Up @@ -64,7 +70,8 @@
},
{
"name": "relaxed.this-that-the-other",
"type": "java.lang.String"
"type": "java.lang.String",
"sourceType": "com.example.SourceType"
}
]
}

0 comments on commit cc2dc55

Please sign in to comment.