boolean (@NotNull PsiModifierListOwner listOwner, @NotNull Collection<String> annotations, Set<? super PsiMember> visited) { if (isMetaAnnotated(listOwner, annotations)) return true; if (listOwner instanceof PsiClass) { for (PsiClass superClass : ((PsiClass)listOwner).getSupers()) { if (visited.add(superClass) && isMetaAnnotatedInHierarchy(superClass, annotations, visited)) return true; } } else if (listOwner instanceof PsiMethod) { for (PsiMethod method : ((PsiMethod)listOwner).findSuperMethods()) { if (visited.add(method) && isMetaAnnotatedInHierarchy(method, annotations, visited)) return true; } } return false; }