try(InputStream in = url.openStream(); Scanner scanner = new Scanner(in).useDelimiter("\\A")) {
} catch(IOException e) {
e.printStackTrace();
}
The line
new Scanner(in)
gives the warning:
Resource leak: <unassigned Closeable> value' is never closed
It goes away if I remove useDelimiter(String)
.
useDelimiter(String)
does not return a new instance (it returns this
), so why am I getting this warning? Is it a bug?
I am using Eclipse 4.4. My question is not relevant to this, where a warning occurs due to a different situation