Create intention to add uncaught exception to existing catch clause

This commit is contained in:
Roman.Ivanov
2018-03-29 11:24:55 +07:00
parent 82b397ec96
commit 5aa1899843
11 changed files with 228 additions and 0 deletions
@@ -0,0 +1,16 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class A extends Exception {}
class B extends A {}
class C extends A {}
class Test {
public static void main(String[] args) {
try {
throw new A();
} catch (A e) {
} catch (C e) {
}
}
}
@@ -0,0 +1,11 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class Test {
public static void main(String[] args) {
try {
throw new IOException();
} catch (IndexOutOfBoundsException | IOException e) {
}
}
}
@@ -0,0 +1,16 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class A extends Exception {}
class B extends A {}
class C extends A {}
class Test {
public static void main(String[] args) {
try {
throw new A<caret>();
} catch (B e) {
} catch (C e) {
}
}
}
@@ -0,0 +1,11 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class Test {
public static void main(String[] args) {
try {
throw new IOException<caret>();
} catch (IndexOutOfBoundsException e) {
}
}
}