mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-54956 (ignore corrupted annotations)
This commit is contained in:
@@ -27,7 +27,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.assertNotNull;
|
||||
import static com.intellij.util.ObjectUtils.notNull;
|
||||
|
||||
/**
|
||||
@@ -279,17 +278,23 @@ public abstract class PsiNameHelper {
|
||||
}
|
||||
|
||||
public static boolean appendAnnotations(@NotNull StringBuilder sb, @NotNull List<PsiAnnotation> annotations, boolean canonical) {
|
||||
boolean updated = false;
|
||||
for (PsiAnnotation annotation : annotations) {
|
||||
sb.append('@');
|
||||
if (canonical) {
|
||||
sb.append(annotation.getQualifiedName());
|
||||
sb.append(annotation.getParameterList().getText());
|
||||
String name = annotation.getQualifiedName();
|
||||
if (name != null) {
|
||||
sb.append('@').append(name).append(annotation.getParameterList().getText()).append(' ');
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sb.append(assertNotNull(annotation.getNameReferenceElement()).getText());
|
||||
PsiJavaCodeReferenceElement refElement = annotation.getNameReferenceElement();
|
||||
if (refElement != null) {
|
||||
sb.append('@').append(refElement.getText()).append(' ');
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
sb.append(' ');
|
||||
}
|
||||
return !annotations.isEmpty();
|
||||
return updated;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user