private static int appendClassTypeSignature(char[] string,int start,boolean fullyQualifyTypeNames,StringBuffer buffer){
  if (start >= string.length - 2) {
    throw new IllegalArgumentException();
  }
  char c=string[start];
  if (c != C_RESOLVED && c != C_UNRESOLVED) {
    throw new IllegalArgumentException();
  }
  boolean resolved=(c == C_RESOLVED);
  boolean removePackageQualifiers=!fullyQualifyTypeNames;
  if (!resolved) {
    removePackageQualifiers=false;
  }
  int p=start + 1;
  int checkpoint=buffer.length();
  int innerTypeStart=-1;
  boolean inAnonymousType=false;
  while (true) {
    if (p >= string.length) {
      throw new IllegalArgumentException();
    }
    c=string[p];
switch (c) {
case C_SEMICOLON:
      return p;
case C_GENERIC_START:
    int e=appendTypeArgumentSignatures(string,p,fullyQualifyTypeNames,buffer);
  removePackageQualifiers=false;
p=e;
break;
case C_DOT:
if (removePackageQualifiers) {
buffer.setLength(checkpoint);
}
 else {
buffer.append('.');
}
break;
case '/':
if (removePackageQualifiers) {
buffer.setLength(checkpoint);
}
 else {
buffer.append('/');
}
break;
case C_DOLLAR:
innerTypeStart=buffer.length();
inAnonymousType=false;
if (resolved) {
removePackageQualifiers=false;
buffer.append('.');
}
break;
default :
if (innerTypeStart != -1 && !inAnonymousType && Character.isDigit(c)) {
inAnonymousType=true;
buffer.setLength(innerTypeStart);
buffer.insert(checkpoint,"new ");
buffer.append("(){}");
}
if (!inAnonymousType) buffer.append(c);
innerTypeStart=-1;
}
p++;
}
}

private static int appendClassTypeSignature ( char [ ] string , int start , boolean fullyQualifyTypeNames , StringBuffer buffer ) { if ( start >= string . length - 2 ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_RESOLVED && c != C_UNRESOLVED ) { throw new IllegalArgumentException ( ) ; } boolean resolved = ( c == C_RESOLVED ) ; boolean removePackageQualifiers = ! fullyQualifyTypeNames ; if ( ! resolved ) { removePackageQualifiers = false ; } int p = start + 1 ; int checkpoint = buffer . length ( ) ; int innerTypeStart = - 1 ; boolean inAnonymousType = false ; while ( true ) { if ( p >= string . length ) { throw new IllegalArgumentException ( ) ; } c = string [ p ] ; switch ( c ) { case C_SEMICOLON : return p ; case C_GENERIC_START : int e = appendTypeArgumentSignatures ( string , p , fullyQualifyTypeNames , buffer ) ; removePackageQualifiers = false ; p = e ; break ; case C_DOT : if ( removePackageQualifiers ) { buffer . setLength ( checkpoint ) ; } else { buffer . append ( '.' ) ; } break ; case '/' : if ( removePackageQualifiers ) { buffer . setLength ( checkpoint ) ; } else { buffer . append ( '/' ) ; } break ; case C_DOLLAR : innerTypeStart = buffer . length ( ) ; inAnonymousType = false ; if ( resolved ) { removePackageQualifiers = false ; buffer . append ( '.' ) ; } break ; default : if ( innerTypeStart != - 1 && ! inAnonymousType && Character . isDigit ( c ) ) { inAnonymousType = true ; buffer . setLength ( innerTypeStart ) ; buffer . insert ( checkpoint , "new " ) ; buffer . append ( "(){}" ) ; } if ( ! inAnonymousType ) buffer . append ( c ) ; innerTypeStart = - 1 ; } p ++ ; } }
scans the given string for a class type signature starting at the given index and appends it to the given buffer , and returns the index of the last character .
