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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 20
    • Affects Version/s: 20
    • Component/s: 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) )

              Assignee:
              Joe Darcy
              Reporter:
              Pavel Rappo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: