mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
handle parentheses in "'null' thrown" inspection
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user