mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-97977 Constant conditions & exceptions: instance check on Throwable are wrong
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
class Test {
|
||||
Object m1(String[] args) throws Exception {
|
||||
try {
|
||||
return <warning descr="'null' is returned by the method which isn't declared as @Nullable">null</warning>;
|
||||
}
|
||||
catch (Throwable t) {
|
||||
if (t instanceof Error) {
|
||||
System.err.println("1");
|
||||
}
|
||||
if (!(t instanceof RuntimeException)) {
|
||||
System.err.println("2");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void m2(String[] args) throws Exception {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
if (t instanceof Error) {
|
||||
System.err.println("1");
|
||||
}
|
||||
if (!(t instanceof RuntimeException)) {
|
||||
System.err.println("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user