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

Explain how Object.equals() approximates an equivalence relation

XMLWordPrintable

      Name: jl125535 Date: 04/24/2002


      A DESCRIPTION OF THE PROBLEM :
      Object.equals() should be explicitly state that it
      *always* must implement an equivalence relation.
      The current documentation uses "should" where it should
      read "must".

      Other bug evaluations, for example

      http://developer.java.sun.com/developer/bugParade/bugs/4034796.html
      http://developer.java.sun.com/developer/bugParade/bugs/4233802.html

      seem to indicate that Object.equals() really always must
      be symmetric etc. and that not even in special cases
      exceptions are possible.

      (If not, all methods that (may) use equals() would have to
        state explicitly which Object they invoke equals() on, as
      the result need not be symmetric).


      This bug can be reproduced always.
      (Review ID: 145185)
      ======================================================================

            darcy Joe Darcy
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: