surround with closeable: don't include unrelated variables (IDEA-159434)

This commit is contained in:
Anna.Kozlova
2017-12-20 18:39:09 +01:00
parent ff6c68ec82
commit d9e6f8d96e
4 changed files with 36 additions and 1 deletions
@@ -0,0 +1,17 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
class C {
void m(File file) throws IOException {
String s;
try (FileInputStream fileInputStream = new FileInputStream(file)) {
//Non-NLS
s = "initial value";
s = s + fileInputStream.read();
}
s += "end";
int time = 0;
System.out.println(time);
}
}