On Thu, Feb 22, 2001 at 10:43:17AM -0400, Diethelm Guallar, Gonzalo wrote:
> > 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:

Yep this looks reasonable to me, so I've committed it (I also put a
similar check in equals(Object obj)...

(BTW diffs are good :-) )

> 
>     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]

-- 
Sean Legassick
[EMAIL PROTECTED]
      Soy un hombre: nada humano me es extrano  
      
      


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to