-
New Feature
-
Resolution: Fixed
-
P3
-
None
-
b15
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8006484 | 8 | Stefan Karlsson | P3 | Closed | Fixed | b74 |
JSR-308 brings annotation on type use (as opposed to annotations on type declarations only that we have today).
From the spec:
"JSR 308 introduces two new attributes: RuntimeVisibleTypeAnnotations and RuntimeInvisibleTypeAnnotations. These attributes are structurally identical to the RuntimeVisibleAnnotations and RuntimeInvisibleAnnotations attributes described above with one exception: rather than an array of annotation elements, RuntimeVisibleTypeAnnotations and RuntimeInvisibleTypeAnnotations contain an array of type_annotation elements, which are described in Section 3.1.
Runtime[In]VisibleTypeAnnotations_attribute {
u2 attribute_name_index; // "Runtime[In]VisibleTypeAnnotation"
u2 attribute_length;
u2 num_annotations;
type_annotation annotations[num_annotations];
}
A type annotation is stored in a Runtime[In]visibleTypeAnnotations attribute on the smallest enclosing class, field, or method."
We need to add support in the VM for storing those TypeAnnotation attributes, and send them to Java-land to be parsed.
From the spec:
"JSR 308 introduces two new attributes: RuntimeVisibleTypeAnnotations and RuntimeInvisibleTypeAnnotations. These attributes are structurally identical to the RuntimeVisibleAnnotations and RuntimeInvisibleAnnotations attributes described above with one exception: rather than an array of annotation elements, RuntimeVisibleTypeAnnotations and RuntimeInvisibleTypeAnnotations contain an array of type_annotation elements, which are described in Section 3.1.
Runtime[In]VisibleTypeAnnotations_attribute {
u2 attribute_name_index; // "Runtime[In]VisibleTypeAnnotation"
u2 attribute_length;
u2 num_annotations;
type_annotation annotations[num_annotations];
}
A type annotation is stored in a Runtime[In]visibleTypeAnnotations attribute on the smallest enclosing class, field, or method."
We need to add support in the VM for storing those TypeAnnotation attributes, and send them to Java-land to be parsed.
- backported by
-
JDK-8006484 Add VM support for type annotation reflection
-
- Closed
-
- relates to
-
JDK-8005994 Method annotations are allocated unnecessarily during class file parsing
-
- Closed
-
-
JDK-8007803 Implement javax.lang.model API for Type Annotations
-
- Resolved
-
-
JDK-8004698 Implement Core Reflection for Type Annotations
-
- Closed
-