try(InputStream in = url.openStream(); Scanner scanner = new Scanner(in).useDelimiter("\\A")) {
} catch(IOException e) {
e.printStackTrace();
}
Line
new scanner (in)
gives a warning:
Resource leak: <unassigned Closeable> value' is never closed
It is deleted if I delete useDelimiter(String).
useDelimiter(String)doesn't return a new instance (it returns this), so why am I getting this warning? This is mistake?
I am using Eclipse 4.4. My question does not apply to this , where the warning is due to a different situation.
source
share