boolean (PsiElement element) { PsiElement parent = element.getParent(); while (parent instanceof PsiIfStatement ifStatement) { final PsiStatement elseBranch = ifStatement.getElseBranch(); if (elseBranch != element) { return true; } final PsiStatement thenBranch = ifStatement.getThenBranch(); if (ControlFlowUtils.statementMayCompleteNormally(thenBranch)) { return true; } element = parent; parent = element.getParent(); } return !(parent instanceof PsiCodeBlock); }