/**
   * Adds a given bootstrap method to the bootstrap methods attribute.
   *
   * @return the index of the bootstrap method.
   */
  public int addBootstrapMethodInfo(BootstrapMethodInfo bootstrapMethodInfo) {
    targetBootstrapMethodsAttribute.bootstrapMethods =
        (BootstrapMethodInfo[])
            ArrayUtil.add(
                targetBootstrapMethodsAttribute.bootstrapMethods,
                targetBootstrapMethodsAttribute.u2bootstrapMethodsCount,
                bootstrapMethodInfo);

    return targetBootstrapMethodsAttribute.u2bootstrapMethodsCount++;
  }
Example #2
0
    public void visitBootstrapMethodsAttribute(
        Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute) {
      if (shouldBeMarkedAsUsed(bootstrapMethodsAttribute)) {
        markAsUsed(bootstrapMethodsAttribute);

        markConstant(clazz, bootstrapMethodsAttribute.u2attributeNameIndex);
      }

      bootstrapMethodsAttribute.bootstrapMethodEntryAccept(clazz, bootstrapMethodIndex, this);
    }