commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee / Purple Technology <g...@stinky.com>
Subject Re: Subclassing and EqualsBuilder is [not] broken
Date Fri, 14 Mar 2003 17:52:18 GMT
BTW, I asked Jim to take a look at this, since he and I worked
together on a hairy equals method a few months ago.  Any objections
if, once I get karma, I add the test he mentioned to the test suite?

 - A


On Fri, Mar 14, 2003 at 07:28:44AM -0000, bugzilla@apache.org wrote:
> 
> ------- Additional Comments From kingdon@panix.com  2003-03-14 07:28 -------
> No wait, I take it back.
> 
> I now see the code which checks for subclasses and
> forces equals to false in the relevant cases.
> 
> The tests would probably be a bit clearer if they
> were broken apart in a greater number of test methods,
> with names which reflected the things they did.
> For what it is worth, here's the test I wrote
> which helped me see what was going on:
> 
>     public void testSubclassingIsCommutative()
>     {
>         TestObject superObj = new TestObject(4);
>         TestSubObject subObj = new TestSubObject(4, 10);
>         boolean superFirst = EqualsBuilder.reflectionEquals(superObj, subObj);
>         boolean subFirst = EqualsBuilder.reflectionEquals(subObj, superObj);
>         assertEquals(superFirst, subFirst);
>     }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

-- 
Alex Chaffee                               mailto:alex@jguru.com
Purple Technology - Code and Consulting    http://www.purpletech.com/
jGuru - Java News and FAQs                 http://www.jguru.com/alex/
Gamelan - the Original Java site           http://www.gamelan.com/
Stinky - Art and Angst                     http://www.stinky.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message