-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.3.0, 5.0
-
generic, sparc
-
generic, solaris_9
Name: yyT116575 Date: 11/21/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Design-Problem in java.awt.geom.Area:
The equals-Method is redefined in Area, but as the argument of equals in
class Area is Area and not Object, equals is not overridden but overloaded!
If such objects are included in a Set (e.g.) they are not considered as equal.
Example:
java.awt.geom.Area a1 = new java.awt.geom.Area();
java.awt.geom.Area a2 = new java.awt.geom.Area();
System.out.println(a1 == a2); // false
System.out.println(a1.equals(a2)); // true
System.out.println(a1.equals((Object)a2)); // false !!
If the behavior is intended, then the name of the method should probably
be changed.
(Review ID: 112539)
======================================================================
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Design-Problem in java.awt.geom.Area:
The equals-Method is redefined in Area, but as the argument of equals in
class Area is Area and not Object, equals is not overridden but overloaded!
If such objects are included in a Set (e.g.) they are not considered as equal.
Example:
java.awt.geom.Area a1 = new java.awt.geom.Area();
java.awt.geom.Area a2 = new java.awt.geom.Area();
System.out.println(a1 == a2); // false
System.out.println(a1.equals(a2)); // true
System.out.println(a1.equals((Object)a2)); // false !!
If the behavior is intended, then the name of the method should probably
be changed.
(Review ID: 112539)
======================================================================
- duplicates
-
JDK-4867221 Ambiguous equals() method in java.awt.geom.Area
-
- Closed
-
- relates to
-
JDK-8366749 Equal java.awt.geom.Area objects have different hashCode values.
-
- Closed
-