Esempio n. 1
0
  /**
   * Constructs a copy of <code>Code_attribute</code>. Specified class names are replaced during the
   * copy.
   *
   * @param cp constant pool table.
   * @param src source Code attribute.
   * @param classnames pairs of replaced and substituted class names.
   */
  private CodeAttribute(ConstPool cp, CodeAttribute src, Map classnames) throws BadBytecode {
    super(cp, tag);

    maxStack = src.getMaxStack();
    maxLocals = src.getMaxLocals();
    exceptions = src.getExceptionTable().copy(cp, classnames);
    attributes = new ArrayList();
    List src_attr = src.getAttributes();
    int num = src_attr.size();
    for (int i = 0; i < num; ++i) {
      AttributeInfo ai = (AttributeInfo) src_attr.get(i);
      attributes.add(ai.copy(cp, classnames));
    }

    info = src.copyCode(cp, classnames, exceptions, this);
  }