boolean ( PsiWhileStatement whileStatement, PsiMethod method) { final PsiExpression condition = whileStatement.getCondition(); if (expressionDefinitelyRecurses(condition, method)) { return true; } final Object value = ExpressionUtils.computeConstantExpression(condition); if (value == Boolean.TRUE) { final PsiStatement body = whileStatement.getBody(); return statementDefinitelyRecurses(body, method); } return false; }