/** * Returns the bytecode offset corresponding to the specified JVMS 'type_annotation' structure, or * -1 if there is no such type_annotation of if it does not have a bytecode offset. * * @param typeAnnotationOffsets the offset of each 'type_annotation' entry in a * Runtime[In]VisibleTypeAnnotations attribute, or null. * @param typeAnnotationIndex the index a 'type_annotation' entry in typeAnnotationOffsets. * @return bytecode offset corresponding to the specified JVMS 'type_annotation' structure, or -1 * if there is no such type_annotation of if it does not have a bytecode offset. */ private int getTypeAnnotationBytecodeOffset( final int[] typeAnnotationOffsets, final int typeAnnotationIndex) { if (typeAnnotationOffsets == null || typeAnnotationIndex >= typeAnnotationOffsets.length || readByte(typeAnnotationOffsets[typeAnnotationIndex]) < TypeReference.INSTANCEOF) { return -1; } return readUnsignedShort(typeAnnotationOffsets[typeAnnotationIndex] + 1); }
@Override protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { String hashAlgorithm = cr.readUTF8(off, buf); int count = cr.readUnsignedShort(off + 2); ArrayList<String> modules = new ArrayList<String>(count); ArrayList<byte[]> hashes = new ArrayList<byte[]>(count); off += 4; for (int i = 0; i < count; i++) { String module = cr.readModule(off, buf); int hashLength = cr.readUnsignedShort(off + 2); off += 4; byte[] hash = new byte[hashLength]; for (int j = 0; j < hashLength; j++) { hash[j] = (byte) (cr.readByte(off + j) & 0xff); } off += hashLength; modules.add(module); hashes.add(hash); } return new ModuleHashesAttribute(hashAlgorithm, modules, hashes); }
int pathLength = readByte(currentOffset); context.currentTypeAnnotationTargetPath = pathLength == 0 ? null : new TypePath(b, currentOffset);
return Type.getMethodType(readUTF8(cpInfoOffset, charBuffer)); case Symbol.CONSTANT_METHOD_HANDLE_TAG: int referenceKind = readByte(cpInfoOffset); int referenceCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 1)]; int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(referenceCpInfoOffset + 2)];
return Type.getMethodType(readUTF8(index, buf)); default: // case ClassWriter.HANDLE_BASE + [1..9]: int tag = readByte(index); int[] items = this.items; int cpIndex = items[readUnsignedShort(index + 1)];
break; int pathLength = readByte(u); context.typeRef = target; context.typePath = pathLength == 0 ? null : new TypePath(b, u);
int parametersCount = readByte(methodParametersOffset); int currentParameterOffset = methodParametersOffset + 1; while (parametersCount-- > 0) {
int pathLength = readByte(currentOffset); if ((targetType >>> 24) == TypeReference.EXCEPTION_PARAMETER) {
break; int pathLength = readByte(u); if ((target >>> 24) == 0x42) { TypePath path = pathLength == 0 ? null : new TypePath(b, u);
int fieldOrMethodRef = items[readUnsignedShort(index + 1)]; nameType = items[readUnsignedShort(fieldOrMethodRef + 2)]; item.set(ClassWriter.HANDLE_BASE + readByte(index), readClass(fieldOrMethodRef, buf), readUTF8(nameType, buf), readUTF8(nameType + 2, buf));
ntoff = tanns.length == 0 || readByte(tanns[0]) < 0x43 ? -1 : readUnsignedShort(tanns[0] + 1); } else if ("RuntimeInvisibleTypeAnnotations".equals(attrName)) { itanns = readTypeAnnotations(mv, context, u + 8, false); nitoff = itanns.length == 0 || readByte(itanns[0]) < 0x43 ? -1 : readUnsignedShort(itanns[0] + 1); } else if ("StackMapTable".equals(attrName)) { context.typePath, readUTF8(v, c), true)); ntoff = ++tann >= tanns.length || readByte(tanns[tann]) < 0x43 ? -1 : readUnsignedShort(tanns[tann] + 1); || readByte(itanns[itann]) < 0x43 ? -1 : readUnsignedShort(itanns[itann] + 1); if ((readByte(tanns[i]) >> 1) == (0x40 >> 1)) { int v = readAnnotationTarget(context, tanns[i]); v = readAnnotationValues(v + 2, c, true, if ((readByte(itanns[i]) >> 1) == (0x40 >> 1)) { int v = readAnnotationTarget(context, itanns[i]); v = readAnnotationValues(v + 2, c, true,
addConstantMethodHandle( itemIndex, classReader.readByte(itemOffset), classReader.readClass(memberRefItemOffset, charBuffer), classReader.readUTF8(nameAndTypeItemOffset, charBuffer),