-
Task
-
Resolution: Fixed
-
P3
-
8
-
b93
-
Not verified
No implementation changes are needed. Only the javadoc needs to be clarified:
1) In AnnotatedConstruct, the interface-level javadoc should have these definitions:
- An annotation A is directly present on a construct C if either:
- A is explicitly or implicitly declared as applying to the source code representation of C; or
- A has a representation in the executable output corresponding to C, such as in the RuntimeVisibleAnnotations attribute of a class file.
(Typically, if A is the only annotation of its type applied to C, then A is explicitly declared as applying to the source code representation of C. If there are multiple annotations of the same type applied to C, then a container annotation is implicitly declared as applying to the source code representation of C (JLS 9.7). Note that the multiple annotations of the same type are _not_ directly present on C; rather, they are indirectly present.)
- An annotation A is indirectly present on a construct C if A's type is repeatable, and C has exactly one annotation whose value element contains A and whose type is the containing annotation type of A's type (JLS 9.6).
- An annotation A is present on a construct C if either:
- A is directly present on C; or
- No annotation of A's type is directly present on C, and C is a class, and A's type is inheritable (JLS 9.6.3.3), and A is present on the superclass of C.
- An annotation A is associated with a construct C if either:
- A is directly or indirectly present on C; or
- No annotation of A's type is directly or indirectly present on C, and C is a class, and A's type is inheritable (9.6.3.3), and A is associated with the superclass of C.
2) In AnnotatedConstruct#getAnnotationsByType, the javadoc should be:
Returns the annotations which are associated with this construct. The order of annotations which are directly or indirectly present on a construct C is computed as if indirectly present annotations on C are directly present on C in place of their container annotation, in the order in which they appear in the value element of the container annotation.
1) In AnnotatedConstruct, the interface-level javadoc should have these definitions:
- An annotation A is directly present on a construct C if either:
- A is explicitly or implicitly declared as applying to the source code representation of C; or
- A has a representation in the executable output corresponding to C, such as in the RuntimeVisibleAnnotations attribute of a class file.
(Typically, if A is the only annotation of its type applied to C, then A is explicitly declared as applying to the source code representation of C. If there are multiple annotations of the same type applied to C, then a container annotation is implicitly declared as applying to the source code representation of C (JLS 9.7). Note that the multiple annotations of the same type are _not_ directly present on C; rather, they are indirectly present.)
- An annotation A is indirectly present on a construct C if A's type is repeatable, and C has exactly one annotation whose value element contains A and whose type is the containing annotation type of A's type (JLS 9.6).
- An annotation A is present on a construct C if either:
- A is directly present on C; or
- No annotation of A's type is directly present on C, and C is a class, and A's type is inheritable (JLS 9.6.3.3), and A is present on the superclass of C.
- An annotation A is associated with a construct C if either:
- A is directly or indirectly present on C; or
- No annotation of A's type is directly or indirectly present on C, and C is a class, and A's type is inheritable (9.6.3.3), and A is associated with the superclass of C.
2) In AnnotatedConstruct#getAnnotationsByType, the javadoc should be:
Returns the annotations which are associated with this construct. The order of annotations which are directly or indirectly present on a construct C is computed as if indirectly present annotations on C are directly present on C in place of their container annotation, in the order in which they appear in the value element of the container annotation.
- relates to
-
JDK-8007803 Implement javax.lang.model API for Type Annotations
-
- Resolved
-
-
JDK-8010679 Clarify "present" and annotation ordering in Core Reflection for Annotations
-
- Closed
-
-
JDK-7193719 Support repeating annotations in javax.lang.model
-
- Closed
-
-
JDK-8213444 Missing emphasis for term being defined
-
- Closed
-
-
JDK-8010679 Clarify "present" and annotation ordering in Core Reflection for Annotations
-
- Closed
-
-
JDK-7162089 Add support for repeating annotations to javax.annotation.processing
-
- Closed
-
(1 relates to)