Skip to content

Commit fec5ecc

Browse files
committed
Merge pull request #13779 from izeye:type-utils-line-separator
* pr/13779: Remove carriage returns in TypeUtils.getJavaDoc()
2 parents e556c04 + 9fba2c4 commit fec5ecc

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ public String getJavaDoc(Element element) {
142142
String javadoc = (element != null
143143
? this.env.getElementUtils().getDocComment(element) : null);
144144
if (javadoc != null) {
145-
javadoc = javadoc.replaceAll("\\n", "");
146-
javadoc = javadoc.trim();
145+
javadoc = javadoc.replaceAll("[\r\n]+", "").trim();
147146
}
148147
return ("".equals(javadoc) ? null : javadoc);
149148
}

spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void descriptionProperties() {
204204
assertThat(metadata).has(Metadata
205205
.withProperty("description.multi-line", String.class)
206206
.fromSource(DescriptionProperties.class).withDescription(
207-
"This is a lengthy description that spans across multiple lines to showcase that the carriage return is cleaned automatically."));
207+
"This is a lengthy description that spans across multiple lines to showcase that the line separators are cleaned automatically."));
208208
}
209209

210210
@Test

spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DescriptionProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class DescriptionProperties {
3333

3434
/**
3535
* This is a lengthy description that spans across multiple lines to showcase that the
36-
* carriage return is cleaned automatically.
36+
* line separators are cleaned automatically.
3737
*/
3838
private String multiLine;
3939

0 commit comments

Comments
 (0)