diff --git a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java index fcda7c6057..d8d99d2c64 100644 --- a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java +++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import java.util.stream.Collectors; import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepository; -import org.springframework.boot.configurationmetadata.Deprecation; import org.springframework.boot.context.properties.source.ConfigurationProperty; import org.springframework.boot.context.properties.source.ConfigurationPropertyName; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; @@ -62,7 +61,8 @@ class PropertiesMigrationReporter { */ PropertiesMigrationReport getReport() { PropertiesMigrationReport report = new PropertiesMigrationReport(); - Map> properties = getMatchingProperties(deprecatedFilter()); + Map> properties = getMatchingProperties( + ConfigurationMetadataProperty::isDeprecated); if (properties.isEmpty()) { return report; } @@ -129,11 +129,6 @@ class PropertiesMigrationReporter { return null; } - private Predicate deprecatedFilter() { - return (property) -> property.getDeprecation() != null - && property.getDeprecation().getLevel() == Deprecation.Level.ERROR; - } - private Map getPropertySourcesAsMap() { Map map = new LinkedHashMap<>(); for (ConfigurationPropertySource source : ConfigurationPropertySources.get(this.environment)) { diff --git a/spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/type-conversion-metadata.json b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/type-conversion-metadata.json index 3c247d1ebd..2119d57dca 100644 --- a/spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/type-conversion-metadata.json +++ b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/type-conversion-metadata.json @@ -20,8 +20,7 @@ "name": "test.cache-seconds", "type": "java.lang.Integer", "deprecation": { - "replacement": "test.cache", - "level": "error" + "replacement": "test.cache" } }, {