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

java.awt.geom.Area violates Object.hashCode contract

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.0
    • client-libs
    • 2d
    • generic
    • solaris_2.6

      java.awt.geom.Area class overrides 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)

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: