Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8247435 | 16 | Joe Darcy | P4 | Resolved | Fixed | b01 |
A DESCRIPTION OF THE PROBLEM :
It appears for a java.lang.annotation.Annotation x, one is supposed to call x.annotationType() instead of x.getClass().
However, currently this is not obvious from the Annotation documentation, neither are the reasons for this explained.
Expected would be that:
1. The class documentation of Annotation mentioned that one should prefer annotationType() to getClass()
2. The annotationType() doc explained why this method should be preferred to calling getClass()
It appears for a java.lang.annotation.Annotation x, one is supposed to call x.annotationType() instead of x.getClass().
However, currently this is not obvious from the Annotation documentation, neither are the reasons for this explained.
Expected would be that:
1. The class documentation of Annotation mentioned that one should prefer annotationType() to getClass()
2. The annotationType() doc explained why this method should be preferred to calling getClass()
- backported by
-
JDK-8247435 Improve Annotation.annotationType() documentation
-
- Resolved
-
- relates to
-
JDK-8162817 Annotation toString output not reusable for source input
-
- Closed
-