public String getExcClassname(int index, ConstantPool pool) { return pool.getPrimitiveConstant(throwsExceptions.get(index)).getString(); }
@Override public void resolveConstant(ConstantPool pool) { if (type == CONSTANT_Class || type == CONSTANT_String || type == CONSTANT_MethodType) { value = pool.getPrimitiveConstant(index).getString(); initConstant(); } }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int index = data.readUnsignedShort(); signature = pool.getPrimitiveConstant(index).getString(); }
public static AnnotationExprent parseAnnotation(DataInputStream data, ConstantPool pool) throws IOException { String className = pool.getPrimitiveConstant(data.readUnsignedShort()).getString(); List<String> names; List<Exprent> values; int len = data.readUnsignedShort(); if (len > 0) { names = new ArrayList<>(len); values = new ArrayList<>(len); for (int i = 0; i < len; i++) { names.add(pool.getPrimitiveConstant(data.readUnsignedShort()).getString()); values.add(parseAnnotationElement(data, pool)); } } else { names = Collections.emptyList(); values = Collections.emptyList(); } return new AnnotationExprent(new VarType(className).value, names, values); }
@Override public void resolveConstant(ConstantPool pool) { if (type == CONSTANT_NameAndType) { elementname = pool.getPrimitiveConstant(index1).getString(); descriptor = pool.getPrimitiveConstant(index2).getString(); } else if (type == CONSTANT_MethodHandle) { LinkConstant ref_info = pool.getLinkConstant(index2); classname = ref_info.classname; elementname = ref_info.elementname; descriptor = ref_info.descriptor; } else { if (type != CONSTANT_InvokeDynamic) { classname = pool.getPrimitiveConstant(index1).getString(); } LinkConstant nametype = pool.getLinkConstant(index2); elementname = nametype.elementname; descriptor = nametype.descriptor; } initConstant(); }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int len = data.readUnsignedByte(); List<Entry> entries; if (len > 0) { entries = new ArrayList<>(len); for (int i = 0; i < len; i++) { int nameIndex = data.readUnsignedShort(); String name = nameIndex != 0 ? pool.getPrimitiveConstant(nameIndex).getString() : null; int access_flags = data.readUnsignedShort(); entries.add(new Entry(name, access_flags)); } } else { entries = Collections.emptyList(); } myEntries = Collections.unmodifiableList(entries); }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int len = data.readUnsignedShort(); if (len > 0) { entries = new ArrayList<>(len); for (int i = 0; i < len; i++) { int innerNameIdx = data.readUnsignedShort(); int outerNameIdx = data.readUnsignedShort(); int simpleNameIdx = data.readUnsignedShort(); int accessFlags = data.readUnsignedShort(); String innerName = pool.getPrimitiveConstant(innerNameIdx).getString(); String outerName = outerNameIdx != 0 ? pool.getPrimitiveConstant(outerNameIdx).getString() : null; String simpleName = simpleNameIdx != 0 ? pool.getPrimitiveConstant(simpleNameIdx).getString() : null; entries.add(new Entry(outerNameIdx, simpleNameIdx, accessFlags, innerName, outerName, simpleName)); } } else { entries = Collections.emptyList(); } }
protected Map<String, StructGeneralAttribute> readAttributes(DataInputFullStream in, ConstantPool pool) throws IOException { int length = in.readUnsignedShort(); Map<String, StructGeneralAttribute> attributes = new HashMap<>(length); for (int i = 0; i < length; i++) { int nameIndex = in.readUnsignedShort(); String name = pool.getPrimitiveConstant(nameIndex).getString(); StructGeneralAttribute attribute = readAttribute(in, pool, name); if (attribute != null) { if (StructGeneralAttribute.ATTRIBUTE_LOCAL_VARIABLE_TABLE.getName().equals(name) && attributes.containsKey(name)) { // merge all variable tables StructLocalVariableTableAttribute table = (StructLocalVariableTableAttribute)attributes.get(name); table.add((StructLocalVariableTableAttribute)attribute); } else if (StructGeneralAttribute.ATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE.getName().equals(name) && attributes.containsKey(name)) { // merge all variable tables StructLocalVariableTypeTableAttribute table = (StructLocalVariableTypeTableAttribute)attributes.get(name); table.add((StructLocalVariableTypeTableAttribute)attribute); } else { attributes.put(attribute.getName(), attribute); } } } return attributes; }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int classIndex = data.readUnsignedShort(); int methodIndex = data.readUnsignedShort(); className = pool.getPrimitiveConstant(classIndex).getString(); if (methodIndex != 0) { LinkConstant lk = pool.getLinkConstant(methodIndex); methodName = lk.elementname; methodDescriptor = lk.descriptor; } }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int len = data.readUnsignedShort(); if (len > 0) { localVariables = new ArrayList<>(len); for (int i = 0; i < len; i++) { int start_pc = data.readUnsignedShort(); int length = data.readUnsignedShort(); int nameIndex = data.readUnsignedShort(); int descriptorIndex = data.readUnsignedShort(); int varIndex = data.readUnsignedShort(); localVariables.add(new LocalVariable(start_pc, length, pool.getPrimitiveConstant(nameIndex).getString(), pool.getPrimitiveConstant(descriptorIndex).getString(), varIndex)); } } else { localVariables = Collections.emptyList(); } }
String className = pool.getPrimitiveConstant(data.readUnsignedShort()).getString(); String constName = pool.getPrimitiveConstant(data.readUnsignedShort()).getString(); FieldDescriptor descr = FieldDescriptor.parseDescriptor(className); return new FieldExprent(constName, descr.type.value, true, null, descr, null); String descriptor = pool.getPrimitiveConstant(data.readUnsignedShort()).getString(); VarType type = FieldDescriptor.parseDescriptor(descriptor).type; PrimitiveConstant cn = pool.getPrimitiveConstant(data.readUnsignedShort()); switch (tag) { case 'B':
handler.exceptionClass = pool.getPrimitiveConstant(excclass).getString();
int thisClassIdx = in.readUnsignedShort(); int superClassIdx = in.readUnsignedShort(); qualifiedName = pool.getPrimitiveConstant(thisClassIdx).getString(); superClass = pool.getPrimitiveConstant(superClassIdx); for (int i = 0; i < length; i++) { interfaces[i] = in.readUnsignedShort(); interfaceNames[i] = pool.getPrimitiveConstant(interfaces[i]).getString();
case opc_checkcast: case opc_instanceof: if (cl.qualifiedName.equals(pool.getPrimitiveConstant(instr.operand(0)).getString())) { refCounter++; refNotNew = true; case opc_anewarray: case opc_multianewarray: if (cl.qualifiedName.equals(pool.getPrimitiveConstant(instr.operand(0)).getString())) { refCounter++;
for (int j = 0; j < attrSize; j++) { int attrNameIndex = in.readUnsignedShort(); String attrName = pool.getPrimitiveConstant(attrNameIndex).getString(); if (!StructGeneralAttribute.ATTRIBUTE_CODE.getName().equals(attrName)) { in.discard(in.readInt());
case opc_checkcast: case opc_instanceof: stack.push(new ConstExprent(new VarType(pool.getPrimitiveConstant(instr.operand(0)).getString(), true), null, null)); case opc_arraylength: pushEx(stack, exprlist, new FunctionExprent(mapConsts.get(instr.opcode), stack, bytecode_offsets)); case opc_multianewarray: int dimensions = (instr.opcode == opc_new) ? 0 : (instr.opcode == opc_anewarray) ? 1 : instr.operand(1); VarType arrType = new VarType(pool.getPrimitiveConstant(instr.operand(0)).getString(), true); if (instr.opcode != opc_multianewarray) { arrType = arrType.resizeArrayDim(arrType.arrayDim + dimensions);
cn = pool.getPrimitiveConstant(instr.operand(0)); stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, cn.getString())); break; case CodeConstants.opc_instanceof: stack.pop(); cn = pool.getPrimitiveConstant(instr.operand(0)); stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, cn.getString())); break; int dimensions = (instr.opcode == CodeConstants.opc_anewarray) ? 1 : instr.operand(1); stack.pop(dimensions); cn = pool.getPrimitiveConstant(instr.operand(0)); if (cn.isArray) { var1 = new VarType(CodeConstants.TYPE_OBJECT, 0, cn.getString());
StructConstantValueAttribute attr = fd.getAttribute(StructGeneralAttribute.ATTRIBUTE_CONSTANT_VALUE); if (attr != null) { PrimitiveConstant constant = cl.getPool().getPrimitiveConstant(attr.getIndex()); buffer.append(" = "); buffer.append(new ConstExprent(fieldType, constant.value, null).toJava(indent, tracer));
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int index = data.readUnsignedShort(); signature = pool.getPrimitiveConstant(index).getString(); }
@Override public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { int classIndex = data.readUnsignedShort(); int methodIndex = data.readUnsignedShort(); className = pool.getPrimitiveConstant(classIndex).getString(); if (methodIndex != 0) { LinkConstant lk = pool.getLinkConstant(methodIndex); methodName = lk.elementname; methodDescriptor = lk.descriptor; } }