On Nov 12, 2007, at 15:46, Chris Bowditch wrote:
Hi Chris
<snip/>
Does anyone know why CacheEntry.ref can be null in this context
and why this only happens after a few thousand documents have been
run through? Previous documents all have the same property values.
Perhaps the GC has collected the object referenced by ref?
A lot of the code that accesses the ref member variable has checks
for null and since it is a WeakReference I assume the cause of this
error is the Garbage Collector removing the reference. Adding a
check for null in the rehash method seems to avoid the error and
all unit tests pass, but I would like confirmation from a
Properties expert (Andreas?) that this is a valid fix before
committing the change.
If your suggestion fixes the issue, by all means, commit. It should
not hurt to insert a check there.
I'll have a closer look at underlying causes one of the coming days.
Anyway, thanks for spotting this. The possibility of such issues
arising, was precisely the reason I did not include it in the 0.94
release.
Cheers
Andreas