void (@NotNull PsiAnnotation annotation) { if (!JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT.equals(annotation.getQualifiedName())) return; PsiMethod method = PsiTreeUtil.getParentOfType(annotation, PsiMethod.class); if (method == null) return; String text = AnnotationUtil.getStringAttributeValue(annotation, null); if (StringUtil.isNotEmpty(text)) { ParseException error = checkContract(method, text); if (error != null) { PsiAnnotationMemberValue value = annotation.findAttributeValue(null); assert value != null; TextRange actualRange = null; if (value instanceof PsiExpression && error.getRange() != null) { actualRange = ExpressionUtils .findStringLiteralRange((PsiExpression)value, error.getRange().getStartOffset(), error.getRange().getEndOffset()); } holder.registerProblem(value, actualRange, error.getMessage()); } } checkMutationContract(annotation, method); }