Name: nt126004 Date: 10/29/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
Object.equals is not easy to use when you compare two
object references that can be null.
I'd rather have a
static boolean equals(Object o1, Object o2)
{
if (o1 == null) {
if (o2 == null) {
return true;
}
return o2.equals(o1);
}
return o1.equals(o2);
}
in the Object class.
(Review ID: 134567)
======================================================================
- relates to
-
JDK-6797535 Add shared two argument static equals method to the platform
- Resolved