mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
See gh-17691
This commit is contained in:
parent
73efce6306
commit
77a262c542
@ -19,10 +19,10 @@ package org.springframework.boot.context.embedded;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@ -85,13 +85,8 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests
|
||||
if (input == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> lines = new ArrayList<>();
|
||||
try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
lines.add(line);
|
||||
}
|
||||
return lines;
|
||||
return reader.lines().collect(Collectors.toList());
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new RuntimeException("Failed to read lines from input '" + input + "'");
|
||||
|
@ -19,10 +19,10 @@ package org.springframework.boot.context.embedded;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@ -108,13 +108,8 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests
|
||||
if (input == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> lines = new ArrayList<>();
|
||||
try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
lines.add(line);
|
||||
}
|
||||
return lines;
|
||||
return reader.lines().collect(Collectors.toList());
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new RuntimeException("Failed to read lines from input '" + input + "'");
|
||||
|
Loading…
Reference in New Issue
Block a user