public static Prototype intern(String descriptor){
  if (descriptor == null) {
    throw new NullPointerException("descriptor == null");
  }
  Prototype result;
synchronized (internTable) {
    result=internTable.get(descriptor);
  }
  if (result != null) {
    return result;
  }
  Type[] params=makeParameterArray(descriptor);
  int paramCount=0;
  int at=1;
  for (; ; ) {
    int startAt=at;
    char c=descriptor.charAt(at);
    if (c == ')') {
      at++;
      break;
    }
    while (c == '[') {
      at++;
      c=descriptor.charAt(at);
    }
    if (c == 'L') {
      int endAt=descriptor.indexOf(';',at);
      if (endAt == -1) {
        throw new IllegalArgumentException("bad descriptor");
      }
      at=endAt + 1;
    }
 else {
      at++;
    }
    params[paramCount]=Type.intern(descriptor.substring(startAt,at));
    paramCount++;
  }
  Type returnType=Type.internReturnType(descriptor.substring(at));
  StdTypeList parameterTypes=new StdTypeList(paramCount);
  for (int i=0; i < paramCount; i++) {
    parameterTypes.set(i,params[i]);
  }
  result=new Prototype(descriptor,returnType,parameterTypes);
  return putIntern(result);
}

public static Prototype intern ( String descriptor ) { if ( descriptor == null ) { throw new NullPointerException ( "descriptor == null" ) ; } Prototype result ; synchronized ( internTable ) { result = internTable . get ( descriptor ) ; } if ( result != null ) { return result ; } Type [ ] params = makeParameterArray ( descriptor ) ; int paramCount = 0 ; int at = 1 ; for ( ; ; ) { int startAt = at ; char c = descriptor . charAt ( at ) ; if ( c == ')' ) { at ++ ; break ; } while ( c == '[' ) { at ++ ; c = descriptor . charAt ( at ) ; } if ( c == 'L' ) { int endAt = descriptor . indexOf ( ';' , at ) ; if ( endAt == - 1 ) { throw new IllegalArgumentException ( "bad descriptor" ) ; } at = endAt + 1 ; } else { at ++ ; } params [ paramCount ] = Type . intern ( descriptor . substring ( startAt , at ) ) ; paramCount ++ ; } Type returnType = Type . internReturnType ( descriptor . substring ( at ) ) ; StdTypeList parameterTypes = new StdTypeList ( paramCount ) ; for ( int i = 0 ; i < paramCount ; i ++ ) { parameterTypes . set ( i , params [ i ] ) ; } result = new Prototype ( descriptor , returnType , parameterTypes ) ; return putIntern ( result ) ; }
returns the unique instance corresponding to the given method descriptor . see vmspec - 2 sec4 . 3 . 3 for details on the field descriptor syntax .
