/** Adds a given annotation to the annotations attribute. */
  public void addAnnotation(Annotation annotation) {
    int annotationsCount = targetAnnotationsAttribute.u2annotationsCount;
    Annotation[] annotations = targetAnnotationsAttribute.annotations;

    // Make sure there is enough space for the new annotation.
    if (annotations.length <= annotationsCount) {
      targetAnnotationsAttribute.annotations = new Annotation[annotationsCount + 1];
      System.arraycopy(annotations, 0, targetAnnotationsAttribute.annotations, 0, annotationsCount);
      annotations = targetAnnotationsAttribute.annotations;
    }

    // Add the annotation.
    annotations[targetAnnotationsAttribute.u2annotationsCount++] = annotation;
  }
 public void visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute) {
   // Visit the annotations.
   annotationsAttribute.annotationsAccept(clazz, this);
 }