mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 20:19:06 +00:00
Merge branch '4.0.x'
Closes gh-49061
This commit is contained in:
+3
-2
@@ -272,8 +272,9 @@ class TypeUtils {
|
||||
char lastChar = '.';
|
||||
for (int i = 0; i < javadoc.length(); i++) {
|
||||
char ch = javadoc.charAt(i);
|
||||
boolean repeatedSpace = ch == ' ' && lastChar == ' ';
|
||||
if (ch != '\r' && ch != '\n' && !repeatedSpace) {
|
||||
ch = (ch == '\r' || ch == '\n') ? ' ' : ch;
|
||||
boolean repeatedSpace = (ch == ' ' && lastChar == ' ');
|
||||
if (!repeatedSpace) {
|
||||
result.append(ch);
|
||||
lastChar = ch;
|
||||
}
|
||||
|
||||
+3
@@ -234,6 +234,9 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
|
||||
.fromSource(DescriptionProperties.class)
|
||||
.withDescription(
|
||||
"This is a lengthy description that spans across multiple lines to showcase that the line separators are cleaned automatically."));
|
||||
assertThat(metadata).has(Metadata.withProperty("description.multi-line-whitespace", String.class)
|
||||
.fromSource(DescriptionProperties.class)
|
||||
.withDescription("This is an example of a description with unusual whitespace after a new line."));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+16
@@ -37,6 +37,14 @@ public class DescriptionProperties {
|
||||
*/
|
||||
private String multiLine;
|
||||
|
||||
// @formatter:off
|
||||
/**
|
||||
* This is an example of a description
|
||||
*with unusual whitespace after a new line.
|
||||
*/
|
||||
private String multiLineWhitespace;
|
||||
// @formatter:on
|
||||
|
||||
public String getSimple() {
|
||||
return this.simple;
|
||||
}
|
||||
@@ -53,4 +61,12 @@ public class DescriptionProperties {
|
||||
this.multiLine = multiLine;
|
||||
}
|
||||
|
||||
public String getMultiLineWhitespace() {
|
||||
return this.multiLineWhitespace;
|
||||
}
|
||||
|
||||
public void setMultiLineWhitespace(String multiLineWhitespace) {
|
||||
this.multiLineWhitespace = multiLineWhitespace;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user