mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+11
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007-2009 Bas Leijdekkers
|
||||
* Copyright 2007-2010 Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -78,12 +78,14 @@ public class ThrowableInstanceNeverThrownInspection extends BaseInspection {
|
||||
return;
|
||||
}
|
||||
final PsiElement parent = getParent(expression.getParent());
|
||||
if (parent instanceof PsiThrowStatement) {
|
||||
if (parent instanceof PsiThrowStatement ||
|
||||
parent instanceof PsiReturnStatement) {
|
||||
return;
|
||||
} else if (parent instanceof PsiReturnStatement) {
|
||||
}
|
||||
if (PsiTreeUtil.getParentOfType(parent, PsiCallExpression.class) !=
|
||||
null) {
|
||||
return;
|
||||
}
|
||||
if (PsiTreeUtil.getParentOfType(parent, PsiCallExpression.class) != null) return;
|
||||
final PsiElement typedParent =
|
||||
PsiTreeUtil.getParentOfType(expression,
|
||||
PsiAssignmentExpression.class,
|
||||
@@ -125,12 +127,14 @@ public class ThrowableInstanceNeverThrownInspection extends BaseInspection {
|
||||
while (usageParent instanceof PsiParenthesizedExpression) {
|
||||
usageParent = usageParent.getParent();
|
||||
}
|
||||
if (usageParent instanceof PsiThrowStatement) {
|
||||
if (usageParent instanceof PsiThrowStatement ||
|
||||
usageParent instanceof PsiReturnStatement) {
|
||||
return;
|
||||
} else if (usageParent instanceof PsiReturnStatement) {
|
||||
}
|
||||
if (PsiTreeUtil.getParentOfType(usageParent,
|
||||
PsiCallExpression.class) != null) {
|
||||
return;
|
||||
}
|
||||
if (PsiTreeUtil.getParentOfType(usageParent, PsiCallExpression.class) != null) return;
|
||||
}
|
||||
}
|
||||
registerError(expression, expression);
|
||||
|
||||
-1
@@ -22,7 +22,6 @@ import com.siyeh.ig.BaseInspection;
|
||||
import com.siyeh.ig.BaseInspectionVisitor;
|
||||
import com.siyeh.ig.psiutils.ClassUtils;
|
||||
import com.siyeh.ig.psiutils.ExceptionUtils;
|
||||
import com.siyeh.ig.psiutils.TypeUtils;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user