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

Improve Annotation.annotationType() documentation

XMLWordPrintable

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


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

                Created:
                Updated:
                Resolved: