commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: [LANG] - suggestions for new Identity Hash code classes
Date Tue, 16 Sep 2008 12:58:56 GMT
Hi Simon,

Simon Kitching wrote:
> One other concern is regarding garbage collection. From a
> brief look at
> the code, this thread-local registry object contains a set of Integer
> hashcodes. With this change, the set will now contain real hard
> references to objects, preventing them from being garbage-collected
> while they are in the set. Does this matter?

Good catch. I am quite sure this will matter, unfortunately. HashCodeBuilder.reflectionHashCode(Object)
is widely used and if a new lang version suddenly keeps those values, we might prevent redeployments
that worked so far and causing memory leaks. Using a WeakReference instead? We're getting
slow :-/

- Jörg

BTW: The current implementation of HashCodeBuilder.reflectionHashCode(Object) is not wrong,
its the class implementation that uses EqualsBuilder.reflectionEquals(o, this) together with
it. We might therefore also create a new method HashCodeBuilder.reflectionHashCodeRespectingEquals(Object)

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message