Buggy code:
public final char [ ] Name = "name" . toCharArray ( ) ; public static final char [ ] NameSignature = "()Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] NewInstance = "newInstance" . toCharArray ( ) ; public static final char [ ] NewInstanceSignature = "(Ljava//lang//Class;[I)Ljava//lang//Object;" . toCharArray ( ) ; public static final char [ ] Next = "next" . toCharArray ( ) ; public static final char [ ] NextSignature = "()Ljava//lang//Object;" . toCharArray ( ) ; public static final char [ ] ObjectConstrSignature = "(Ljava//lang//Object;)V" . toCharArray ( ) ; public static final char [ ] Ordinal = "ordinal" . toCharArray ( ) ; public static final char [ ] OrdinalSignature = "()I" . toCharArray ( ) ; public static final char [ ] Out = "out" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_NAME = "setBoolean" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_SIGNATURE = "(Ljava//lang//Object;Z)V" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_NAME = "setByte" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_SIGNATURE = "(Ljava//lang//Object;B)V" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_NAME = "setChar" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_SIGNATURE = "(Ljava//lang//Object;C)V" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_NAME = "setDouble" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_SIGNATURE = "(Ljava//lang//Object;D)V" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_NAME = "setFloat" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_SIGNATURE = "(Ljava//lang//Object;F)V" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_NAME = "setInt" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_SIGNATURE = "(Ljava//lang//Object;I)V" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_NAME = "setLong" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_SIGNATURE = "(Ljava//lang//Object;J)V" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_NAME = "set" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_SIGNATURE = "(Ljava//lang//Object;Ljava//lang//Object;)V" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_NAME = "setShort" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_SIGNATURE = "(Ljava//lang//Object;S)V" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_NAME = "setAccessible" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_SIGNATURE = "(Z)V" . toCharArray ( ) ; public static final char [ ] ShortConstrSignature = "(S)V" . toCharArray ( ) ; public static final char [ ] shortShortSignature = "(S)Ljava//lang//Short;" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_NAME = "shortValue" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_SIGNATURE = "()S" . toCharArray ( ) ; public static final char [ ] StringBufferAppendBooleanSignature = "(Z)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendCharSignature = "(C)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendDoubleSignature = "(D)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendFloatSignature = "(F)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendIntSignature = "(I)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendLongSignature = "(J)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendObjectSignature = "(Ljava//lang//Object;)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBufferAppendStringSignature = "(Ljava//lang//String;)Ljava//lang//StringBuffer;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendBooleanSignature = "(Z)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendCharSignature = "(C)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendDoubleSignature = "(D)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendFloatSignature = "(F)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendIntSignature = "(I)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendLongSignature = "(J)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendObjectSignature = "(Ljava//lang//Object;)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendStringSignature = "(Ljava//lang//String;)Ljava//lang//StringBuilder;" . toCharArray ( ) ; public static final char [ ] StringConstructorSignature = "(Ljava//lang//String;)V" . toCharArray ( ) ; public static final char [ ] This = "this" . toCharArray ( ) ; public static final char [ ] ToString = "toString" . toCharArray ( ) ; public static final char [ ] ToStringSignature = ConstantPool . GetMessageSignature ; public static final char [ ] TYPE = "TYPE" . toCharArray ( ) ; public static final char [ ] ValueOf = "valueOf" . toCharArray ( ) ; public static final char [ ] ValueOfBooleanSignature = "(Z)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfCharSignature = "(C)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfDoubleSignature = "(D)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfFloatSignature = "(F)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfIntSignature = "(I)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfLongSignature = "(J)Ljava//lang//String;" . toCharArray ( ) ; public static final char [ ] ValueOfObjectSignature = "(Ljava//lang//Object;)Ljava//lang//String;" . toCharArray ( ) ; public ConstantPool ( ClassFile classFile ) { } public byte [ ] dumpBytes ( ) { } private int getFromCache ( char [ ] declaringClass , char [ ] name , char [ ] signature ) { } private int getFromNameAndTypeCache ( char [ ] name , char [ ] signature ) { } public int literalIndex ( byte [ ] utf8encoding , char [ ] stringCharArray ) { } public int literalIndex ( char [ ] utf8Constant ) { } public int literalIndex ( char [ ] stringCharArray , byte [ ] utf8encoding ) { } public int literalIndex ( double key ) { } public int literalIndex ( float key ) { } public int literalIndex ( int key ) { } public int literalIndex ( long key ) { } public int literalIndex ( String stringConstant ) { } public int literalIndex ( FieldBinding aFieldBinding ) { } public int literalIndex ( MethodBinding aMethodBinding ) { int index ; final TypeBinding constantPoolDeclaringClass = aMethodBinding . constantPoolDeclaringClass ( ) ; final char [ ] declaringClassConstantPoolName = constantPoolDeclaringClass . constantPoolName ( ) ; final char [ ] selector = aMethodBinding . selector ; final char [ ] signature = aMethodBinding . signature ( ) ; if ( ( index = getFromCache ( declaringClassConstantPoolName , selector , signature ) ) < 0 ) { int classIndex = literalIndexForType ( constantPoolDeclaringClass . constantPoolName ( ) ) ; int nameAndTypeIndex = literalIndexForMethods ( literalIndex ( selector ) , literalIndex ( signature ) , selector , signature ) ; index = putInCache ( declaringClassConstantPoolName , selector , signature , ( ( currentIndex ) ++ ) ) ; if ( index > 65535 ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } <START_BUG> writeU1 ( ( constantPoolDeclaringClass . isInterface ( ) ? ClassFileConstants . InterfaceMethodRefTag : ClassFileConstants . MethodRefTag ) ) ; <END_BUG>

Fix:
writeU1 ( ( ( constantPoolDeclaringClass . isInterface ( ) ) || ( constantPoolDeclaringClass . isAnnotationType ( ) ) ? ClassFileConstants . InterfaceMethodRefTag : ClassFileConstants . MethodRefTag ) ) ;