Object (@Nullable PsiExpression expression, @Nullable PsiType castTo) { if (expression == null) return null; Object value = JavaPsiFacade.getInstance(expression.getProject()).getConstantEvaluationHelper().computeConstantExpression(expression, false); if(value == null) return null; return computeCastTo(value, castTo); }