PsiClass (@NotNull PsiReference reference, @NotNull PsiMember member) { if (!(reference instanceof PsiJavaCodeReferenceElement)) return null; PsiElement qualifier = ((PsiJavaCodeReferenceElement)reference).getQualifier(); if (!(qualifier instanceof PsiExpression)) return null; PsiClass accessObjectClass = null; JavaResolveResult accessClass = PsiUtil.getAccessObjectClass((PsiExpression)qualifier); PsiElement element = accessClass.getElement(); if (element instanceof PsiTypeParameter) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(member.getContainingFile().getProject()); PsiClassType type = factory.createType((PsiTypeParameter)element); PsiType accessType = accessClass.getSubstitutor().substitute(type); if (accessType instanceof PsiArrayType) { LanguageLevel languageLevel = PsiUtil.getLanguageLevel(member.getContainingFile()); accessObjectClass = factory.getArrayClass(languageLevel); } else if (accessType instanceof PsiClassType) { accessObjectClass = ((PsiClassType)accessType).resolve(); } } else if (element instanceof PsiClass) { accessObjectClass = (PsiClass)element; } return accessObjectClass; }