extract method: stop at lambda body during exceptions collecting (IDEA-144938)

This commit is contained in:
Anna Kozlova
2015-09-09 19:24:30 +03:00
parent 43890f1144
commit db53e6d20b
4 changed files with 51 additions and 0 deletions
@@ -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;
}
@@ -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;
}