mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
BaseExternalAnnotationsManager.markAsExternalAnnotation
This commit is contained in:
@@ -366,8 +366,7 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
|
||||
PsiAnnotation a = annotation;
|
||||
if (a == null) {
|
||||
a = context.createAnnotationFromText("@" + annotationClassFqName + (annotationParameters.isEmpty() ? "" : "("+annotationParameters+")"));
|
||||
a.putUserData(EXTERNAL_ANNO_MARKER, Boolean.TRUE);
|
||||
annotation = a;
|
||||
annotation = markAsExternalAnnotation(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
@@ -390,6 +389,11 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
|
||||
}
|
||||
}
|
||||
|
||||
private static PsiAnnotation markAsExternalAnnotation(@NotNull PsiAnnotation annotation) {
|
||||
annotation.putUserData(EXTERNAL_ANNO_MARKER, Boolean.TRUE);
|
||||
return annotation;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private PsiAnnotation createAnnotationFromText(@NotNull final String text) throws IncorrectOperationException {
|
||||
// synchronize during interning in charTable
|
||||
@@ -399,8 +403,7 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
|
||||
if (!(element instanceof PsiAnnotation)) {
|
||||
throw new IncorrectOperationException("Incorrect annotation \"" + text + "\".");
|
||||
}
|
||||
element.putUserData(EXTERNAL_ANNO_MARKER, Boolean.TRUE);
|
||||
return (PsiAnnotation)element;
|
||||
return markAsExternalAnnotation((PsiAnnotation)element);
|
||||
}
|
||||
}
|
||||
private static final JavaParserUtil.ParserWrapper ANNOTATION = new JavaParserUtil.ParserWrapper() {
|
||||
|
||||
Reference in New Issue
Block a user