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

Clean up use of javax.lang.model.element API in javadoc

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • None
    • tools
    • None

      JavaDoc use of the javax.lang.model.element API is somewhat spoiled by the implementation of that API in OpenJDK, which allows to take shortcuts such as comparing objects by reference and determining element kind using the instanceof operator. These are not guaranteed to work by the API itself[1].

      Although javadoc is developed and ships with the OpenJDK implementation of the Element API, it would be good to change the code to use the supported idioms such as `equals`, `getKind` and visitors.

      [1]: https://docs.oracle.com/en/java/javase/23/docs/api/java.compiler/javax/lang/model/element/Element.html

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: