mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 11:36:16 +07:00
14 lines
436 B
Java
14 lines
436 B
Java
class TryWithoutFinally {
|
|
static class Resource implements AutoCloseable {
|
|
public void close() throws Exception { }
|
|
boolean find() { throw new UnsupportedOperationException(); }
|
|
}
|
|
|
|
void test() throws Exception {
|
|
boolean found = <warning descr="Variable 'found' initializer 'false' is redundant">false</warning>;
|
|
try (Resource r = new Resource()) {
|
|
found = r.find();
|
|
}
|
|
System.out.println(found);
|
|
}
|
|
} |