Skip to content

Commit 9661186

Browse files
author
Caitlin Bales (MSFT)
committed
Move scanner string outside of try block
1 parent 66793a4 commit 9661186

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/microsoft/graph/http/DefaultHttpProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,14 @@ public static String streamToString(final InputStream input) {
426426
final String httpStreamEncoding = "UTF-8";
427427
final String endOfFile = "\\A";
428428
final Scanner scanner = new Scanner(input, httpStreamEncoding);
429+
String scannerString = "";
429430
try {
430431
scanner.useDelimiter(endOfFile);
431-
String scannerString = scanner.next();
432-
return scannerString;
432+
scannerString = scanner.next();
433433
} finally {
434434
scanner.close();
435435
}
436+
return scannerString;
436437
}
437438

438439
/**

0 commit comments

Comments
 (0)