mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
Add exception to method signature fix made aware of try-with-resources
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Add Exception(s) to Method Signature" "true"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() throws E1 { }
|
||||
}
|
||||
|
||||
void m() throws E1 {
|
||||
try (MyResource r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Add Exception(s) to Method Signature" "true"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
static class E2 extends Exception { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void doSomething() throws E1 { }
|
||||
public void close() throws E2 { }
|
||||
}
|
||||
|
||||
void m() throws E1, E2 {
|
||||
try (MyResource r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add Exception(s) to Method Signature" "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()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Add Exception(s) to Method Signature" "true"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
static class E2 extends Exception { }
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void doSomething() throws E1 { }
|
||||
public void close() throws E2 { }
|
||||
}
|
||||
|
||||
void m() throws E1 {
|
||||
try (<caret>MyResource r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user