public static @Nls String getNameForClass(@NotNull PsiClass aClass, boolean qualified) {
    if (aClass instanceof PsiImplicitClass) {
      String name = aClass.getQualifiedName();
      if (name != null) {
        return name;
      }
      return JavaPsiBundle.message("implicit.class.context.display");
    }
    if (aClass instanceof PsiAnonymousClass) {
      if (aClass instanceof PsiEnumConstantInitializer) {
        PsiEnumConstant enumConstant = ((PsiEnumConstantInitializer)aClass).getEnumConstant();
        String name = enumConstant.getName();
        return JavaPsiBundle.message("enum.constant.context", name, getContextName(enumConstant, qualified, false));
      }
      return JavaPsiBundle.message("anonymous.class.context.display", getContextName(aClass, qualified, false));
    }
    if (qualified) {
      String qName = aClass.getQualifiedName();
      if (qName != null) return qName;
    }
    String className = aClass.getName();
    String contextName = getContextName(aClass, qualified);
    return contextName != null ? JavaPsiBundle.message("class.context.display", className, contextName) : className;
  }
public static @Nls String getNameForClass(@NotNull PsiClass aClass, boolean qualified)