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

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

XMLWordPrintable

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

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

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

                Created:
                Updated:
                Resolved: