private static void appendModifierList(@NotNull StringBuilder buffer, @NotNull PsiModifierListOwner owner) {
    if (DumbService.isDumb(owner.getProject())) return;

    int lastSize = buffer.length();
    Set<String> shownAnnotations = new HashSet<>();
    for (PsiAnnotation annotation : AnnotationUtil.getAllAnnotations(owner, false, null, true)) {
      final PsiJavaCodeReferenceElement element = annotation.getNameReferenceElement();
      if (element != null) {
        final PsiElement resolved = element.resolve();
        if (resolved == null) {
          String qualifiedName = annotation.getQualifiedName();
          if (NON_DOCUMENTED_JETBRAINS_ANNOTATIONS.contains(qualifiedName)) continue;
        }
        if (resolved instanceof PsiClass cls &&
            !AnnotationUtil.isInferredAnnotation(annotation) &&
            !AnnotationUtil.isExternalAnnotation(annotation) &&
            (!JavaDocInfoGenerator.isDocumentedAnnotationType(cls) ||
             AnnotationTargetUtil.findAnnotationTarget(cls, PsiAnnotation.TargetType.TYPE_USE) != null)) {
          continue;
        }

        String referenceName = element.getReferenceName();
        if (referenceName == null) {
          continue;
        }
        if (shownAnnotations.add(referenceName) || JavaDocInfoGenerator.isRepeatableAnnotationType(resolved)) {
          if (lastSize != buffer.length()) buffer.append(' ');
          buffer.append('@').append(referenceName);
        }
      }
    }
    if (lastSize != buffer.length()) buffer.append(' ');
  }
private static void appendModifierList(@NotNull StringBuilder buffer, @NotNull PsiModifierListOwner owner)