do lighter checks before calling isChainable that might load AST
[idea/community.git] / plugins / InspectionGadgets / InspectionGadgetsAnalysis / src / com / siyeh / ig / bugs / ThrowableResultOfMethodCallIgnoredInspection.java
index 8fcbd5482d116d90641df74442b7177b982bb576..b5660e85ca07c9cab43d7226207dbdad154d1874 100644 (file)
@@ -63,10 +63,10 @@ public class ThrowableResultOfMethodCallIgnoredInspection extends BaseInspection
       while (parent instanceof PsiParenthesizedExpression || parent instanceof PsiTypeCastExpression) {
         parent = parent.getParent();
       }
-      if (canBeThrown(parent)) {
+      if (!TypeUtils.expressionHasTypeOrSubtype(expression, CommonClassNames.JAVA_LANG_THROWABLE)) {
         return;
       }
-      if (!TypeUtils.expressionHasTypeOrSubtype(expression, CommonClassNames.JAVA_LANG_THROWABLE)) {
+      if (canBeThrown(parent)) {
         return;
       }
       final PsiMethod method = expression.resolveMethod();