AddExceptionToExistingCatch: do not suggest catches if its successors are assignable to exception type: IDEA-208457

This commit is contained in:
Roman.Ivanov
2019-04-02 16:10:45 +07:00
parent 4b33365be7
commit 5c55f93cd1
5 changed files with 24 additions and 44 deletions
@@ -1,10 +1,9 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
import java.io.Exception;
class A extends Exception {}
class B extends A {}
class C extends A {}
class Test {
public static void main(String[] args) {
try {
@@ -1,16 +0,0 @@
// "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) {
}
}
}
@@ -1,14 +1,13 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
import java.io.Exception;
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>();
throw<caret> new A();
} catch (B e) {
} catch (C e) {
}
@@ -1,16 +0,0 @@
// "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) {
}
}
}