mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
ForLoopThatDoesntUseLoopVariableInspection#isDeclarationUsedAsBound: fields supported (IDEA-CR-17558)
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user