/**
   * 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++;
  }
Beispiel #2
0
    public void visitBootstrapMethodsAttribute(
        Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute) {
      if (shouldBeMarkedAsUsed(bootstrapMethodsAttribute)) {
        markAsUsed(bootstrapMethodsAttribute);

        markConstant(clazz, bootstrapMethodsAttribute.u2attributeNameIndex);
      }

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