enable unreachable catch-checks for java < 7 (IDEA-86621)

This commit is contained in:
anna
2012-07-10 11:02:52 +02:00
parent dd08a33486
commit 86cc1ee63d
@@ -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));
}
}