mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-92588 (check for AutoCloseable on interface extraction)
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
void test() throws Exception {
|
||||
try (MyResource r = new MyResourceImpl()) {
|
||||
r.getName();
|
||||
}
|
||||
}
|
||||
|
||||
interface MyResource extends AutoCloseable {
|
||||
String getName();
|
||||
}
|
||||
|
||||
static class MyResourceImpl implements MyResource {
|
||||
public String getName() { return ""; }
|
||||
public void close() throws Exception { }
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
void test() throws Exception {
|
||||
try (MyResourceImpl r = new MyResourceImpl()) {
|
||||
r.getName();
|
||||
}
|
||||
}
|
||||
|
||||
interface MyResource extends AutoCloseable {
|
||||
String getName();
|
||||
}
|
||||
|
||||
static class MyResourceImpl implements MyResource {
|
||||
public String getName() { return ""; }
|
||||
public void close() throws Exception { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user