JvmReferenceType (@NotNull PsiClass psiClass) { if (psiClass.isInterface()) return null; if (psiClass.isEnum()) return getTypeByName(CommonClassNames.JAVA_LANG_ENUM, psiClass.getProject(), psiClass.getResolveScope()); if (psiClass instanceof PsiAnonymousClass) { PsiClassType baseClassType = ((PsiAnonymousClass)psiClass).getBaseClassType(); PsiClass baseClass = baseClassType.resolve(); if (baseClass == null || !baseClass.isInterface()) { return baseClassType; } else { return getJavaLangObject(psiClass.getManager(), psiClass.getResolveScope()); } } if (CommonClassNames.JAVA_LANG_OBJECT.equals(psiClass.getQualifiedName())) return null; PsiClassType[] extendsTypes = psiClass.getExtendsListTypes(); if (extendsTypes.length != 1) return getJavaLangObject(psiClass.getManager(), psiClass.getResolveScope()); return extendsTypes[0]; }