@@ -99,6 +99,7 @@ public class ClassReader {
9999 * necessarily start at offset 0. Use {@link #getItem} and {@link #header} to get correct
100100 * ClassFile element offsets within this byte array.
101101 */
102+ // DontCheck(MemberName): can't be renamed (for backward binary compatibility).
102103 public final byte [] b ;
103104
104105 /**
@@ -488,7 +489,7 @@ public void accept(
488489 accessFlags |= Opcodes .ACC_SYNTHETIC ;
489490 } else if (Constants .SOURCE_DEBUG_EXTENSION .equals (attributeName )) {
490491 sourceDebugExtension =
491- readUTF (currentAttributeOffset , attributeLength , new char [attributeLength ]);
492+ readUtf (currentAttributeOffset , attributeLength , new char [attributeLength ]);
492493 } else if (Constants .RUNTIME_INVISIBLE_ANNOTATIONS .equals (attributeName )) {
493494 runtimeInvisibleAnnotationsOffset = currentAttributeOffset ;
494495 } else if (Constants .RUNTIME_INVISIBLE_TYPE_ANNOTATIONS .equals (attributeName )) {
@@ -530,7 +531,8 @@ public void accept(
530531
531532 // Visit the Module, ModulePackages and ModuleMainClass attributes.
532533 if (moduleOffset != 0 ) {
533- readModule (classVisitor , context , moduleOffset , modulePackagesOffset , moduleMainClass );
534+ readModuleAttributes (
535+ classVisitor , context , moduleOffset , modulePackagesOffset , moduleMainClass );
534536 }
535537
536538 // Visit the NestHost attribute.
@@ -685,7 +687,7 @@ public void accept(
685687 // ----------------------------------------------------------------------------------------------
686688
687689 /**
688- * Reads the module attribute and visit it .
690+ * Reads the Module, ModulePackages and ModuleMainClass attributes and visit them .
689691 *
690692 * @param classVisitor the current class visitor
691693 * @param context information about the class being parsed.
@@ -695,7 +697,7 @@ public void accept(
695697 * attribute_info's attribute_name_index and attribute_length fields), or 0.
696698 * @param moduleMainClass the string corresponding to the ModuleMainClass attribute, or null.
697699 */
698- private void readModule (
700+ private void readModuleAttributes (
699701 final ClassVisitor classVisitor ,
700702 final Context context ,
701703 final int moduleOffset ,
@@ -1111,7 +1113,7 @@ private int readMethod(
11111113 context .currentMethodAccessFlags ,
11121114 context .currentMethodName ,
11131115 context .currentMethodDescriptor ,
1114- signatureIndex == 0 ? null : readUTF (signatureIndex , charBuffer ),
1116+ signatureIndex == 0 ? null : readUtf (signatureIndex , charBuffer ),
11151117 exceptions );
11161118 if (methodVisitor == null ) {
11171119 return currentOffset ;
@@ -1601,18 +1603,15 @@ private void readCode(
16011603
16021604 // Read the 'exception_table_length' and 'exception_table' field to create a label for each
16031605 // referenced instruction, and to make methodVisitor visit the corresponding try catch blocks.
1604- {
1605- int exceptionTableLength = readUnsignedShort (currentOffset );
1606- currentOffset += 2 ;
1607- while (exceptionTableLength -- > 0 ) {
1608- Label start = createLabel (readUnsignedShort (currentOffset ), labels );
1609- Label end = createLabel (readUnsignedShort (currentOffset + 2 ), labels );
1610- Label handler = createLabel (readUnsignedShort (currentOffset + 4 ), labels );
1611- String catchType =
1612- readUTF8 (cpInfoOffsets [readUnsignedShort (currentOffset + 6 )], charBuffer );
1613- currentOffset += 8 ;
1614- methodVisitor .visitTryCatchBlock (start , end , handler , catchType );
1615- }
1606+ int exceptionTableLength = readUnsignedShort (currentOffset );
1607+ currentOffset += 2 ;
1608+ while (exceptionTableLength -- > 0 ) {
1609+ Label start = createLabel (readUnsignedShort (currentOffset ), labels );
1610+ Label end = createLabel (readUnsignedShort (currentOffset + 2 ), labels );
1611+ Label handler = createLabel (readUnsignedShort (currentOffset + 4 ), labels );
1612+ String catchType = readUTF8 (cpInfoOffsets [readUnsignedShort (currentOffset + 6 )], charBuffer );
1613+ currentOffset += 8 ;
1614+ methodVisitor .visitTryCatchBlock (start , end , handler , catchType );
16161615 }
16171616
16181617 // Read the Code attributes to create a label for each referenced instruction (the variables
@@ -2142,11 +2141,11 @@ private void readCode(
21422141 currentOffset += 4 - (currentBytecodeOffset & 3 );
21432142 // Read the instruction.
21442143 Label defaultLabel = labels [currentBytecodeOffset + readInt (currentOffset )];
2145- int nPairs = readInt (currentOffset + 4 );
2144+ int numPairs = readInt (currentOffset + 4 );
21462145 currentOffset += 8 ;
2147- int [] keys = new int [nPairs ];
2148- Label [] values = new Label [nPairs ];
2149- for (int i = 0 ; i < nPairs ; ++i ) {
2146+ int [] keys = new int [numPairs ];
2147+ Label [] values = new Label [numPairs ];
2148+ for (int i = 0 ; i < numPairs ; ++i ) {
21502149 keys [i ] = readInt (currentOffset );
21512150 values [i ] = labels [currentBytecodeOffset + readInt (currentOffset + 4 )];
21522151 currentOffset += 8 ;
@@ -2958,12 +2957,12 @@ private int readElementValue(
29582957 private void computeImplicitFrame (final Context context ) {
29592958 String methodDescriptor = context .currentMethodDescriptor ;
29602959 Object [] locals = context .currentFrameLocalTypes ;
2961- int nLocal = 0 ;
2960+ int numLocal = 0 ;
29622961 if ((context .currentMethodAccessFlags & Opcodes .ACC_STATIC ) == 0 ) {
29632962 if ("<init>" .equals (context .currentMethodName )) {
2964- locals [nLocal ++] = Opcodes .UNINITIALIZED_THIS ;
2963+ locals [numLocal ++] = Opcodes .UNINITIALIZED_THIS ;
29652964 } else {
2966- locals [nLocal ++] = readClass (header + 2 , context .charBuffer );
2965+ locals [numLocal ++] = readClass (header + 2 , context .charBuffer );
29672966 }
29682967 }
29692968 // Parse the method descriptor, one argument type descriptor at each iteration. Start by
@@ -2977,16 +2976,16 @@ private void computeImplicitFrame(final Context context) {
29772976 case 'B' :
29782977 case 'S' :
29792978 case 'I' :
2980- locals [nLocal ++] = Opcodes .INTEGER ;
2979+ locals [numLocal ++] = Opcodes .INTEGER ;
29812980 break ;
29822981 case 'F' :
2983- locals [nLocal ++] = Opcodes .FLOAT ;
2982+ locals [numLocal ++] = Opcodes .FLOAT ;
29842983 break ;
29852984 case 'J' :
2986- locals [nLocal ++] = Opcodes .LONG ;
2985+ locals [numLocal ++] = Opcodes .LONG ;
29872986 break ;
29882987 case 'D' :
2989- locals [nLocal ++] = Opcodes .DOUBLE ;
2988+ locals [numLocal ++] = Opcodes .DOUBLE ;
29902989 break ;
29912990 case '[' :
29922991 while (methodDescriptor .charAt (currentMethodDescritorOffset ) == '[' ) {
@@ -2998,20 +2997,20 @@ private void computeImplicitFrame(final Context context) {
29982997 ++currentMethodDescritorOffset ;
29992998 }
30002999 }
3001- locals [nLocal ++] =
3000+ locals [numLocal ++] =
30023001 methodDescriptor .substring (
30033002 currentArgumentDescriptorStartOffset , ++currentMethodDescritorOffset );
30043003 break ;
30053004 case 'L' :
30063005 while (methodDescriptor .charAt (currentMethodDescritorOffset ) != ';' ) {
30073006 ++currentMethodDescritorOffset ;
30083007 }
3009- locals [nLocal ++] =
3008+ locals [numLocal ++] =
30103009 methodDescriptor .substring (
30113010 currentArgumentDescriptorStartOffset + 1 , currentMethodDescritorOffset ++);
30123011 break ;
30133012 default :
3014- context .currentFrameLocalCount = nLocal ;
3013+ context .currentFrameLocalCount = numLocal ;
30153014 return ;
30163015 }
30173016 }
@@ -3178,7 +3177,11 @@ private int readVerificationTypeInfo(
31783177 // Methods to parse attributes
31793178 // ----------------------------------------------------------------------------------------------
31803179
3181- /** @return the offset in {@link #b} of the first ClassFile's 'attributes' array field entry. */
3180+ /**
3181+ * Returns the offset in {@link #b} of the first ClassFile's 'attributes' array field entry.
3182+ *
3183+ * @return the offset in {@link #b} of the first ClassFile's 'attributes' array field entry.
3184+ */
31823185 final int getFirstAttributeOffset () {
31833186 // Skip the access_flags, this_class, super_class, and interfaces_count fields (using 2 bytes
31843187 // each), as well as the interfaces array field (2 bytes per interface).
@@ -3399,12 +3402,13 @@ public long readLong(final int offset) {
33993402 * large. It is not automatically resized.
34003403 * @return the String corresponding to the specified CONSTANT_Utf8 entry.
34013404 */
3405+ // DontCheck(AbbreviationAsWordInName): can't be renamed (for backward binary compatibility).
34023406 public String readUTF8 (final int offset , final char [] charBuffer ) {
34033407 int constantPoolEntryIndex = readUnsignedShort (offset );
34043408 if (offset == 0 || constantPoolEntryIndex == 0 ) {
34053409 return null ;
34063410 }
3407- return readUTF (constantPoolEntryIndex , charBuffer );
3411+ return readUtf (constantPoolEntryIndex , charBuffer );
34083412 }
34093413
34103414 /**
@@ -3416,14 +3420,14 @@ public String readUTF8(final int offset, final char[] charBuffer) {
34163420 * large. It is not automatically resized.
34173421 * @return the String corresponding to the specified CONSTANT_Utf8 entry.
34183422 */
3419- final String readUTF (final int constantPoolEntryIndex , final char [] charBuffer ) {
3423+ final String readUtf (final int constantPoolEntryIndex , final char [] charBuffer ) {
34203424 String value = constantUtf8Values [constantPoolEntryIndex ];
34213425 if (value != null ) {
34223426 return value ;
34233427 }
34243428 int cpInfoOffset = cpInfoOffsets [constantPoolEntryIndex ];
34253429 return constantUtf8Values [constantPoolEntryIndex ] =
3426- readUTF (cpInfoOffset + 2 , readUnsignedShort (cpInfoOffset ), charBuffer );
3430+ readUtf (cpInfoOffset + 2 , readUnsignedShort (cpInfoOffset ), charBuffer );
34273431 }
34283432
34293433 /**
@@ -3435,7 +3439,7 @@ final String readUTF(final int constantPoolEntryIndex, final char[] charBuffer)
34353439 * large. It is not automatically resized.
34363440 * @return the String corresponding to the specified UTF8 string.
34373441 */
3438- private String readUTF (final int utfOffset , final int utfLength , final char [] charBuffer ) {
3442+ private String readUtf (final int utfOffset , final int utfLength , final char [] charBuffer ) {
34393443 int currentOffset = utfOffset ;
34403444 int endOffset = currentOffset + utfLength ;
34413445 int strLength = 0 ;
0 commit comments