From fd0a5ec7c8cb9ea16a412000056cf17beaf7a9d4 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 3 May 2016 22:49:51 +0200 Subject: [PATCH] do lighter checks before calling isChainable that might load AST --- .../ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.32.0