Buggy code:
public final class Signature { public static final char C_BOOLEAN = 'Z' ; public static final char C_BYTE = 'B' ; public static final char C_CHAR = 'C' ; public static final char C_DOUBLE = 'D' ; public static final char C_FLOAT = 'F' ; public static final char C_INT = 'I' ; public static final char C_SEMICOLON = ';' ; public static final char C_LONG = 'J' ; public static final char C_SHORT = 'S' ; public static final char C_VOID = 'V' ; public static final char C_DOT = '.' ; public static final char C_DOLLAR = '$' ; public static final char C_ARRAY = '[' ; public static final char C_RESOLVED = 'L' ; public static final char C_UNRESOLVED = 'Q' ; public static final char C_NAME_END = ';' ; public static final char C_PARAM_START = '(' ; public static final char C_PARAM_END = ')' ; public static final String SIG_BOOLEAN = "Z" ; public static final String SIG_BYTE = "B" ; public static final String SIG_CHAR = "C" ; public static final String SIG_DOUBLE = "D" ; public static final String SIG_FLOAT = "F" ; public static final String SIG_INT = "I" ; public static final String SIG_LONG = "J" ; public static final String SIG_SHORT = "S" ; public static final String SIG_VOID = "V" ; private Signature ( ) { } private static String arrayIfy ( String typeName , int arrayCount ) { } public static String createArraySignature ( String typeSignature , int arrayCount ) { } public static String createMethodSignature ( String [ ] parameterTypes , String returnType ) { } public static String createTypeSignature ( char [ ] typeName , boolean isResolved ) { } public static String createTypeSignature ( String typeName , boolean isResolved ) { try { Scanner scanner = new Scanner ( ) ; <START_BUG> scanner . setSourceBuffer ( typeName . toCharArray ( ) ) ; <END_BUG> int token = scanner . getNextToken ( ) ; StringBuffer sig = new StringBuffer ( ) ; int arrayCount = 0 ; boolean primitive = true ; switch ( token ) { case ITerminalSymbols . TokenNameIdentifier : sig . append ( scanner . getCurrentIdentifierSource ( ) ) ; primitive = false ; break ; case ITerminalSymbols . TokenNameboolean : sig . append ( Signature . SIG_BOOLEAN ) ; break ; case ITerminalSymbols . TokenNamebyte : sig . append ( Signature . SIG_BYTE ) ; break ; case ITerminalSymbols . TokenNamechar : sig . append ( Signature . SIG_CHAR ) ; break ; case ITerminalSymbols . TokenNamedouble : sig . append ( Signature . SIG_DOUBLE ) ; break ; case ITerminalSymbols . TokenNamefloat : sig . append ( Signature . SIG_FLOAT ) ; break ; case ITerminalSymbols . TokenNameint : sig . append ( Signature . SIG_INT ) ; break ; case ITerminalSymbols . TokenNamelong : sig . append ( Signature . SIG_LONG ) ; break ; case ITerminalSymbols . TokenNameshort : sig . append ( Signature . SIG_SHORT ) ; break ; case ITerminalSymbols . TokenNamevoid : sig . append ( Signature . SIG_VOID ) ; break ; default : throw new IllegalArgumentException ( ) ; } token = scanner . getNextToken ( ) ; while ( ( ! primitive ) && ( token == ( ITerminalSymbols . TokenNameDOT ) ) ) { sig . append ( scanner . getCurrentIdentifierSource ( ) ) ; token = scanner . getNextToken ( ) ; if ( token == ( ITerminalSymbols . TokenNameIdentifier ) ) { sig . append ( scanner . getCurrentIdentifierSource ( ) ) ; token = scanner . getNextToken ( ) ; } else { throw new IllegalArgumentException ( ) ; } } while ( token == ( ITerminalSymbols . TokenNameLBRACKET ) ) { token = scanner . getNextToken ( ) ; if ( token != ( ITerminalSymbols . TokenNameRBRACKET ) ) throw new IllegalArgumentException ( ) ; arrayCount ++ ; token = scanner . getNextToken ( ) ; } if ( token != ( ITerminalSymbols . TokenNameEOF ) ) throw new IllegalArgumentException ( ) ; if ( ! primitive ) { sig . insert ( 0 , ( isResolved ? Signature . C_RESOLVED : Signature . C_UNRESOLVED ) ) ; } if ( arrayCount == 0 ) { if ( primitive ) return sig . toString ( ) ; } else { char [ ] brackets = new char [ arrayCount ] ; while ( ( arrayCount -- ) != 0 ) { brackets [ arrayCount ] = Signature . C_ARRAY ; } sig . insert ( 0 , brackets ) ; } if ( ! primitive ) { sig . append ( Signature . C_NAME_END ) ; } return sig . toString ( ) ; } catch ( InvalidInputException e ) { throw new IllegalArgumentException ( ) ; } } public static int getArrayCount ( String typeSignature ) throws IllegalArgumentException { } public static String getElementType ( String typeSignature ) throws IllegalArgumentException { } public static int getParameterCount ( String methodSignature ) throws IllegalArgumentException { } public static String [ ] getParameterTypes ( String methodSignature ) throws IllegalArgumentException { } public static String getQualifier ( String name ) { } public static String getReturnType ( String methodSignature ) throws IllegalArgumentException { } public static String getSimpleName ( String name ) { } public static String [ ] getSimpleNames ( String name ) { } public static String toQualifiedName ( String [ ] segments ) { } public static String toString ( String signature ) throws IllegalArgumentException { } public static String toString ( String methodSignature , String methodName , String [ ] parameterNames , boolean fullyQualifyTypeNames , boolean includeReturnType ) { } }

Fix:
scanner . setSource ( typeName . toCharArray ( ) ) ;