boolean (@NotNull PsiForStatement forStatement, PsiVariable variable, @NotNull Set<MethodSignature> checkedMethods, boolean strict) { if (statementAssignsVariableOrFails(forStatement.getInitialization(), variable, checkedMethods, strict)) { return true; } final PsiExpression condition = forStatement.getCondition(); if (expressionAssignsVariableOrFails(condition, variable, checkedMethods, strict)) { return true; } if (BoolUtils.isTrue(condition)) { if (statementAssignsVariableOrFails(forStatement.getBody(), variable, checkedMethods, strict)) { return true; } if (statementAssignsVariableOrFails(forStatement.getUpdate(), variable, checkedMethods, strict)) { return true; } } return false; }