mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
enable unreachable catch-checks for java < 7 (IDEA-86621)
This commit is contained in:
+1
-2
@@ -970,13 +970,12 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
super.visitTryStatement(statement);
|
||||
if (!myHolder.hasErrorResults()) {
|
||||
final Set<PsiClassType> thrownTypes = HighlightUtil.collectUnhandledExceptions(statement);
|
||||
final boolean improvedCheck = PsiUtil.isLanguageLevel7OrHigher(statement);
|
||||
for (PsiParameter parameter : statement.getCatchBlockParameters()) {
|
||||
boolean added = myHolder.addAll(HighlightUtil.checkExceptionAlreadyCaught(parameter));
|
||||
if (!added) {
|
||||
added = myHolder.addAll(HighlightUtil.checkExceptionThrownInTry(parameter, thrownTypes));
|
||||
}
|
||||
if (!added && improvedCheck) {
|
||||
if (!added) {
|
||||
myHolder.addAll(HighlightUtil.checkWithImprovedCatchAnalysis(parameter, thrownTypes));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user