void (PsiStatement currentStatement, PsiElement container, @NotNull PsiElement block) { try { ControlFlow controlFlow = ControlFlowFactory.getControlFlow(block, new LocalsControlFlowPolicy(block), ControlFlowOptions.NO_CONST_EVALUATE); Collection<PsiStatement> statements = ControlFlowUtil .findExitPointsAndStatements(controlFlow, 0, controlFlow.getSize(), new IntArrayList(), ControlFlowUtil.DEFAULT_EXIT_STATEMENTS_CLASSES); for (PsiStatement psiStatement: statements) { if (currentStatement == psiStatement) continue; if (psiStatement instanceof PsiContinueStatement && ((PsiContinueStatement)psiStatement).findContinuedStatement() == container || psiStatement instanceof PsiBreakStatement && ((PsiBreakStatement)psiStatement).findExitedStatement() == container || psiStatement instanceof PsiYieldStatement && ((PsiYieldStatement)psiStatement).findEnclosingExpression() == container) { addOccurrence(psiStatement.getFirstChild()); } } } catch (AnalysisCanceledException ignored) { } }