Browse Source

Merge branch '3.4.x' into 3.5.x

Closes gh-47669
pull/47987/head
Andy Wilkinson 2 months ago
parent
commit
41092f36e0
  1. 5
      buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperty.java
  2. 9
      buildSrc/src/main/java/org/springframework/boot/build/context/properties/Snippets.java

5
buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperty.java

@ -97,7 +97,7 @@ class ConfigurationProperty { @@ -97,7 +97,7 @@ class ConfigurationProperty {
Deprecation.fromJsonProperties(deprecation));
}
record Deprecation(String reason, String replacement, String since) {
record Deprecation(String reason, String replacement, String since, String level) {
static Deprecation fromJsonProperties(Map<String, Object> property) {
if (property == null) {
@ -106,7 +106,8 @@ class ConfigurationProperty { @@ -106,7 +106,8 @@ class ConfigurationProperty {
String reason = (String) property.get("reason");
String replacement = (String) property.get("replacement");
String since = (String) property.get("since");
return new Deprecation(reason, replacement, since);
String level = (String) property.get("level");
return new Deprecation(reason, replacement, since, level);
}
}

9
buildSrc/src/main/java/org/springframework/boot/build/context/properties/Snippets.java

@ -30,6 +30,8 @@ import java.util.stream.Collectors; @@ -30,6 +30,8 @@ import java.util.stream.Collectors;
import org.gradle.api.file.FileCollection;
import org.springframework.boot.build.context.properties.ConfigurationProperty.Deprecation;
/**
* Configuration properties snippets.
*
@ -118,7 +120,12 @@ class Snippets { @@ -118,7 +120,12 @@ class Snippets {
}
private boolean shouldAdd(ConfigurationProperty property) {
return (property == null || property.isDeprecated() == this.deprecated);
return (property == null || (property.isDeprecated() == this.deprecated && !deprecatedAtErrorLevel(property)));
}
private boolean deprecatedAtErrorLevel(ConfigurationProperty property) {
Deprecation deprecation = property.getDeprecation();
return deprecation != null && "error".equals(deprecation.level());
}
private Asciidoc getAsciidoc(Snippet snippet, Table table) {

Loading…
Cancel
Save