> I do not think two distinct objects should be declared equal on the
> basis that their identifying attribute is undefined.
Ok, agreed. However, the original code will still fail
is the passed BaseObject is null, right? Here is my
amended proposal:
public boolean equals(BaseObject bo)
{
if (bo == null)
{
return false;
}
else if (this == bo)
{
return true;
}
Object k1 = this.getPrimaryKey;
Object k2 = bo.getPrimaryKey();
if ((k1 == null) || (k2 == null))
{
return false;
}
else
{
return (k1.equals(k2));
}
}
--
Gonzalo A. Diethelm
[EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]