code: public static TypeDesc forDescriptor(final String desc) throws IllegalArgumentException {
          TypeDesc type = cDescriptorsToInstances.get(desc);
          if (type != null) {
              return type;
          }
  
          // TODO: Support generics in descriptor.
  
          String rootDesc = desc;
          int cursor = 0;
          int dim = 0;
          try {
              char c;
              while ((c = rootDesc.charAt(cursor++)) == '[') {
                  dim++;
              }
  
              switch (c) {
              case 'V':
                  type = VOID;
                  break;
              case 'Z':
                  type = BOOLEAN;
                  break;
              case 'C':
                  type = CHAR;
                  break;
              case 'B':
                  type = BYTE;
                  break;
              case 'S':
                  type = SHORT;
                  break;
              case 'I':
                  type = INT;
                  break;
              case 'J':
                  type = LONG;
                  break;
              case 'F':
                  type = FLOAT;
                  break;
              case 'D':
                  type = DOUBLE;
                  break;
              case 'L':
                  if (dim > 0) {
                      rootDesc = rootDesc.substring(dim);
                      cursor = 1;
                  }
                  StringBuffer name = new StringBuffer(rootDesc.length() - 2);
                  while ((c = rootDesc.charAt(cursor++)) != ';') {
                      if (c == '/') {
                          c = '.';
                      }
                      name.append(c);
                  }
                  type = intern(new ObjectType(rootDesc, name.toString()));
                  break;
              default:
                  throw invalidDescriptor(desc);
              }
          } catch (NullPointerException e) {
              throw invalidDescriptor(desc);
          } catch (IndexOutOfBoundsException e) {
              throw invalidDescriptor(desc);
          }
  
          if (cursor != rootDesc.length()) {
              throw invalidDescriptor(desc);
          }
  
          while (--dim >= 0) {
              type = type.toArrayType();
          }
  
          cDescriptorsToInstances.put(desc, type);
          return type;
      }
docs: Acquire a TypeDesc from a type descriptor.