Commit 1b10ecbe authored by Madhura Bhave's avatar Madhura Bhave

Merge branch '2.1.x'

parents cee9e0f6 0420ee91
...@@ -19,9 +19,9 @@ package org.springframework.boot.context.embedded; ...@@ -19,9 +19,9 @@ package org.springframework.boot.context.embedded;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.TestTemplate;
...@@ -72,13 +72,8 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests { ...@@ -72,13 +72,8 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests {
if (input == null) { if (input == null) {
return Collections.emptyList(); return Collections.emptyList();
} }
List<String> lines = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new StringReader(input))) { try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
String line; return reader.lines().collect(Collectors.toList());
while ((line = reader.readLine()) != null) {
lines.add(line);
}
return lines;
} }
catch (IOException ex) { catch (IOException ex) {
throw new RuntimeException("Failed to read lines from input '" + input + "'"); throw new RuntimeException("Failed to read lines from input '" + input + "'");
......
...@@ -19,9 +19,9 @@ package org.springframework.boot.context.embedded; ...@@ -19,9 +19,9 @@ package org.springframework.boot.context.embedded;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.TestTemplate;
...@@ -94,13 +94,8 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests { ...@@ -94,13 +94,8 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests {
if (input == null) { if (input == null) {
return Collections.emptyList(); return Collections.emptyList();
} }
List<String> lines = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new StringReader(input))) { try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
String line; return reader.lines().collect(Collectors.toList());
while ((line = reader.readLine()) != null) {
lines.add(line);
}
return lines;
} }
catch (IOException ex) { catch (IOException ex) {
throw new RuntimeException("Failed to read lines from input '" + input + "'"); throw new RuntimeException("Failed to read lines from input '" + input + "'");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment