Upgrade to ASM master (including early support for Java 23 bytecode)
Closes gh-31929
This commit is contained in:
parent
243ec88e95
commit
174eae377f
|
@ -144,7 +144,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||||
// Write type_index and reserve space for num_element_value_pairs.
|
// Write type_index and reserve space for num_element_value_pairs.
|
||||||
annotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
annotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
||||||
return new AnnotationWriter(
|
return new AnnotationWriter(
|
||||||
symbolTable, /* useNamedValues = */ true, annotation, previousAnnotation);
|
symbolTable, /* useNamedValues= */ true, annotation, previousAnnotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -179,7 +179,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||||
// Write type_index and reserve space for num_element_value_pairs.
|
// Write type_index and reserve space for num_element_value_pairs.
|
||||||
typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
||||||
return new AnnotationWriter(
|
return new AnnotationWriter(
|
||||||
symbolTable, /* useNamedValues = */ true, typeAnnotation, previousAnnotation);
|
symbolTable, /* useNamedValues= */ true, typeAnnotation, previousAnnotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
@ -284,7 +284,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||||
}
|
}
|
||||||
// Write tag and type_index, and reserve 2 bytes for num_element_value_pairs.
|
// Write tag and type_index, and reserve 2 bytes for num_element_value_pairs.
|
||||||
annotation.put12('@', symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
annotation.put12('@', symbolTable.addConstantUtf8(descriptor)).putShort(0);
|
||||||
return new AnnotationWriter(symbolTable, /* useNamedValues = */ true, annotation, null);
|
return new AnnotationWriter(symbolTable, /* useNamedValues= */ true, annotation, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -303,7 +303,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||||
// visit the array elements. Its num_element_value_pairs will correspond to the number of array
|
// visit the array elements. Its num_element_value_pairs will correspond to the number of array
|
||||||
// elements and will be stored in what is in fact num_values.
|
// elements and will be stored in what is in fact num_values.
|
||||||
annotation.put12('[', 0);
|
annotation.put12('[', 0);
|
||||||
return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, annotation, null);
|
return new AnnotationWriter(symbolTable, /* useNamedValues= */ false, annotation, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -177,7 +177,7 @@ public class ClassReader {
|
||||||
final byte[] classFileBuffer,
|
final byte[] classFileBuffer,
|
||||||
final int classFileOffset,
|
final int classFileOffset,
|
||||||
final int classFileLength) { // NOPMD(UnusedFormalParameter) used for backward compatibility.
|
final int classFileLength) { // NOPMD(UnusedFormalParameter) used for backward compatibility.
|
||||||
this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true);
|
this(classFileBuffer, classFileOffset, /* checkClassVersion= */ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,7 +194,7 @@ public class ClassReader {
|
||||||
this.b = classFileBuffer;
|
this.b = classFileBuffer;
|
||||||
// Check the class' major_version. This field is after the magic and minor_version fields, which
|
// Check the class' major_version. This field is after the magic and minor_version fields, which
|
||||||
// use 4 and 2 bytes respectively.
|
// use 4 and 2 bytes respectively.
|
||||||
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V22) {
|
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V23) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Unsupported class file major version " + readShort(classFileOffset + 6));
|
"Unsupported class file major version " + readShort(classFileOffset + 6));
|
||||||
}
|
}
|
||||||
|
@ -608,9 +608,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
|
classVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -626,9 +626,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
|
classVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -650,9 +650,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -674,9 +674,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -968,9 +968,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
|
recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -986,9 +986,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
|
recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1010,9 +1010,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1034,9 +1034,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1152,9 +1152,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
|
fieldVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1170,9 +1170,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
|
fieldVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1194,9 +1194,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1218,9 +1218,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1413,9 +1413,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true),
|
methodVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1431,9 +1431,9 @@ public class ClassReader {
|
||||||
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
// Parse num_element_value_pairs and element_value_pairs and visit these values.
|
||||||
currentAnnotationOffset =
|
currentAnnotationOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false),
|
methodVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1455,9 +1455,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1479,9 +1479,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1489,16 +1489,13 @@ public class ClassReader {
|
||||||
// Visit the RuntimeVisibleParameterAnnotations attribute.
|
// Visit the RuntimeVisibleParameterAnnotations attribute.
|
||||||
if (runtimeVisibleParameterAnnotationsOffset != 0) {
|
if (runtimeVisibleParameterAnnotationsOffset != 0) {
|
||||||
readParameterAnnotations(
|
readParameterAnnotations(
|
||||||
methodVisitor, context, runtimeVisibleParameterAnnotationsOffset, /* visible = */ true);
|
methodVisitor, context, runtimeVisibleParameterAnnotationsOffset, /* visible= */ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Visit the RuntimeInvisibleParameterAnnotations attribute.
|
// Visit the RuntimeInvisibleParameterAnnotations attribute.
|
||||||
if (runtimeInvisibleParameterAnnotationsOffset != 0) {
|
if (runtimeInvisibleParameterAnnotationsOffset != 0) {
|
||||||
readParameterAnnotations(
|
readParameterAnnotations(
|
||||||
methodVisitor,
|
methodVisitor, context, runtimeInvisibleParameterAnnotationsOffset, /* visible= */ false);
|
||||||
context,
|
|
||||||
runtimeInvisibleParameterAnnotationsOffset,
|
|
||||||
/* visible = */ false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Visit the non standard attributes.
|
// Visit the non standard attributes.
|
||||||
|
@ -1927,7 +1924,7 @@ public class ClassReader {
|
||||||
}
|
}
|
||||||
} else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
|
} else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
|
||||||
visibleTypeAnnotationOffsets =
|
visibleTypeAnnotationOffsets =
|
||||||
readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ true);
|
readTypeAnnotations(methodVisitor, context, currentOffset, /* visible= */ true);
|
||||||
// Here we do not extract the labels corresponding to the attribute content. This would
|
// Here we do not extract the labels corresponding to the attribute content. This would
|
||||||
// require a full parsing of the attribute, which would need to be repeated when parsing
|
// require a full parsing of the attribute, which would need to be repeated when parsing
|
||||||
// the bytecode instructions (see below). Instead, the content of the attribute is read one
|
// the bytecode instructions (see below). Instead, the content of the attribute is read one
|
||||||
|
@ -1936,7 +1933,7 @@ public class ClassReader {
|
||||||
// time. This assumes that type annotations are ordered by increasing bytecode offset.
|
// time. This assumes that type annotations are ordered by increasing bytecode offset.
|
||||||
} else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
|
} else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) {
|
||||||
invisibleTypeAnnotationOffsets =
|
invisibleTypeAnnotationOffsets =
|
||||||
readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ false);
|
readTypeAnnotations(methodVisitor, context, currentOffset, /* visible= */ false);
|
||||||
// Same comment as above for the RuntimeVisibleTypeAnnotations attribute.
|
// Same comment as above for the RuntimeVisibleTypeAnnotations attribute.
|
||||||
} else if (Constants.STACK_MAP_TABLE.equals(attributeName)) {
|
} else if (Constants.STACK_MAP_TABLE.equals(attributeName)) {
|
||||||
if ((context.parsingOptions & SKIP_FRAMES) == 0) {
|
if ((context.parsingOptions & SKIP_FRAMES) == 0) {
|
||||||
|
@ -2518,9 +2515,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
currentVisibleTypeAnnotationBytecodeOffset =
|
currentVisibleTypeAnnotationBytecodeOffset =
|
||||||
|
@ -2546,9 +2543,9 @@ public class ClassReader {
|
||||||
context.currentTypeAnnotationTarget,
|
context.currentTypeAnnotationTarget,
|
||||||
context.currentTypeAnnotationTargetPath,
|
context.currentTypeAnnotationTargetPath,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentAnnotationOffset,
|
currentAnnotationOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
currentInvisibleTypeAnnotationBytecodeOffset =
|
currentInvisibleTypeAnnotationBytecodeOffset =
|
||||||
|
@ -2619,9 +2616,9 @@ public class ClassReader {
|
||||||
context.currentLocalVariableAnnotationRangeEnds,
|
context.currentLocalVariableAnnotationRangeEnds,
|
||||||
context.currentLocalVariableAnnotationRangeIndices,
|
context.currentLocalVariableAnnotationRangeIndices,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ true),
|
/* visible= */ true),
|
||||||
currentOffset,
|
currentOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2647,9 +2644,9 @@ public class ClassReader {
|
||||||
context.currentLocalVariableAnnotationRangeEnds,
|
context.currentLocalVariableAnnotationRangeEnds,
|
||||||
context.currentLocalVariableAnnotationRangeIndices,
|
context.currentLocalVariableAnnotationRangeIndices,
|
||||||
annotationDescriptor,
|
annotationDescriptor,
|
||||||
/* visible = */ false),
|
/* visible= */ false),
|
||||||
currentOffset,
|
currentOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2827,7 +2824,7 @@ public class ClassReader {
|
||||||
methodVisitor.visitTryCatchAnnotation(
|
methodVisitor.visitTryCatchAnnotation(
|
||||||
targetType & 0xFFFFFF00, path, annotationDescriptor, visible),
|
targetType & 0xFFFFFF00, path, annotationDescriptor, visible),
|
||||||
currentOffset,
|
currentOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
} else {
|
} else {
|
||||||
// We don't want to visit the other target_type annotations, so we just skip them (which
|
// We don't want to visit the other target_type annotations, so we just skip them (which
|
||||||
|
@ -2838,7 +2835,7 @@ public class ClassReader {
|
||||||
// with a null AnnotationVisitor).
|
// with a null AnnotationVisitor).
|
||||||
currentOffset =
|
currentOffset =
|
||||||
readElementValues(
|
readElementValues(
|
||||||
/* annotationVisitor = */ null, currentOffset, /* named = */ true, charBuffer);
|
/* annotationVisitor= */ null, currentOffset, /* named= */ true, charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return typeAnnotationsOffsets;
|
return typeAnnotationsOffsets;
|
||||||
|
@ -2978,7 +2975,7 @@ public class ClassReader {
|
||||||
readElementValues(
|
readElementValues(
|
||||||
methodVisitor.visitParameterAnnotation(i, annotationDescriptor, visible),
|
methodVisitor.visitParameterAnnotation(i, annotationDescriptor, visible),
|
||||||
currentOffset,
|
currentOffset,
|
||||||
/* named = */ true,
|
/* named= */ true,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3048,9 +3045,9 @@ public class ClassReader {
|
||||||
case 'e': // enum_const_value
|
case 'e': // enum_const_value
|
||||||
return currentOffset + 5;
|
return currentOffset + 5;
|
||||||
case '@': // annotation_value
|
case '@': // annotation_value
|
||||||
return readElementValues(null, currentOffset + 3, /* named = */ true, charBuffer);
|
return readElementValues(null, currentOffset + 3, /* named= */ true, charBuffer);
|
||||||
case '[': // array_value
|
case '[': // array_value
|
||||||
return readElementValues(null, currentOffset + 1, /* named = */ false, charBuffer);
|
return readElementValues(null, currentOffset + 1, /* named= */ false, charBuffer);
|
||||||
default:
|
default:
|
||||||
return currentOffset + 3;
|
return currentOffset + 3;
|
||||||
}
|
}
|
||||||
|
@ -3118,7 +3115,7 @@ public class ClassReader {
|
||||||
return readElementValues(
|
return readElementValues(
|
||||||
annotationVisitor.visitArray(elementName),
|
annotationVisitor.visitArray(elementName),
|
||||||
currentOffset - 2,
|
currentOffset - 2,
|
||||||
/* named = */ false,
|
/* named= */ false,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
}
|
}
|
||||||
switch (classFileBuffer[currentOffset] & 0xFF) {
|
switch (classFileBuffer[currentOffset] & 0xFF) {
|
||||||
|
@ -3195,7 +3192,7 @@ public class ClassReader {
|
||||||
readElementValues(
|
readElementValues(
|
||||||
annotationVisitor.visitArray(elementName),
|
annotationVisitor.visitArray(elementName),
|
||||||
currentOffset - 2,
|
currentOffset - 2,
|
||||||
/* named = */ false,
|
/* named= */ false,
|
||||||
charBuffer);
|
charBuffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -774,7 +774,7 @@ public class ClassWriter extends ClassVisitor {
|
||||||
lastRecordComponent = null;
|
lastRecordComponent = null;
|
||||||
firstAttribute = null;
|
firstAttribute = null;
|
||||||
compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_FRAMES : MethodWriter.COMPUTE_NOTHING;
|
compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_FRAMES : MethodWriter.COMPUTE_NOTHING;
|
||||||
new ClassReader(classFile, 0, /* checkClassVersion = */ false)
|
new ClassReader(classFile, 0, /* checkClassVersion= */ false)
|
||||||
.accept(
|
.accept(
|
||||||
this,
|
this,
|
||||||
attributes,
|
attributes,
|
||||||
|
|
|
@ -651,7 +651,7 @@ final class MethodWriter extends MethodVisitor {
|
||||||
@Override
|
@Override
|
||||||
public AnnotationVisitor visitAnnotationDefault() {
|
public AnnotationVisitor visitAnnotationDefault() {
|
||||||
defaultValue = new ByteVector();
|
defaultValue = new ByteVector();
|
||||||
return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, defaultValue, null);
|
return new AnnotationWriter(symbolTable, /* useNamedValues= */ false, defaultValue, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1519,14 +1519,14 @@ final class MethodWriter extends MethodVisitor {
|
||||||
return lastCodeRuntimeVisibleTypeAnnotation =
|
return lastCodeRuntimeVisibleTypeAnnotation =
|
||||||
new AnnotationWriter(
|
new AnnotationWriter(
|
||||||
symbolTable,
|
symbolTable,
|
||||||
/* useNamedValues = */ true,
|
/* useNamedValues= */ true,
|
||||||
typeAnnotation,
|
typeAnnotation,
|
||||||
lastCodeRuntimeVisibleTypeAnnotation);
|
lastCodeRuntimeVisibleTypeAnnotation);
|
||||||
} else {
|
} else {
|
||||||
return lastCodeRuntimeInvisibleTypeAnnotation =
|
return lastCodeRuntimeInvisibleTypeAnnotation =
|
||||||
new AnnotationWriter(
|
new AnnotationWriter(
|
||||||
symbolTable,
|
symbolTable,
|
||||||
/* useNamedValues = */ true,
|
/* useNamedValues= */ true,
|
||||||
typeAnnotation,
|
typeAnnotation,
|
||||||
lastCodeRuntimeInvisibleTypeAnnotation);
|
lastCodeRuntimeInvisibleTypeAnnotation);
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,6 +287,7 @@ public interface Opcodes {
|
||||||
int V20 = 0 << 16 | 64;
|
int V20 = 0 << 16 | 64;
|
||||||
int V21 = 0 << 16 | 65;
|
int V21 = 0 << 16 | 65;
|
||||||
int V22 = 0 << 16 | 66;
|
int V22 = 0 << 16 | 66;
|
||||||
|
int V23 = 0 << 16 | 67;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version flag indicating that the class is using 'preview' features.
|
* Version flag indicating that the class is using 'preview' features.
|
||||||
|
|
|
@ -1414,23 +1414,23 @@ final class SymbolTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry(final int index, final int tag, final String value, final int hashCode) {
|
Entry(final int index, final int tag, final String value, final int hashCode) {
|
||||||
super(index, tag, /* owner = */ null, /* name = */ null, value, /* data = */ 0);
|
super(index, tag, /* owner= */ null, /* name= */ null, value, /* data= */ 0);
|
||||||
this.hashCode = hashCode;
|
this.hashCode = hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry(final int index, final int tag, final String value, final long data, final int hashCode) {
|
Entry(final int index, final int tag, final String value, final long data, final int hashCode) {
|
||||||
super(index, tag, /* owner = */ null, /* name = */ null, value, data);
|
super(index, tag, /* owner= */ null, /* name= */ null, value, data);
|
||||||
this.hashCode = hashCode;
|
this.hashCode = hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry(
|
Entry(
|
||||||
final int index, final int tag, final String name, final String value, final int hashCode) {
|
final int index, final int tag, final String name, final String value, final int hashCode) {
|
||||||
super(index, tag, /* owner = */ null, name, value, /* data = */ 0);
|
super(index, tag, /* owner= */ null, name, value, /* data= */ 0);
|
||||||
this.hashCode = hashCode;
|
this.hashCode = hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry(final int index, final int tag, final long data, final int hashCode) {
|
Entry(final int index, final int tag, final long data, final int hashCode) {
|
||||||
super(index, tag, /* owner = */ null, /* name = */ null, /* value = */ null, data);
|
super(index, tag, /* owner= */ null, /* name= */ null, /* value= */ null, data);
|
||||||
this.hashCode = hashCode;
|
this.hashCode = hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue