diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java index 4be09608c1f8..435214b1d631 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java +++ b/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 @@ 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) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json index fefdb392d6a7..58e086930ae9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json +++ b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json @@ -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" } ] }