diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java index 9c04c6abd4..adfa25074e 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java @@ -142,8 +142,7 @@ class TypeUtils { String javadoc = (element != null ? this.env.getElementUtils().getDocComment(element) : null); if (javadoc != null) { - javadoc = javadoc.replaceAll("\\n", ""); - javadoc = javadoc.trim(); + javadoc = javadoc.replaceAll("[\r\n]+", "").trim(); } return ("".equals(javadoc) ? null : javadoc); } diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index d3eaecf1af..69e5ca0a02 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -204,7 +204,7 @@ public class ConfigurationMetadataAnnotationProcessorTests { assertThat(metadata).has(Metadata .withProperty("description.multi-line", String.class) .fromSource(DescriptionProperties.class).withDescription( - "This is a lengthy description that spans across multiple lines to showcase that the carriage return is cleaned automatically.")); + "This is a lengthy description that spans across multiple lines to showcase that the line separators are cleaned automatically.")); } @Test diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DescriptionProperties.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DescriptionProperties.java index 7077b4070d..e122380f11 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DescriptionProperties.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DescriptionProperties.java @@ -33,7 +33,7 @@ public class DescriptionProperties { /** * This is a lengthy description that spans across multiple lines to showcase that the - * carriage return is cleaned automatically. + * line separators are cleaned automatically. */ private String multiLine;