db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinton McCombs <qmcco...@nequalsone.com>
Subject [SOURCE] Issue #TRQS133 - Incorrect implementation of equals() in BaseObject
Date Mon, 03 Feb 2003 05:02:47 GMT
You can view the issue detail at the following URL:
<http://scarab.werken.com/scarab/issues/id/TRQS133>

Type :        Defect
Issue Id :    TRQS133
Reported by: Quinton McCombs
             quintonm - (qmccombs@nequalsone.com)

Details:

Summary: Incorrect implementation of equals() in BaseObject
Description: I notice that if I have two tables A and B, each having one numerical primary
key. So I will have two subclasses of BaseObject A and B. Now for example if I get object
from table A with primary key 1. And object from table B with primary key 1.

A.equals(B) will return true ... I think it is wrong. It should return false.

Both A and B inherit equals from BaseObject and it only compares the value of the primary
key if object passwd to equals is a subclass of BaseObject. I think it also should compare
runtime class names. Am I wrong?

-- 
Best regards,
 Boris                          mailto:blib@dsi.ru


Status: New


Mime
View raw message