MCPcopy Index your code
hub / github.com/clojure/clojure / putAnnotations

Method putAnnotations

src/jvm/clojure/asm/AnnotationWriter.java:315–336  ·  view source on GitHub ↗

Puts a Runtime[In]Visible[Type]Annotations attribute containing this annotations and all its predecessors (see #previousAnnotation in the given ByteVector. Annotations are put in the same order they have been visited. @param attributeNameIndex the constant pool index of the attribute

(final int attributeNameIndex, final ByteVector output)

Source from the content-addressed store, hash-verified

313 * @param output where the attribute must be put.
314 */
315 void putAnnotations(final int attributeNameIndex, final ByteVector output) {
316 int attributeLength = 2; // For num_annotations.
317 int numAnnotations = 0;
318 AnnotationWriter annotationWriter = this;
319 AnnotationWriter firstAnnotation = null;
320 while (annotationWriter != null) {
321 // In case the user forgot to call visitEnd().
322 annotationWriter.visitEnd();
323 attributeLength += annotationWriter.annotation.length;
324 numAnnotations++;
325 firstAnnotation = annotationWriter;
326 annotationWriter = annotationWriter.previousAnnotation;
327 }
328 output.putShort(attributeNameIndex);
329 output.putInt(attributeLength);
330 output.putShort(numAnnotations);
331 annotationWriter = firstAnnotation;
332 while (annotationWriter != null) {
333 output.putByteArray(annotationWriter.annotation.data, 0, annotationWriter.annotation.length);
334 annotationWriter = annotationWriter.nextAnnotation;
335 }
336 }
337
338 /**
339 * Returns the size of a Runtime[In]VisibleParameterAnnotations attribute containing all the

Callers 3

putFieldInfoMethod · 0.80
putMethodInfoMethod · 0.80
toByteArrayMethod · 0.80

Calls 4

visitEndMethod · 0.95
putShortMethod · 0.80
putIntMethod · 0.80
putByteArrayMethod · 0.80

Tested by

no test coverage detected