PsiClassType () { JavaPsiFacade facade = JavaPsiFacade.getInstance(getProject()); PsiClass enumClass = facade.findClass(JAVA_LANG_ENUM, getResolveScope()); PsiElementFactory factory = facade.getElementFactory(); if (enumClass != null) { PsiSubstitutor substitutor = PsiSubstitutor.EMPTY; PsiTypeParameter[] typeParameters = enumClass.getTypeParameters(); if (typeParameters.length == 1) { substitutor = substitutor.put(typeParameters[0], factory.createType(this)); } return factory.createType(enumClass, substitutor); } return TypesUtil.createTypeByFQClassName(JAVA_LANG_ENUM, this); }