void (@NotNull PsiForStatement loop) { PsiExpression condition = loop.getCondition(); if (condition != null && SideEffectChecker.mayHaveSideEffects(condition)) return; PsiStatement body = loop.getBody(); if (body == null) return; PsiStatement update = loop.getUpdate(); if (SideEffectChecker.mayHaveNonLocalSideEffects(body) || update != null && SideEffectChecker.mayHaveNonLocalSideEffects(update)) return; ControlFlow controlFlow; try { controlFlow = ControlFlowFactory.getInstance(loop.getProject()).getControlFlow(loop, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance()); } catch (AnalysisCanceledException ignored) { return; } int start = controlFlow.getStartOffset(body); int end = controlFlow.getEndOffset(update == null ? body : update); if(start == -1 || end == -1) return; controlFlow = new ControlFlowSubRange(controlFlow, start, end); checkControlFlow(loop, controlFlow, holder); }