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

Method visitTypeAnnotation

src/jvm/clojure/asm/FieldWriter.java:160–178  ·  view source on GitHub ↗
(
      final int typeRef, final TypePath typePath, final String descriptor, final boolean visible)

Source from the content-addressed store, hash-verified

158 }
159
160 @Override
161 public AnnotationVisitor visitTypeAnnotation(
162 final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
163 // Create a ByteVector to hold a 'type_annotation' JVMS structure.
164 // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20.
165 ByteVector typeAnnotation = new ByteVector();
166 // Write target_type, target_info, and target_path.
167 TypeReference.putTarget(typeRef, typeAnnotation);
168 TypePath.put(typePath, typeAnnotation);
169 // Write type_index and reserve space for num_element_value_pairs.
170 typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0);
171 if (visible) {
172 return lastRuntimeVisibleTypeAnnotation =
173 new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeVisibleTypeAnnotation);
174 } else {
175 return lastRuntimeInvisibleTypeAnnotation =
176 new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeInvisibleTypeAnnotation);
177 }
178 }
179
180 @Override
181 public void visitAttribute(final Attribute attribute) {

Callers 1

acceptMethod · 0.45

Calls 4

putTargetMethod · 0.95
putMethod · 0.95
putShortMethod · 0.95
addConstantUtf8Method · 0.80

Tested by

no test coverage detected