surround with try-catch: expand expression lambda to perform operation (IDEA-134500)

This commit is contained in:
Anna Kozlova
2015-03-26 12:07:12 +01:00
parent 282d32939e
commit 2e736c18fe
6 changed files with 70 additions and 25 deletions
@@ -0,0 +1,26 @@
// "Surround with try/catch" "true"
public class ExTest {
public static void maybeThrow(String data) throws Ex {
throw new Ex(data);
}
{
Block<String> b = (t) -> {
try {
ExTest.maybeThrow(t);
} catch (Ex ex) {
ex.printStackTrace();
}
};
}
private static class Ex extends Throwable {
public Ex(String s) {
}
}
}
interface Block<T> {
public void accept(T t);
}
@@ -1,4 +1,4 @@
// "Surround with try/catch" "false"
// "Surround with try/catch" "true"
public class ExTest {
public static void maybeThrow(String data) throws Ex {
throw new Ex(data);