int (@NotNull PsiExpression expression) { Object constantExpression = ExpressionUtils.computeConstantExpression(expression); if (!(constantExpression instanceof Integer)) return -1; return (int)constantExpression; }