@Override public void visitAttribute(final Attribute attribute) { // Store the attributes in the <i>reverse</i> order of their visit by this method. if (attribute.isCodeAttribute()) { attribute.nextAttribute = firstCodeAttribute; firstCodeAttribute = attribute; } else { attribute.nextAttribute = firstAttribute; firstAttribute = attribute; } }
while (attribute != null) { symbolTable.addConstantUtf8(attribute.type); size += 6 + attribute.write(classWriter, code, codeLength, maxStack, maxLocals).length; attribute = attribute.nextAttribute;
attributeCount += firstAttribute.getAttributeCount(); firstCodeAttribute.computeAttributesSize( symbolTable, code.data, code.length, maxStack, maxLocals); codeAttributeCount += firstCodeAttribute.getAttributeCount(); firstCodeAttribute.putAttributes( symbolTable, code.data, code.length, maxStack, maxLocals, output); firstAttribute.putAttributes(symbolTable, output);
final int codeAttributeOffset, final Label[] labels) { Attribute attribute = new Attribute(type); attribute.content = new byte[length]; System.arraycopy(classReader.b, offset, attribute.content, 0, length);
attributesCount += firstAttribute.getAttributeCount(); firstAttribute.putAttributes(symbolTable, output);
for (int j = 0; j < context.attrs.length; ++j) { if (context.attrs[j].type.equals(attrName)) { Attribute attr = context.attrs[j].read(this, u + 8, readInt(u + 4), c, codeStart - 8, labels); if (attr != null) {
/** * Returns the total size in bytes of all the attributes in the attribute list that begins with * this attribute. This size includes the 6 header bytes (attribute_name_index and * attribute_length) per attribute. Also adds the attribute type names to the constant pool. * * @param symbolTable where the constants used in the attributes must be stored. * @return the size of all the attributes in this attribute list. This size includes the size of * the attribute headers. */ final int computeAttributesSize(final SymbolTable symbolTable) { final byte[] code = null; final int codeLength = 0; final int maxStack = -1; final int maxLocals = -1; return computeAttributesSize(symbolTable, code, codeLength, maxStack, maxLocals); }
/** * Puts all the attributes of the attribute list that begins with this attribute, in the given * byte vector. This includes the 6 header bytes (attribute_name_index and attribute_length) per * attribute. * * @param symbolTable where the constants used in the attributes must be stored. * @param output where the attributes must be written. */ final void putAttributes(final SymbolTable symbolTable, final ByteVector output) { final byte[] code = null; final int codeLength = 0; final int maxStack = -1; final int maxLocals = -1; putAttributes(symbolTable, code, codeLength, maxStack, maxLocals, output); }
size += attrs.getSize(cw, null, 0, -1, -1);
attributesCount += firstAttribute.getAttributeCount(); size += firstAttribute.computeAttributesSize(symbolTable); firstAttribute.putAttributes(symbolTable, result);
final int codeAttributeOffset, final Label[] labels) { Attribute attribute = new Attribute(type); attribute.content = new byte[length]; System.arraycopy(classReader.b, offset, attribute.content, 0, length);
attributesCount += firstAttribute.getAttributeCount(); firstAttribute.putAttributes(symbolTable, output);
for (int j = 0; j < context.attrs.length; ++j) { if (context.attrs[j].type.equals(attrName)) { Attribute attr = context.attrs[j].read(this, u + 8, readInt(u + 4), c, codeStart - 8, labels); if (attr != null) {
size += firstAttribute.computeAttributesSize(symbolTable);
/** * Puts all the attributes of the attribute list that begins with this attribute, in the given * byte vector. This includes the 6 header bytes (attribute_name_index and attribute_length) per * attribute. * * @param symbolTable where the constants used in the attributes must be stored. * @param output where the attributes must be written. */ final void putAttributes(final SymbolTable symbolTable, final ByteVector output) { final byte[] code = null; final int codeLength = 0; final int maxStack = -1; final int maxLocals = -1; putAttributes(symbolTable, code, codeLength, maxStack, maxLocals, output); }