PsiExpression (@Nullable PsiIfStatement ifStatement, @NotNull PsiLoopStatement loopStatement, Ref<? super @NotNull Boolean> isBreakInThen) { if (ifStatement == null) return null; if (ControlFlowUtils.statementBreaksLoop(ControlFlowUtils.stripBraces(ifStatement.getThenBranch()), loopStatement)) { if (hasVariableNameConflict(loopStatement, ifStatement, ifStatement.getElseBranch())) return null; isBreakInThen.set(true); return ifStatement.getCondition(); } if (ifStatement.getElseBranch() != null && ControlFlowUtils.statementBreaksLoop(ControlFlowUtils.stripBraces(ifStatement.getElseBranch()), loopStatement)) { if (hasVariableNameConflict(loopStatement, ifStatement, ifStatement.getThenBranch())) return null; isBreakInThen.set(false); return ifStatement.getCondition(); } return null; }