RuntimeInvisibleTypeAnnotations attribute

Type annotations with class retention: what checkers such as the Checker Framework read..

Appears on
class, field, method, Code, record component
Since
class file 52.0 (Java 8)
javac writes it
for class-retention TYPE_USE annotations
Needed by the JVM
no: it is for the class libraries (reflection), compilers or tools

Layout

TypeFieldWhat it holds
u2attribute_name_indexa Utf8: "RuntimeInvisibleTypeAnnotations"
u4attribute_lengthbytes after this field
u2num_annotations
type_annotation[…]annotations

What it is for

Type annotations with class retention: what checkers such as the Checker Framework read.

How common it is

None of the 7,391 classes in JDK 25.0.5's java.base has one.

Specification: JVMS §4.7, The RuntimeInvisibleTypeAnnotations Attribute (Java SE 25).