handle parentheses in "'null' thrown" inspection

This commit is contained in:
Bas Leijdekkers
2011-06-17 14:16:45 +02:00
parent 8158a29e14
commit d8d88e543e
@@ -23,6 +23,7 @@ import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.psiutils.ParenthesesUtils;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
@@ -78,7 +79,8 @@ public class NullThrownInspection extends BaseInspection {
@Override
public void visitThrowStatement(PsiThrowStatement statement) {
super.visitThrowStatement(statement);
final PsiExpression exception = statement.getException();
final PsiExpression exception =
ParenthesesUtils.stripParentheses(statement.getException());
if (!(exception instanceof PsiLiteralExpression)) {
return;
}