-
Bug
-
Resolution: Fixed
-
P4
-
1.1, 1.1.6, 1.2.0
-
beta
-
generic, x86
-
generic, windows_nt
The AffineTransform, Dimension, Insets, ColorModel, ComponentColorModel, PackedColorModel, AlphaComposite and BasicStroke 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.
(Note that I widened the scope of this bug to encompass all of the awt classes
with this problem, and the wider-scope bug (4157612) was closed as a duplicate
of this one.)
joshua.bloch@Eng 1998-09-02
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.
(Note that I widened the scope of this bug to encompass all of the awt classes
with this problem, and the wider-scope bug (4157612) was closed as a duplicate
of this one.)
joshua.bloch@Eng 1998-09-02
- duplicates
-
JDK-4170619 Many classes violate Object.hashCode contract
- Closed
-
JDK-4170624 DataFlavors violates Object.hashCode contract in two ways
- Closed
-
JDK-4150278 Dimension class doesn't implement hashCode()
- Closed
- relates to
-
JDK-4245538 java.text.[IntHashtable and PatternEntry] violate Object.hashCode contract
- Closed
-
JDK-4172368 Character.Subset.hashCode() missing: violates contract
- Closed
-
JDK-4245534 java.awt.geom.Area violates Object.hashCode contract
- Closed
(1 relates to)