Lauri Tulmin 2023-02-03 13:49:54 +02:00 committed by GitHub
parent 2277092d82
commit 0bd4af09ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,6 @@ package io.opentelemetry.javaagent.instrumentation.httpurlconnection;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.base.Strings;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -19,9 +18,9 @@ final class StreamUtils {
static List<String> readLines(InputStream stream) throws IOException { static List<String> readLines(InputStream stream) throws IOException {
List<String> lines = new ArrayList<>(); List<String> lines = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, UTF_8)); BufferedReader reader = new BufferedReader(new InputStreamReader(stream, UTF_8));
while (reader.ready()) { String line;
String line = reader.readLine(); while ((line = reader.readLine()) != null) {
if (!Strings.isNullOrEmpty(line)) { if (!line.isEmpty()) {
lines.add(line); lines.add(line);
} }
} }