out.write(t.asClassDoc().qualifiedName()); } else {
ClassDoc cd = t.asClassDoc(); ClassDoc outer = cd.containingClass(); String qualifiedName; if (outer == null) { qualifiedName = cd.qualifiedName(); } else { String simpleName = cd.name(); simpleName = simpleName.substring(simpleName.lastIndexOf('.') + 1); qualifiedName = outer.qualifiedName() + '$' + simpleName; } out.write(qualifiedName); } else {
  public static String getFdFor(Type t) {    if (t == null) throw new IllegalArgumentException("null type");    String dim = t.dimension();    if (dim == null || dim.length() == 0) {      ClassDoc cd = t.asClassDoc();      if (cd != null) {        ClassDoc outer = cd.containingClass();        if (outer == null) return cd.qualifiedName();        String simpleName = cd.name();        simpleName = simpleName.substring(simpleName.lastIndexOf('.')+1);        return outer.qualifiedName()+'$'+simpleName;      } else {        return t.qualifiedTypeName();      }    } else {      StringWriter out = new StringWriter();      for(int i=0, iL=dim.length()/2; i<iL; i++) out.write("[");      String primFd =              PrimitiveClassImpl.getPrimitiveClassForName(t.qualifiedTypeName());      if (primFd != null) { //i.e. if primitive        out.write(primFd);      } else {        out.write("L");        if (t.asClassDoc() != null) {          out.write(t.asClassDoc().qualifiedName());        } else {          out.write(t.qualifiedTypeName());        }        out.write(";");      }      return out.toString();    }  }