From 3bc2e8ffec97836d4890300bf654834ccd4ef889 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Mon, 23 Jan 2017 10:16:53 +0700 Subject: [PATCH] ForLoopThatDoesntUseLoopVariableInspection#isDeclarationUsedAsBound: fields supported (IDEA-CR-17558) --- .../ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java index 1c403f20386a..1a1ad5365269 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java @@ -84,7 +84,7 @@ public class ForLoopThatDoesntUseLoopVariableInspection extends BaseInspection { if (otherOperand == null) return false; PsiReferenceExpression ref = tryCast(PsiUtil.skipParenthesizedExprDown(otherOperand), PsiReferenceExpression.class); if (ref == null) return false; - PsiLocalVariable indexVar = tryCast(ref.resolve(), PsiLocalVariable.class); + PsiVariable indexVar = tryCast(ref.resolve(), PsiVariable.class); if (indexVar == null) return false; PsiStatement update = statement.getUpdate(); return VariableAccessUtils.variableIsIncremented(indexVar, update) || VariableAccessUtils.variableIsDecremented(indexVar, update);