From: peter Date: Tue, 3 May 2016 20:49:51 +0000 (+0200) Subject: do lighter checks before calling isChainable that might load AST X-Git-Tag: appcode/146.1675~4 X-Git-Url: https://git.jetbrains.org/?p=idea%2Fcommunity.git;a=commitdiff_plain;h=fd0a5ec7c8cb9ea16a412000056cf17beaf7a9d4 do lighter checks before calling isChainable that might load AST --- diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java index 8fcbd5482d11..b5660e85ca07 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java @@ -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();