Unused local variable inspection made aware of try-with-resources

This commit is contained in:
Roman Shevchenko
2011-02-25 18:07:31 +01:00
parent 02bd2733a5
commit b2ec3c9263
5 changed files with 190 additions and 34 deletions

View File

@@ -18,12 +18,6 @@ class C {
}
void m2() throws Exception {
// todo: test in IG
//MyResource < warning descr="Local variable 'r1' is redundant">r1</warning> = null;
//try (MyResource r = r1) {
// System.out.println(r);
//}
try (MyResource <warning descr="Variable 'r2' is never used">r2</warning> = new MyResource()) { }
MyResource <warning descr="Variable 'r3' is never assigned">r3</warning>;