mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
AddExceptionToExistingCatch: do not suggest catches if its successors are assignable to exception type: IDEA-208457
This commit is contained in:
+1
-2
@@ -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 {
|
||||
-16
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -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) {
|
||||
}
|
||||
-16
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user