int (@NotNull PsiAnnotation psiAnnotation, @NotNull String attributeName, int defaultValue) { PsiAnnotationMemberValue attrValue = psiAnnotation.findDeclaredAttributeValue(attributeName); PsiConstantEvaluationHelper evaluationHelper = JavaPsiFacade.getInstance(psiAnnotation.getProject()).getConstantEvaluationHelper(); Object result = evaluationHelper.computeConstantExpression(attrValue); return result instanceof Number ? ((Number) result).intValue() : defaultValue; }