code: public static TypeDesc forClass(String name)
          throws IllegalArgumentException
      {
          // TODO: Figure out how to cache these. Using a plain IdentityMap poses
          // a problem. The back reference to the key causes a memory leak.
  
          if (name.length() < 1) {
              throw invalidName(name);
          }
  
          int index1 = name.lastIndexOf('[');
          int index2 = name.lastIndexOf(']');
          if (index2 >= 0) {
              if (index2 + 1 != name.length() || index1 + 1 != index2) {
                  throw invalidName(name);
              }
              try {
                  return forClass(name.substring(0, index1)).toArrayType();
              }
              catch (IllegalArgumentException e) {
                  throw invalidName(name);
              }
          }
          else if (index1 >= 0) {
              throw invalidName(name);
          }
  
          switch (name.charAt(0)) {
          case 'v':
              if (name.equals("void")) {
                  return VOID;
              }
              break;
          case 'b':
              if (name.equals("boolean")) {
                  return BOOLEAN;
              }
              else if (name.equals("byte")) {
                  return BYTE;
              }
              break;
          case 'c':
              if (name.equals("char")) {
                  return CHAR;
              }
              break;
          case 's':
              if (name.equals("short")) {
                  return SHORT;
              }
              break;
          case 'i':
              if (name.equals("int")) {
                  return INT;
              }
              break;
          case 'l':
              if (name.equals("long")) {
                  return LONG;
              }
              break;
          case 'f':
              if (name.equals("float")) {
                  return FLOAT;
              }
              break;
          case 'd':
              if (name.equals("double")) {
                  return DOUBLE;
              }
              break;
          }
  
          String desc = generateDescriptor(name);
          if (name.indexOf('/') >= 0) {
              name = name.replace('/', '.');
          }
          return intern(new ObjectType(desc, name));
      }
docs: Acquire a TypeDesc from any class name, including primitives and arrays.
  Primitive and array syntax matches Java declarations.