commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: [lang] MutableInt does not equal Integer
Date Thu, 21 Jul 2005 22:19:45 GMT
Gary Gregory wrote:
> Hello:
> 
> The code:
> 
> 	new MutableInt(anInt).equals(Integer(anInt)) 
> 
> returns false for any int, which feels quite odd.
> 
> Should we fix this (for all mutables of course)?

No. As it violates the basic principles of the equals method as defined 
in Object.

new MutableInt(anInt).equals(new Integer(anInt)) !=
    new Integer(anInt).equals(new MutableInt(anInt))

You can add an isEqual() method if you like though.

Stephen

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