Polish "Fix changelog generator missing directly removed properties"
See gh-45267
This commit is contained in:
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepository;
|
||||
import org.springframework.boot.configurationmetadata.Deprecation;
|
||||
import org.springframework.boot.configurationmetadata.Deprecation.Level;
|
||||
|
||||
/**
|
||||
* A changelog containing differences computed from two repositories of configuration
|
||||
@@ -50,19 +50,14 @@ record Changelog(String oldVersionNumber, String newVersionNumber, List<Differen
|
||||
String id = oldProperty.getId();
|
||||
seenIds.add(id);
|
||||
ConfigurationMetadataProperty newProperty = newMetadata.getAllProperties().get(id);
|
||||
if (newProperty == null) {
|
||||
differences.add(new Difference(DifferenceType.DELETED, oldProperty, null));
|
||||
}
|
||||
else {
|
||||
Difference difference = Difference.compute(oldProperty, newProperty);
|
||||
if (difference != null) {
|
||||
differences.add(difference);
|
||||
}
|
||||
Difference difference = Difference.compute(oldProperty, newProperty);
|
||||
if (difference != null) {
|
||||
differences.add(difference);
|
||||
}
|
||||
}
|
||||
for (ConfigurationMetadataProperty newProperty : newMetadata.getAllProperties().values()) {
|
||||
if (!seenIds.contains(newProperty.getId())) {
|
||||
if (newProperty.isDeprecated() && newProperty.getDeprecation().getLevel() == Deprecation.Level.ERROR) {
|
||||
if (newProperty.isDeprecated() && newProperty.getDeprecation().getLevel() == Level.ERROR) {
|
||||
differences.add(new Difference(DifferenceType.DELETED, null, newProperty));
|
||||
}
|
||||
else if (!newProperty.isDeprecated()) {
|
||||
|
||||
@@ -26,6 +26,15 @@
|
||||
"deprecation": {
|
||||
"level": "warning"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test.delete.error",
|
||||
"type": "java.lang.String",
|
||||
"description": "Test delete error.",
|
||||
"defaultValue": "delete",
|
||||
"deprecation": {
|
||||
"level": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
"deprecation": {
|
||||
"level": "error",
|
||||
"replacement": "test.new.property",
|
||||
"reason": "Removed in Upgrade 10"
|
||||
"reason": "removed in third-party library without deprecation"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -35,5 +35,5 @@ _None_.
|
||||
|
||||
| `test.removed.directly`
|
||||
| `test.new.property`
|
||||
| Removed in Upgrade 10
|
||||
| removed in third-party library without deprecation
|
||||
|======================
|
||||
|
||||
Reference in New Issue
Block a user