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

Clarify that javax.lang.model.util.Elements.overrides is irreflexive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 20
    • 20
    • core-libs

    Backports

      Description

        javax.lang.model.util.Elements#overrides should explicitly say that javax.lang.model.util.Elements#overrides(m, m, ...) returns false. That is, a method never overrides itself.

        While it might be obvious to some, to others it is buried in JLS 8.4.8.1. It could be helpful to have that invariant spelled out because a programmer uses that API to build algorithms. At the very least, the programmer might want to know if they need to use an additional equality check:

            if ( elements.overrides(m1, m2, ...) && !m1.equals(m2) )

        Attachments

          Issue Links

            Activity

              People

                darcy Joe Darcy
                prappo Pavel Rappo
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: