mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
surround with auto-closeable: ensure final is restored from existing var
otherwise with generateFinalLocals=true, non-final variables could be made final which leads to red code
This commit is contained in:
+5
-2
@@ -4,9 +4,12 @@ import java.io.IOException;
|
||||
|
||||
class C {
|
||||
void m(File file) throws IOException {
|
||||
String s;
|
||||
try (FileInputStream fileInputStream = new FileInputStream(file)) {
|
||||
String s = "initial value";//Non-NLS
|
||||
String bar = s + fileInputStream.read();
|
||||
//Non-NLS
|
||||
s = "initial value";
|
||||
s = s + fileInputStream.read();
|
||||
}
|
||||
s += "end";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user