mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
Surround with try/catch fix made aware of try-with-resources
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Surround with try/catch" "true"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() throws E1 { }
|
||||
}
|
||||
|
||||
void m() {
|
||||
try {
|
||||
try (MyResource r = new MyResource()) {
|
||||
}
|
||||
} catch (E1 e1) {
|
||||
<selection>e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Surround with try/catch" "true"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() throws E1 { }
|
||||
}
|
||||
|
||||
void m() {
|
||||
try (<caret>MyResource r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user