[java] PsiClassRefType returns annotations embedded in a ref (IDEA-140234, IDEA-166062)

This commit is contained in:
Roman Shevchenko
2017-04-18 11:40:54 +02:00
parent 184b08380c
commit 311fc75ff8
4 changed files with 58 additions and 8 deletions

View File

@@ -288,6 +288,11 @@ public class AnnotationUtil {
PsiAnnotation annotation = modifierList.findAnnotation(annotationFQN);
if (annotation != null) return true;
PsiType type = null;
if (listOwner instanceof PsiMethod) type = ((PsiMethod)listOwner).getReturnType();
else if (listOwner instanceof PsiVariable) type = ((PsiVariable)listOwner).getType();
if (type != null && type.findAnnotation(annotationFQN) != null) return true;
if (!skipExternal) {
final Project project = listOwner.getProject();
if (ExternalAnnotationsManager.getInstance(project).findExternalAnnotation(listOwner, annotationFQN) != null ||