String (@Nullable PsiType type) { if (type instanceof PsiClassType) { PsiClass resolved = ((PsiClassType)type).resolve(); if (resolved instanceof PsiAnonymousClass) { return "anonymous " + getQualifiedName(((PsiAnonymousClass)resolved).getBaseClassType()); } if (resolved != null) { return resolved.getQualifiedName(); } else { return PsiNameHelper.getQualifiedClassName(type.getCanonicalText(), true); } } return null; }