Document properties that were removed without a deprecation period

This commit documents properties that are removed without being
deprecated first. Previously those properties were undocumented.

Closes gh-47762
This commit is contained in:
Stéphane Nicoll
2025-10-22 16:56:44 +02:00
parent d8be5ca7c3
commit 85f330586a
5 changed files with 33 additions and 5 deletions
@@ -40,7 +40,10 @@ record Difference(DifferenceType type, ConfigurationMetadataProperty oldProperty
return null;
}
if (newProperty.isDeprecated() && !oldProperty.isDeprecated()) {
return new Difference(DifferenceType.DEPRECATED, oldProperty, newProperty);
Level level = newProperty.getDeprecation().getLevel();
DifferenceType differenceType = (level == Level.WARNING) ? DifferenceType.DEPRECATED
: DifferenceType.DELETED;
return new Difference(differenceType, oldProperty, newProperty);
}
if (oldProperty.isDeprecated() && oldProperty.getDeprecation().getLevel() == Level.WARNING
&& newProperty.isDeprecated() && newProperty.getDeprecation().getLevel() == Level.ERROR) {
@@ -39,7 +39,7 @@ class ChangelogTests {
assertThat(differences).isNotNull();
assertThat(differences.oldVersionNumber()).isEqualTo("1.0");
assertThat(differences.newVersionNumber()).isEqualTo("2.0");
assertThat(differences.differences()).hasSize(6);
assertThat(differences.differences()).hasSize(7);
List<Difference> added = differences.differences()
.stream()
.filter((difference) -> difference.type() == DifferenceType.ADDED)
@@ -51,7 +51,8 @@ class ChangelogTests {
.stream()
.filter((difference) -> difference.type() == DifferenceType.DELETED)
.toList();
assertThat(deleted).hasSize(3)
assertThat(deleted).hasSize(4)
.anySatisfy((entry) -> assertProperty(entry.oldProperty(), "test.replace", String.class, "replace"))
.anySatisfy((entry) -> assertProperty(entry.oldProperty(), "test.delete", String.class, "delete"))
.anySatisfy(
(entry) -> assertProperty(entry.newProperty(), "test.delete.deprecated", String.class, "delete"))
@@ -6,6 +6,12 @@
"description": "Test equality.",
"defaultValue": "test"
},
{
"name": "test.replace",
"type": "java.lang.String",
"description": "Test Replace.",
"defaultValue": "replace"
},
{
"name": "test.deprecate",
"type": "java.lang.String",
@@ -6,6 +6,14 @@
"description": "Test add.",
"defaultValue": "new"
},
{
"name": "test.replace",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"replacement": "test.add"
}
},
{
"name": "test.add.deprecated",
"type": "java.lang.String",
@@ -28,7 +36,7 @@
"description": "Test deprecate.",
"defaultValue": "wrong",
"deprecation": {
"level": "error"
"level": "warn"
}
},
{
@@ -4,7 +4,13 @@ Configuration property changes between `1.0` and `2.0`
== Deprecated in 2.0
_None_.
|======================
| Key | Replacement | Reason
| `test.deprecate`
|
|
|======================
@@ -40,4 +46,8 @@ _None_.
| `test.removed.directly`
| `test.new.property`
| removed in third-party library without deprecation
| `test.replace`
| `test.add`
|
|======================