On Fri, Jan 26, 2001 at 09:33:15AM -0800, Jeffrey Wescott wrote:
> I think that the following should be okay:
> 
> public boolean equals(Object o) {
>     try {
>         UserListPK in = (UserListPK)o;
>         return ( userID.equals(in.userID) && listID.equals(in.listID) );
>     } catch (ClassCastException e) {
>         return false;
>     }
> }

Doesn't imply a try-catch clause a performancy penalty? IMHO this should be
faster:

return ( (o instanceof UserListPK ) ?
          userID.equals((UserListPK) o.userID) && listID.equals((UserListPK) o.listID) 
:
          false
        );

My $0.02,
        -billy.

-- 
Philipp Meier                              o-matic GmbH
Gesch�ftsf�hrer                  Pfarrer-Wei�-Weg 16-18
Tel.: +49-(0)700-66284236                     89077 Ulm


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to