IDEA-92588 (check for AutoCloseable on interface extraction)

This commit is contained in:
Roman Shevchenko
2012-10-10 10:35:51 +02:00
parent 37941c490f
commit 0dc1191c25
10 changed files with 155 additions and 8 deletions
@@ -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 { }
}
}
@@ -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 { }
}
}