boolean (@NotNull PsiIfStatement ifStatement, @Nullable PsiMethod method) { final PsiExpression condition = ifStatement.getCondition(); final Object value = ExpressionUtils.computeConstantExpression(condition); final PsiStatement thenBranch = ifStatement.getThenBranch(); if (value == Boolean.TRUE) { return statementMayCompleteNormally(thenBranch, method); } final PsiStatement elseBranch = ifStatement.getElseBranch(); if (value == Boolean.FALSE) { return statementMayCompleteNormally(elseBranch, method); } // process branch with fewer statements first PsiStatement branch1; PsiStatement branch2; if ((thenBranch == null ? 0 : thenBranch.getTextLength()) < (elseBranch == null ? 0 : elseBranch.getTextLength())) { branch1 = thenBranch; branch2 = elseBranch; } else { branch2 = thenBranch; branch1 = elseBranch; } return statementMayCompleteNormally(branch1, method) || statementMayCompleteNormally(branch2, method); }