mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
Generalize catch fix made aware of try-with-resources
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Generalize catch for 'C.E1' to 'C.E'" "true"
|
||||
class C {
|
||||
static class E extends Exception { }
|
||||
static class E1 extends E { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public MyResource() throws E1 { }
|
||||
public void close() throws E { }
|
||||
}
|
||||
|
||||
void f() {
|
||||
try (MyResource r = new MyResource()) {
|
||||
} catch (E e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Generalize catch for 'C.E1' to 'C.E'" "true"
|
||||
class C {
|
||||
static class E extends Exception { }
|
||||
static class E1 extends E { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public MyResource() throws E1 { }
|
||||
public void close() throws E { }
|
||||
}
|
||||
|
||||
void f() {
|
||||
try (<caret>MyResource r = new MyResource()) {
|
||||
} catch (E1 e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user