diff --git a/java-cloud-bom/release-note-generation/pom.xml b/java-cloud-bom/release-note-generation/pom.xml index caa089e3a351..6cc525ea6fc9 100644 --- a/java-cloud-bom/release-note-generation/pom.xml +++ b/java-cloud-bom/release-note-generation/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 11 - 11 + 1.8 + 1.8 true diff --git a/java-cloud-bom/release-note-generation/src/main/java/com/google/cloud/ReleaseNoteGeneration.java b/java-cloud-bom/release-note-generation/src/main/java/com/google/cloud/ReleaseNoteGeneration.java index 483df61ba1ed..c71e1b61cc3b 100644 --- a/java-cloud-bom/release-note-generation/src/main/java/com/google/cloud/ReleaseNoteGeneration.java +++ b/java-cloud-bom/release-note-generation/src/main/java/com/google/cloud/ReleaseNoteGeneration.java @@ -34,9 +34,12 @@ import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; import com.google.common.collect.Streams; +import com.google.common.io.CharStreams; import com.google.common.io.Files; import java.io.File; import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -617,8 +620,8 @@ static String fetchReleaseNote(String owner, String repository, String tag) builder.redirectErrorStream(true); Process process = builder.start(); String output = - new String( - process.getInputStream().readAllBytes(), java.nio.charset.StandardCharsets.UTF_8); + CharStreams.toString( + new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8)); boolean finished = process.waitFor(1, TimeUnit.MINUTES); Verify.verify(finished, "The process timed out"); Verify.verify(0 == process.exitValue(), "The command failed: %s", output);