AnnotationAndOwner (@NotNull PsiModifierListOwner listOwner, @NotNull Set<String> annotationNames, boolean skipExternal) { PsiAnnotation directAnnotation = findAnnotation(listOwner, annotationNames, skipExternal); if (directAnnotation != null) return new AnnotationAndOwner(listOwner, directAnnotation); for (PsiModifierListOwner superOwner : getSuperAnnotationOwners(listOwner)) { PsiAnnotation annotation = findAnnotation(superOwner, annotationNames, skipExternal); if (annotation != null) { return new AnnotationAndOwner(superOwner, annotation); } } return null; }