Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [handly-dev] Handle.hashCode inconsistency?

Hi Vlad, 
 
Probably not, as far as I can see. Basically, we are trading off a little less computation in hashCode() for (potentially) a bit more computation in hash table lookup. I think it's not unreasonable: after all, namesake children of different element types are not that common. I have taken a look at JDT, and they do the same thing.
 
Why do you think it could be problematic? Do you have a particular use case in mind?
 
Best regards,
Vladimir
 
 
Hi!

Shouldn't Handle.hashCode use getElementType() too, in order to be consistent with Hash.equals?

        result = prime * result + getElementType().hashCode();

If I have children of different types and with same name, then putting them in a HashMap will create a bit of chaos...

regards,
Vlad


Back to the top