lambda: unhandled exceptions inside method body should be treated as those inside anonymous classes (IDEA-121741)

This commit is contained in:
Anna Kozlova
2014-03-06 15:26:01 +01:00
parent a042720e74
commit 1a931f9871
5 changed files with 74 additions and 8 deletions

View File

@@ -0,0 +1,12 @@
// "Add Exception to Method Signature" "true"
class C {
interface I {
void a() throws InterruptedException;
}
{
I i = () -> {
Thread.sleep(2000);
};
}
}

View File

@@ -0,0 +1,9 @@
// "Add Exception to Method Signature" "false"
class C {
public static void main(String[] args) throws InterruptedException {
new Thread(( ) -> {
Thread.sl<caret>eep(2000);
}).start();
}
}

View File

@@ -0,0 +1,12 @@
// "Add Exception to Method Signature" "true"
class C {
interface I {
void a();
}
{
I i = () -> {
Thread.sl<caret>eep(2000);
};
}
}