New (unexpected) warning with Juno 4.2 RC2 [message #877355] |
Sat, 26 May 2012 10:37  |
Eclipse User |
|
|
|
Hello,
I have a Java 7 code, that compiles without any warnings with Eclipse Indigo 3.7.2.
When trying to move to Eclipse Juno 4.2RC2, I get a warning that I don't understand.
Here my code sample:
try (InputStreamReader socketIn = new InputStreamReader(fSocket.getInputStream())) {
while (isConnected()) {
int k = socketIn.read(charData);
...
}
} catch (IOException e) {
...
}
The warning is "Resource leak: socketIn is never closed"
(my understanding was that Java 7 will ensure that the resource will be closed outside the try / catch block.)
Installed JRE: Java 1.7_u4 (from Oracle, on a Win 7 PC).
Any idea ?
Thanks,
Bernard.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03101 seconds