mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #13779 from izeye:type-utils-line-separator
* pr/13779: Remove carriage returns in TypeUtils.getJavaDoc()
This commit is contained in:
commit
fec5ecc5b0
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user