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
| Type | Field | What it holds |
|---|---|---|
u2 | attribute_name_index | a Utf8: "RuntimeInvisibleTypeAnnotations" |
u4 | attribute_length | bytes after this field |
u2 | num_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).