private static int appendTypeSignature(char[] string,int start,boolean fullyQualifyTypeNames,StringBuffer buffer,boolean isVarArgs){
  if (start >= string.length) {
    throw new IllegalArgumentException();
  }
  char c=string[start];
  if (isVarArgs) {
switch (c) {
case C_ARRAY:
      return appendArrayTypeSignature(string,start,fullyQualifyTypeNames,buffer,true);
case C_RESOLVED:
case C_UNRESOLVED:
case C_TYPE_VARIABLE:
case C_BOOLEAN:
case C_BYTE:
case C_CHAR:
case C_DOUBLE:
case C_FLOAT:
case C_INT:
case C_LONG:
case C_SHORT:
case C_VOID:
case C_STAR:
case C_EXTENDS:
case C_SUPER:
case C_CAPTURE:
case C_INTERSECTION:
default :
    throw new IllegalArgumentException();
}
}
 else {
switch (c) {
case C_ARRAY:
  return appendArrayTypeSignature(string,start,fullyQualifyTypeNames,buffer);
case C_RESOLVED:
case C_UNRESOLVED:
return appendClassTypeSignature(string,start,fullyQualifyTypeNames,buffer);
case C_TYPE_VARIABLE:
int e=Util.scanTypeVariableSignature(string,start);
buffer.append(string,start + 1,e - start - 1);
return e;
case C_BOOLEAN:
buffer.append(BOOLEAN);
return start;
case C_BYTE:
buffer.append(BYTE);
return start;
case C_CHAR:
buffer.append(CHAR);
return start;
case C_DOUBLE:
buffer.append(DOUBLE);
return start;
case C_FLOAT:
buffer.append(FLOAT);
return start;
case C_INT:
buffer.append(INT);
return start;
case C_LONG:
buffer.append(LONG);
return start;
case C_SHORT:
buffer.append(SHORT);
return start;
case C_VOID:
buffer.append(VOID);
return start;
case C_CAPTURE:
return appendCaptureTypeSignature(string,start,fullyQualifyTypeNames,buffer);
case C_INTERSECTION:
return appendIntersectionTypeSignature(string,start,fullyQualifyTypeNames,buffer);
case C_STAR:
case C_EXTENDS:
case C_SUPER:
return appendTypeArgumentSignature(string,start,fullyQualifyTypeNames,buffer);
default :
throw new IllegalArgumentException();
}
}
}

private static int appendTypeSignature ( char [ ] string , int start , boolean fullyQualifyTypeNames , StringBuffer buffer , boolean isVarArgs ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( isVarArgs ) { switch ( c ) { case C_ARRAY : return appendArrayTypeSignature ( string , start , fullyQualifyTypeNames , buffer , true ) ; case C_RESOLVED : case C_UNRESOLVED : case C_TYPE_VARIABLE : case C_BOOLEAN : case C_BYTE : case C_CHAR : case C_DOUBLE : case C_FLOAT : case C_INT : case C_LONG : case C_SHORT : case C_VOID : case C_STAR : case C_EXTENDS : case C_SUPER : case C_CAPTURE : case C_INTERSECTION : default : throw new IllegalArgumentException ( ) ; } } else { switch ( c ) { case C_ARRAY : return appendArrayTypeSignature ( string , start , fullyQualifyTypeNames , buffer ) ; case C_RESOLVED : case C_UNRESOLVED : return appendClassTypeSignature ( string , start , fullyQualifyTypeNames , buffer ) ; case C_TYPE_VARIABLE : int e = Util . scanTypeVariableSignature ( string , start ) ; buffer . append ( string , start + 1 , e - start - 1 ) ; return e ; case C_BOOLEAN : buffer . append ( BOOLEAN ) ; return start ; case C_BYTE : buffer . append ( BYTE ) ; return start ; case C_CHAR : buffer . append ( CHAR ) ; return start ; case C_DOUBLE : buffer . append ( DOUBLE ) ; return start ; case C_FLOAT : buffer . append ( FLOAT ) ; return start ; case C_INT : buffer . append ( INT ) ; return start ; case C_LONG : buffer . append ( LONG ) ; return start ; case C_SHORT : buffer . append ( SHORT ) ; return start ; case C_VOID : buffer . append ( VOID ) ; return start ; case C_CAPTURE : return appendCaptureTypeSignature ( string , start , fullyQualifyTypeNames , buffer ) ; case C_INTERSECTION : return appendIntersectionTypeSignature ( string , start , fullyQualifyTypeNames , buffer ) ; case C_STAR : case C_EXTENDS : case C_SUPER : return appendTypeArgumentSignature ( string , start , fullyQualifyTypeNames , buffer ) ; default : throw new IllegalArgumentException ( ) ; } } }
scans the given string for a type signature starting at the given index and appends it to the given buffer , and returns the index of the last character .
