Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8245620

Improve Annotation.annotationType() documentation

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 14
    • Fix Version/s: 15
    • Component/s: core-libs

      Backports

        Description

        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()


          Attachments

            Issue Links

              Activity

                People

                Assignee:
                darcy Joe Darcy
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: