/** * Returns true if the given annotation is inherited (instead of being defined directly * on the given modifier list holder * * @param annotation the annotation to check * @param owner the owner potentially declaring the annotation * @return true if the annotation is inherited rather than being declared directly on this owner */ public boolean isInherited(@NonNull PsiAnnotation annotation, @NonNull PsiModifierListOwner owner) { PsiAnnotationOwner annotationOwner = annotation.getOwner(); return annotationOwner == null || !annotationOwner.equals(owner.getModifierList()); }
private void checkTargetType(@NonNull PsiAnnotation node, @NonNull String type1, @Nullable String type2, boolean allowCollection) { PsiAnnotationOwner owner = node.getOwner(); if (owner instanceof PsiModifierList) { PsiElement parent = ((PsiModifierList) owner).getParent();
PsiAnnotationOwner owner = annotation.getOwner(); if (owner == null) { return;