mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 03:37:58 +07:00
type annotations: skip type annotation in generated code if it also has normal applicable targets (IDEA-206570)
GitOrigin-RevId: 651526af474d80f2664229f8c000c790152b3f0d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7793b16164
commit
d66d66d259
@@ -113,13 +113,12 @@ public abstract class NullableNotNullManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
PsiModifierList modifierList = target.getModifierList();
|
||||
// type annotations are part of target's type and should not to be copied explicitly to avoid duplication
|
||||
if (!AnnotationTargetUtil.isTypeAnnotation(annotation)) {
|
||||
|
||||
PsiModifierList modifierList = target.getModifierList();
|
||||
if (modifierList != null && !modifierList.hasAnnotation(qualifiedName)) {
|
||||
return modifierList.addAnnotation(qualifiedName);
|
||||
}
|
||||
if (modifierList != null &&
|
||||
!AnnotationTargetUtil.isStrictlyTypeUseAnnotation(modifierList, annotation) &&
|
||||
!modifierList.hasAnnotation(qualifiedName)) {
|
||||
return modifierList.addAnnotation(qualifiedName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user