forked from gCubeSystem/gx-rest
Closed scanner
This commit is contained in:
parent
3a6e2fc2ef
commit
b84ac8b29b
|
@ -115,7 +115,8 @@ public class SerializableErrorEntityTextReader implements MessageBodyReader<Seri
|
|||
* @return the string read from the stream
|
||||
*/
|
||||
private static String convertStreamToString(InputStream is) {
|
||||
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
|
||||
return s.hasNext() ? s.next() : "";
|
||||
try (java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A")) {
|
||||
return s.hasNext() ? s.next() : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue