NullabilityAnnotationInfo (@NotNull PsiAnnotation annotation, @NotNull PsiElement context, PsiAnnotation.TargetType @NotNull [] placeTargetTypes, boolean superPackage) { if (superPackage) return null; PsiClass declaration = annotation.resolveAnnotationType(); PsiModifierList modList = declaration == null ? null : declaration.getModifierList(); if (modList == null) return null; PsiAnnotation tqDefault = AnnotationUtil.findAnnotation(declaration, true, "javax.annotation.meta.TypeQualifierDefault"); if (tqDefault == null) return null; Set<PsiAnnotation.TargetType> required = AnnotationTargetUtil.extractRequiredAnnotationTargets(tqDefault.findAttributeValue(null)); if (required == null || required.isEmpty()) return null; boolean targetApplies = ArrayUtil.contains(PsiAnnotation.TargetType.LOCAL_VARIABLE, placeTargetTypes) ? required.contains(PsiAnnotation.TargetType.LOCAL_VARIABLE) : ContainerUtil.intersects(required, Arrays.asList(placeTargetTypes)); if (!targetApplies) return null; for (PsiAnnotation qualifier : modList.getAnnotations()) { Nullability nullability = getJsr305QualifierNullability(qualifier); if (nullability != null) { return new NullabilityAnnotationInfo(annotation, nullability, true); } } return null; }