void (@NotNull GrAnnotation annotation, @Nullable PsiAnnotationOwner owner, @NotNull AnnotationHolder holder, @NotNull PsiElement toHighlight) { final GrCodeReferenceElement ref = annotation.getClassReference(); final PsiElement resolved = ref.resolve(); if (resolved == null) return; assert resolved instanceof PsiClass; PsiClass anno = (PsiClass)resolved; String qname = anno.getQualifiedName(); if (!anno.isAnnotationType() && GrAnnotationCollector.findAnnotationCollector(anno) == null) { if (qname != null) { holder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("class.is.not.annotation", qname)).range(toHighlight).create(); } return; } for (CustomAnnotationChecker checker : CustomAnnotationChecker.EP_NAME.getExtensions()) { if (checker.checkApplicability(holder, annotation)) return; } String description = CustomAnnotationChecker.checkAnnotationApplicable(annotation, owner); if (description != null) { holder.newAnnotation(HighlightSeverity.ERROR, description).range(toHighlight).withFix(new GrRemoveAnnotationIntention()).create(); } }