cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Ezkovich <>
Subject Re: [CForms] Repeater: why not hashCode for id?
Date Mon, 28 Mar 2005 14:06:45 GMT

On Mar 28, 2005, at 6:35 AM, Carsten Ziegeler wrote:

> Sylvain Wallez wrote:
>> Carsten Ziegeler wrote:
>> hashCodes are not supposed to be unique, even if the default
>> implementation in Object /may/ use the memory address as hashCode!
> Yepp, that's true - but usually for your own business objects you know
> if hashCode is unique or not.

I'm sure you are aware of this and take this as you will, the general 
contract for hashCode states that
"If two objects are equal according to the equals(Object)  method, then 
calling the hashCode method on each of the two objects must produce the 
same integer result."

So 2 distinct objects may have the same hashCode and it may be 
necessary to bind 2 equal objects.

Glen Ezkovich
HardBop Consulting
glen at

A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to 
worry about answers."
- Thomas Pynchon Gravity's Rainbow

View raw message