String () { Kind kind = getKindEnum(getContainingFile()); switch (kind) { case CLASS_NAME_KIND: case CLASS_OR_PACKAGE_NAME_KIND: case CLASS_IN_QUALIFIED_NEW_KIND: PsiElement target = resolve(); if (target instanceof PsiClass) { PsiClass aClass = (PsiClass)target; String name = aClass.getQualifiedName(); if (name == null) { name = aClass.getName(); //? } return name; } else if (target instanceof PsiPackage) { return ((PsiPackage)target).getQualifiedName(); } else { LOG.assertTrue(target == null, target); return getClassNameText(); } case PACKAGE_NAME_KIND: case CLASS_FQ_NAME_KIND: case CLASS_FQ_OR_PACKAGE_NAME_KIND: return getNormalizedText(); // there cannot be any <...> default: throw new IllegalArgumentException("Unexpected kind: " + kind); } }