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

java.text.[IntHashtable and PatternEntry] violate Object.hashCode contract

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • generic
    • solaris_2.6

      java.text.IntHashtable and java.text.PatternEntry classes override Object.equals
      but not Object.hashCode. This violates the restriction that:

      a.equals(b) ==> a.hashCode()==b.hashCode()

      If our customers use objects of any of these classes as keys in Hashtables or
      HashMaps, or elements in HashSets, the basic invariants of the collections will
      be corrupted, leading to erratic behavior.

      We have fixed this problem for awt (see bug 4157612)

            nlindenbsunw Norbert Lindenberg (Inactive)
            tdv Dmitri Trembovetski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: