<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ConstantPool implements ClassFileConstants , TypeIds { public static final int DOUBLE_INITIAL_SIZE = 5 ; public static final int FLOAT_INITIAL_SIZE = 3 ; public static final int INT_INITIAL_SIZE = 248 ; public static final int LONG_INITIAL_SIZE = 5 ; public static final int UTF8_INITIAL_SIZE = 778 ; public static final int STRING_INITIAL_SIZE = 761 ; public static final int METHODS_AND_FIELDS_INITIAL_SIZE = 450 ; public static final int CLASS_INITIAL_SIZE = 86 ; public static final int NAMEANDTYPE_INITIAL_SIZE = 272 ; public static final int CONSTANTPOOL_INITIAL_SIZE = 2000 ; public static final int CONSTANTPOOL_GROW_SIZE = 6000 ; protected DoubleCache doubleCache ; protected FloatCache floatCache ; protected IntegerCache intCache ; protected LongCache longCache ; public CharArrayCache UTF8Cache ; protected CharArrayCache stringCache ; protected HashtableOfObject methodsAndFieldsCache ; protected CharArrayCache classCache ; protected HashtableOfObject nameAndTypeCacheForFieldsAndMethods ; public byte [ ] poolContent ; public int currentIndex = 1 ; public int currentOffset ; public int [ ] offsets ; public ClassFile classFile ; public static final char [ ] Append = "append" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_NAME = "newInstance" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] ArrayCopy = "arraycopy" . toCharArray ( ) ; public static final char [ ] ArrayCopySignature = "" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangClassConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangObjectConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] booleanBooleanSignature = "" . toCharArray ( ) ; public static final char [ ] BooleanConstrSignature = "(Z)V" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "booleanValue" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "()Z" . toCharArray ( ) ; public static final char [ ] byteByteSignature = "" . toCharArray ( ) ; public static final char [ ] ByteConstrSignature = "(B)V" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_NAME = "byteValue" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_SIGNATURE = "()B" . toCharArray ( ) ; public static final char [ ] charCharacterSignature = "" . toCharArray ( ) ; public static final char [ ] CharConstrSignature = "(C)V" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_NAME = "charValue" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "()C" . toCharArray ( ) ; public static final char [ ] Clinit = "<clinit>" . toCharArray ( ) ; public static final char [ ] DefaultConstructorSignature = "()V" . toCharArray ( ) ; public static final char [ ] ClinitSignature = DefaultConstructorSignature ; public static final char [ ] Close = "close" . toCharArray ( ) ; public static final char [ ] CloseSignature = "()V" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatus = "" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatusSignature = "()Z" . toCharArray ( ) ; public static final char [ ] DoubleConstrSignature = "(D)V" . toCharArray ( ) ; public static final char [ ] doubleDoubleSignature = "" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_NAME = "doubleValue" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "()D" . toCharArray ( ) ; public static final char [ ] Exit = "exit" . toCharArray ( ) ; public static final char [ ] ExitIntSignature = "(I)V" . toCharArray ( ) ; public static final char [ ] FloatConstrSignature = "(F)V" . toCharArray ( ) ; public static final char [ ] floatFloatSignature = "" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_NAME = "floatValue" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "()F" . toCharArray ( ) ; public static final char [ ] ForName = "forName" . toCharArray ( ) ; public static final char [ ] ForNameSignature = "" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_NAME = "getBoolean" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_NAME = "getByte" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_NAME = "getChar" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_NAME = "getDouble" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_NAME = "getFloat" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_NAME = "getInt" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_NAME = "getLong" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_NAME = "get" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_NAME = "getShort" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GetClass = "getClass" . toCharArray ( ) ; public static final char [ ] GetClassSignature = "" . toCharArray ( ) ; public static final char [ ] GetComponentType = "" . toCharArray ( ) ; public static final char [ ] GetComponentTypeSignature = GetClassSignature ; public static final char [ ] GetConstructor = "" . toCharArray ( ) ; public static final char [ ] GetConstructorSignature = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_NAME = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_NAME = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_NAME = "" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] GetMessage = "getMessage" . toCharArray ( ) ; public static final char [ ] GetMessageSignature = "" . toCharArray ( ) ; public static final char [ ] HasNext = "hasNext" . toCharArray ( ) ; public static final char [ ] HasNextSignature = "()Z" . toCharArray ( ) ; public static final char [ ] Init = "<init>" . toCharArray ( ) ; public static final char [ ] IntConstrSignature = "(I)V" . toCharArray ( ) ; public static final char [ ] ITERATOR_NAME = "iterator" . toCharArray ( ) ; public static final char [ ] ITERATOR_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] Intern = "intern" . toCharArray ( ) ; public static final char [ ] InternSignature = GetMessageSignature ; public static final char [ ] IntIntegerSignature = "" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_NAME = "intValue" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_SIGNATURE = "()I" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_NAME = "invoke" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "" . toCharArray ( ) } ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ARRAY = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "Array" . toCharArray ( ) } ; public static final char [ ] JavaIoPrintStreamSignature = "" . toCharArray ( ) ; public static final char [ ] JavaLangAssertionErrorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangBooleanConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangByteConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangCharacterConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangClassConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangClassNotFoundExceptionConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangClassSignature = "" . toCharArray ( ) ; public static final char [ ] JavaLangDoubleConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangEnumConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangErrorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangExceptionConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangFloatConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangIntegerConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangLongConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangNoClassDefFoundErrorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangNoSuchFieldErrorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangObjectConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorNewInstanceSignature = "" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "" . toCharArray ( ) ; public static final char [ ] JavaLangShortConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangStringBufferConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangStringBuilderConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangStringConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangStringSignature = "" . toCharArray ( ) ; public static final char [ ] JavaLangObjectSignature = "" . toCharArray ( ) ; public static final char [ ] JavaLangSystemConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangThrowableConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaLangVoidConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] JavaUtilIteratorConstantPoolName = "" . toCharArray ( ) ; public static final char [ ] LongConstrSignature = "(J)V" . toCharArray ( ) ; public static final char [ ] longLongSignature = "" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_NAME = "longValue" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_SIGNATURE = "()J" . toCharArray ( ) ; public static final char [ ] NewInstance = "newInstance" . toCharArray ( ) ; public static final char [ ] NewInstanceSignature = "" . toCharArray ( ) ; public static final char [ ] Next = "next" . toCharArray ( ) ; public static final char [ ] NextSignature = "" . toCharArray ( ) ; public static final char [ ] ObjectConstrSignature = "" . toCharArray ( ) ; public static final char [ ] ObjectSignature = "" . 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 = "" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_NAME = "setByte" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_NAME = "setChar" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_NAME = "setDouble" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_NAME = "setFloat" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_NAME = "setInt" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_NAME = "setLong" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_NAME = "set" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_NAME = "setShort" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_SIGNATURE = "" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_NAME = "" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_SIGNATURE = "(Z)V" . toCharArray ( ) ; public static final char [ ] ShortConstrSignature = "(S)V" . toCharArray ( ) ; public static final char [ ] shortShortSignature = "" . 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 = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendCharSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendDoubleSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendFloatSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendIntSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendLongSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendObjectSignature = "" . toCharArray ( ) ; public static final char [ ] StringBufferAppendStringSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendBooleanSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendCharSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendDoubleSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendFloatSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendIntSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendLongSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendObjectSignature = "" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendStringSignature = "" . toCharArray ( ) ; public static final char [ ] StringConstructorSignature = "" . toCharArray ( ) ; public static final char [ ] This = "this" . toCharArray ( ) ; public static final char [ ] ToString = "toString" . toCharArray ( ) ; public static final char [ ] ToStringSignature = GetMessageSignature ; public static final char [ ] TYPE = "TYPE" . toCharArray ( ) ; public static final char [ ] ValueOf = "valueOf" . toCharArray ( ) ; public static final char [ ] ValueOfBooleanSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfCharSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfDoubleSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfFloatSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfIntSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfLongSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfObjectSignature = "" . toCharArray ( ) ; public static final char [ ] ValueOfStringClassSignature = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTION = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_TARGET = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_DEPRECATED = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_INHERITED = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_SAFEVARARGS = "" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "" . toCharArray ( ) ; public static final char [ ] HashCode = "hashCode" . toCharArray ( ) ; public static final char [ ] HashCodeSignature = "()I" . toCharArray ( ) ; public static final char [ ] Equals = "equals" . toCharArray ( ) ; public static final char [ ] EqualsSignature = "" . toCharArray ( ) ; public static final char [ ] AddSuppressed = "" . toCharArray ( ) ; public static final char [ ] AddSuppressedSignature = "" . toCharArray ( ) ; public ConstantPool ( ClassFile classFile ) { this . UTF8Cache = new CharArrayCache ( UTF8_INITIAL_SIZE ) ; this . stringCache = new CharArrayCache ( STRING_INITIAL_SIZE ) ; this . methodsAndFieldsCache = new HashtableOfObject ( METHODS_AND_FIELDS_INITIAL_SIZE ) ; this . classCache = new CharArrayCache ( CLASS_INITIAL_SIZE ) ; this . nameAndTypeCacheForFieldsAndMethods = new HashtableOfObject ( NAMEANDTYPE_INITIAL_SIZE ) ; this . offsets = new int [ 5 ] ; initialize ( classFile ) ; } public void initialize ( ClassFile givenClassFile ) { this . poolContent = givenClassFile . header ; this . currentOffset = givenClassFile . headerOffset ; this . currentIndex = 1 ; this . classFile = givenClassFile ; } public byte [ ] dumpBytes ( ) { System . arraycopy ( this . poolContent , 0 , ( this . poolContent = new byte [ this . currentOffset ] ) , 0 , this . currentOffset ) ; return this . poolContent ; } public int literalIndex ( byte [ ] utf8encoding , char [ ] stringCharArray ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int utf8encodingLength = utf8encoding . length ; if ( this . currentOffset + 2 + utf8encodingLength >= this . poolContent . length ) { resizePoolContents ( 2 + utf8encodingLength ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( utf8encodingLength >> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) utf8encodingLength ; System . arraycopy ( utf8encoding , 0 , this . poolContent , this . currentOffset , utf8encodingLength ) ; this . currentOffset += utf8encodingLength ; } return index ; } public int literalIndex ( TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != 0 ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return literalIndex ( binding . signature ( ) ) ; } public int literalIndex ( char [ ] utf8Constant ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( utf8Constant , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int savedCurrentOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; length = 0 ; for ( int i = 0 ; i < utf8Constant . length ; i ++ ) { char current = utf8Constant [ i ] ; if ( ( current >= 0x0001 ) && ( current <= 0x007F ) ) { writeU1 ( current ) ; length ++ ; } else { if ( current > 0x07FF ) { length += 3 ; writeU1 ( 0xE0 | ( ( current >> 12 ) & 0x0F ) ) ; writeU1 ( 0x80 | ( ( current >> 6 ) & 0x3F ) ) ; writeU1 ( 0x80 | ( current & 0x3F ) ) ; } else { length += 2 ; writeU1 ( 0xC0 | ( ( current >> 6 ) & 0x1F ) ) ; writeU1 ( 0x80 | ( current & 0x3F ) ) ; } } } if ( length >= 65535 ) { this . currentOffset = savedCurrentOffset - 1 ; this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceForConstant ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } if ( index > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; this . poolContent [ savedCurrentOffset ] = ( byte ) ( length >> 8 ) ; this . poolContent [ savedCurrentOffset + 1 ] = ( byte ) length ; } return index ; } public int literalIndex ( char [ ] stringCharArray , byte [ ] utf8encoding ) { int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; final int stringIndex = literalIndex ( utf8encoding , stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex >> 8 ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndex ( double key ) { int index ; if ( this . doubleCache == null ) { this . doubleCache = new DoubleCache ( DOUBLE_INITIAL_SIZE ) ; } if ( ( index = this . doubleCache . putIfAbsent ( key , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += 2 ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( DoubleTag ) ; long temp = java . lang . Double . doubleToLongBits ( key ) ; length = this . poolContent . length ; if ( this . currentOffset + 8 >= length ) { resizePoolContents ( 8 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 56 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 48 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 40 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 32 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 24 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 16 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( float key ) { int index ; if ( this . floatCache == null ) { this . floatCache = new FloatCache ( FLOAT_INITIAL_SIZE ) ; } if ( ( index = this . floatCache . putIfAbsent ( key , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FloatTag ) ; int temp = java . lang . Float . floatToIntBits ( key ) ; if ( this . currentOffset + 4 >= this . poolContent . length ) { resizePoolContents ( 4 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 24 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 16 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp >>> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( int key ) { int index ; if ( this . intCache == null ) { this . intCache = new IntegerCache ( INT_INITIAL_SIZE ) ; } if ( ( index = this . intCache . putIfAbsent ( key , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( IntegerTag ) ; if ( this . currentOffset + 4 >= this . poolContent . length ) { resizePoolContents ( 4 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 24 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 16 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( long key ) { int index ; if ( this . longCache == null ) { this . longCache = new LongCache ( LONG_INITIAL_SIZE ) ; } if ( ( index = this . longCache . putIfAbsent ( key , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += 2 ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( LongTag ) ; if ( this . currentOffset + 8 >= this . poolContent . length ) { resizePoolContents ( 8 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 56 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 48 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 40 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 32 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 24 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 16 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key >>> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( String stringConstant ) { int index ; char [ ] stringCharArray = stringConstant . toCharArray ( ) ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; final int stringIndex = literalIndex ( stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex >> 8 ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndexForType ( final char [ ] constantPoolName ) { int index ; if ( ( index = this . classCache . putIfAbsent ( constantPoolName , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( ClassTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; final int nameIndex = literalIndex ( constantPoolName ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex >> 8 ) ; this . poolContent [ nameIndexOffset ] = ( byte ) nameIndex ; } return index ; } public int literalIndexForType ( final TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != 0 ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return this . literalIndexForType ( binding . constantPoolName ( ) ) ; } public int literalIndexForMethod ( char [ ] declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , selector , signature , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( isInterface ? InterfaceMethodRefTag : MethodRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + 4 >= this . poolContent . length ) { resizePoolContents ( 4 ) ; } this . currentOffset += 4 ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( selector , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex >> 8 ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex >> 8 ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForMethod ( TypeBinding declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != 0 ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } return this . literalIndexForMethod ( declaringClass . constantPoolName ( ) , selector , signature , isInterface ) ; } public int literalIndexForNameAndType ( char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInNameAndTypeCacheIfAbsent ( name , signature , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( NameAndTypeTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + 4 >= this . poolContent . length ) { resizePoolContents ( 4 ) ; } this . currentOffset += 4 ; final int nameIndex = literalIndex ( name ) ; final int typeIndex = literalIndex ( signature ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex >> 8 ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) nameIndex ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( typeIndex >> 8 ) ; this . poolContent [ nameIndexOffset ] = ( byte ) typeIndex ; } return index ; } public int literalIndexForField ( char [ ] declaringClass , char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , name , signature , this . currentIndex ) ) < 0 ) { this . currentIndex ++ ; if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FieldRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + 4 >= this . poolContent . length ) { resizePoolContents ( 4 ) ; } this . currentOffset += 4 ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( name , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex >> 8 ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex >> 8 ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForLdc ( char [ ] stringCharArray ) { int savedCurrentIndex = this . currentIndex ; int savedCurrentOffset = this . currentOffset ; int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < 0 ) { if ( ( index = - index ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ index * 2 ] ) , 0 , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; int stringIndex ; if ( ( stringIndex = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < 0 ) { if ( ( stringIndex = - stringIndex ) > 0xFFFF ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; length = this . offsets . length ; if ( length <= stringIndex ) { System . arraycopy ( this . offsets , 0 , ( this . offsets = new int [ stringIndex * 2 ] ) , 0 , length ) ; } this . offsets [ stringIndex ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int lengthOffset = this . currentOffset ; if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . currentOffset += 2 ; length = 0 ; for ( int i = 0 ; i < stringCharArray . length ; i ++ ) { char current = stringCharArray [ i ] ; if ( ( current >= 0x0001 ) && ( current <= 0x007F ) ) { length ++ ; if ( this . currentOffset + 1 >= this . poolContent . length ) { resizePoolContents ( 1 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( current ) ; } else if ( current > 0x07FF ) { length += 3 ; if ( this . currentOffset + 3 >= this . poolContent . length ) { resizePoolContents ( 3 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( 0xE0 | ( ( current >> 12 ) & 0x0F ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( 0x80 | ( ( current >> 6 ) & 0x3F ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( 0x80 | ( current & 0x3F ) ) ; } else { if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } length += 2 ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( 0xC0 | ( ( current >> 6 ) & 0x1F ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( 0x80 | ( current & 0x3F ) ) ; } } if ( length >= 65535 ) { this . currentOffset = savedCurrentOffset ; this . currentIndex = savedCurrentIndex ; this . stringCache . remove ( stringCharArray ) ; this . UTF8Cache . remove ( stringCharArray ) ; return 0 ; } this . poolContent [ lengthOffset ++ ] = ( byte ) ( length >> 8 ) ; this . poolContent [ lengthOffset ] = ( byte ) length ; } this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex >> 8 ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } private int putInNameAndTypeCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , int value ) { int index ; Object key1Value = this . nameAndTypeCacheForFieldsAndMethods . get ( key1 ) ; if ( key1Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key2 , value ) ; index = - value ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , cachedIndexEntry ) ; } else if ( key1Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key1Value ; if ( CharOperation . equals ( key2 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key2 , value ) ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key1Value ; index = charArrayCache . putIfAbsent ( key2 , value ) ; } return index ; } private int putInCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , final char [ ] key3 , int value ) { int index ; HashtableOfObject key1Value = ( HashtableOfObject ) this . methodsAndFieldsCache . get ( key1 ) ; if ( key1Value == null ) { key1Value = new HashtableOfObject ( ) ; this . methodsAndFieldsCache . put ( key1 , key1Value ) ; CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else { Object key2Value = key1Value . get ( key2 ) ; if ( key2Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else if ( key2Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key2Value ; if ( CharOperation . equals ( key3 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key3 , value ) ; key1Value . put ( key2 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key2Value ; index = charArrayCache . putIfAbsent ( key3 , value ) ; } } return index ; } public void resetForClinit ( int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( AttributeNamesConstants . CodeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( AttributeNamesConstants . CodeName ) ; } if ( this . UTF8Cache . get ( ConstantPool . ClinitSignature ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . ClinitSignature ) ; } if ( this . UTF8Cache . get ( ConstantPool . Clinit ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . Clinit ) ; } } private final void resizePoolContents ( int minimalSize ) { int length = this . poolContent . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . poolContent , 0 , this . poolContent = new byte [ length + toAdd ] , 0 , length ) ; } protected final void writeU1 ( int value ) { if ( this . currentOffset + 1 >= this . poolContent . length ) { resizePoolContents ( 1 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } protected final void writeU2 ( int value ) { if ( this . currentOffset + 2 >= this . poolContent . length ) { resizePoolContents ( 2 ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( value >>> 8 ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } public void reset ( ) { if ( this . doubleCache != null ) this . doubleCache . clear ( ) ; if ( this . floatCache != null ) this . floatCache . clear ( ) ; if ( this . intCache != null ) this . intCache . clear ( ) ; if ( this . longCache != null ) this . longCache . clear ( ) ; this . UTF8Cache . clear ( ) ; this . stringCache . clear ( ) ; this . methodsAndFieldsCache . clear ( ) ; this . classCache . clear ( ) ; this . nameAndTypeCacheForFieldsAndMethods . clear ( ) ; this . currentIndex = 1 ; this . currentOffset = 0 ; } public void resetForAttributeName ( char [ ] attributeName , int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( attributeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( attributeName ) ; } } } </s>