mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
extract method: stop at lambda body during exceptions collecting (IDEA-144938)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import java.io.IOException;
|
||||
class Issue {
|
||||
|
||||
public static void main(String[] args) {
|
||||
<selection>swallow(() -> {
|
||||
throw new IOException();
|
||||
});</selection>
|
||||
}
|
||||
|
||||
private static void swallow(ThrowsUnchecked r) {
|
||||
try {
|
||||
r.doAction();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ThrowsUnchecked {
|
||||
void doAction() throws IOException;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import java.io.IOException;
|
||||
class Issue {
|
||||
|
||||
public static void main(String[] args) {
|
||||
newMethod();
|
||||
}
|
||||
|
||||
private static void newMethod() {
|
||||
swallow(() -> {
|
||||
throw new IOException();
|
||||
});
|
||||
}
|
||||
|
||||
private static void swallow(ThrowsUnchecked r) {
|
||||
try {
|
||||
r.doAction();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ThrowsUnchecked {
|
||||
void doAction() throws IOException;
|
||||
}
|
||||
Reference in New Issue
Block a user