do lighter checks before calling isChainable that might load AST
authorpeter <peter@jetbrains.com>
Tue, 3 May 2016 20:49:51 +0000 (22:49 +0200)
committerpeter <peter@jetbrains.com>
Tue, 3 May 2016 20:55:40 +0000 (22:55 +0200)
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();