Polish
See gh-13148
This commit is contained in:
committed by
Stephane Nicoll
parent
d96724077c
commit
3dd2f5bb05
@@ -17,7 +17,9 @@
|
||||
package org.springframework.boot.configurationmetadata;
|
||||
|
||||
import java.text.BreakIterator;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Utility to extract the first sentence of a text.
|
||||
@@ -45,11 +47,7 @@ class SentenceExtractor {
|
||||
|
||||
private String removeSpaceBetweenLine(String text) {
|
||||
String[] lines = text.split(System.lineSeparator());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String line : lines) {
|
||||
sb.append(line.trim()).append(" ");
|
||||
}
|
||||
return sb.toString().trim();
|
||||
return Arrays.stream(lines).map(String::trim).collect(Collectors.joining(" "));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ZipHeaderPeekInputStreamTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasZipHeaderReturnsFalseWheStreamDoesNotStartWithZipHeader()
|
||||
public void hasZipHeaderReturnsFalseWhenStreamDoesNotStartWithZipHeader()
|
||||
throws IOException {
|
||||
try (ZipHeaderPeekInputStream in = new ZipHeaderPeekInputStream(
|
||||
new ByteArrayInputStream(new byte[] { 0, 1, 2, 3, 4, 5 }))) {
|
||||
|
||||
@@ -496,7 +496,7 @@ public class JarFileTests {
|
||||
.openConnection().getInputStream().close();
|
||||
this.thrown.expect(FileNotFoundException.class);
|
||||
new URL(context, "jar:" + this.rootJarFile.toURI() + "!/no.dat")
|
||||
.openConnection().getInputStream().close();
|
||||
.openConnection().getInputStream();
|
||||
}
|
||||
finally {
|
||||
JarURLConnection.setUseFastExceptions(false);
|
||||
|
||||
Reference in New Issue
Block a user