Postfix completion: apply throw template on Throwable only

This commit is contained in:
Alexander Zolotov
2014-02-20 16:07:52 +04:00
parent 79e95dc617
commit e896024c69
6 changed files with 26 additions and 5 deletions
@@ -0,0 +1,5 @@
public class Foo {
void m(Object o) {
o.throw<caret>
}
}
@@ -0,0 +1,5 @@
public class Foo {
void m(Object o) {
throw o;<caret>
}
}
@@ -1,5 +1,7 @@
import java.lang.RuntimeException;
public class Foo {
void m(Object o) {
o.throw<caret>
void m() {
new RuntimeException("error").throw<caret>
}
}
@@ -1,5 +1,7 @@
import java.lang.RuntimeException;
public class Foo {
void m(Object o) {
throw o;<caret>
void m() {
throw new RuntimeException("error");
}
}