Move try-with-resources data flow test to right place

This commit is contained in:
Roman Shevchenko
2012-10-10 13:03:57 +02:00
parent 4dd466fde6
commit b13e8b0d7a
5 changed files with 32 additions and 19 deletions
@@ -23,21 +23,4 @@ class C {
System.out.println(r);
}
}
interface MyResourceProvider {
MyResource getResource();
}
void m3() throws Exception {
MyResourceProvider provider = null;
try (MyResource r = <warning descr="Method invocation 'provider.getResource()' may produce 'java.lang.NullPointerException'">provider.getResource()</warning>) {
System.out.println(r);
}
}
void m4() {
try (MyResource r = null) {
System.out.println(r);
}
}
}