Skip to content

Commit

Permalink
Close Scanner in RawResponseDeserializer (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
kare authored Jan 6, 2021
1 parent 88c5616 commit 98a7187
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ private String getRawResponse(JsonParser jp) throws IOException {
}

private String streamToString(InputStream input) throws IOException {
return new Scanner(input, StandardCharsets.UTF_8.name()).useDelimiter("\\Z").next();
try (Scanner scanner =
new Scanner(input, StandardCharsets.UTF_8.name()).useDelimiter("\\Z")) {
return scanner.next();
}
}
}

0 comments on commit 98a7187

Please sign in to comment.