mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-13 20:36:34 +07:00
25 lines
514 B
Java
25 lines
514 B
Java
public class CheckedExceptionDominance {
|
|
private static class CheckedException extends Exception {}
|
|
|
|
public static void foo() {
|
|
boolean flag = true;
|
|
|
|
try {
|
|
bar();
|
|
}
|
|
catch (CheckedException e) {
|
|
flag = false;
|
|
}
|
|
catch (Exception e) {
|
|
}
|
|
|
|
if (flag) { // This should not be highlighted as always true;
|
|
System.out.println("Must not happen");
|
|
}
|
|
}
|
|
|
|
public static void bar() throws CheckedException {
|
|
throw new CheckedException();
|
|
}
|
|
}
|