boolean (@NotNull StringBuilder sb, @NotNull List<? extends PsiAnnotation> annotations, boolean canonical) { boolean updated = false; for (PsiAnnotation annotation : annotations) { if (canonical) { String name = annotation.getQualifiedName(); if (name != null) { sb.append('@').append(name).append(annotation.getParameterList().getText()).append(' '); updated = true; } } else { PsiJavaCodeReferenceElement refElement = annotation.getNameReferenceElement(); if (refElement != null) { sb.append('@').append(refElement.getText()).append(' '); updated = true; } } } return updated; }