ArrayIndexOutOfBoundsException in TLongHash

Issue #59 invalid
Aaron Travis created an issue

I've observed the below exception when doing nothing more than creating a TLongHashSet and calling add() on it. I am using version 3.0.3 of Trove.

java.lang.ArrayIndexOutOfBoundsException: 3451 at gnu.trove.impl.hash.TLongHash.insertKeyRehash( at gnu.trove.impl.hash.TLongHash.insertKey( at gnu.trove.set.hash.TLongHashSet.rehash( at gnu.trove.impl.hash.THash.postInsertHook( at gnu.trove.set.hash.TLongHashSet.add(

It looks to be a recurrence of the issue reported here:

I would've added this to that thread but the thread has been closed.

Here's an example of calling code which triggers the exception:

tlhs = new TLongHashSet(); for (Foo f : someCollection) { for (Bar b : f) { tlhs.add(b.someGetter()); } }

Comments (5)

  1. Aaron Travis reporter

    Funny, I came across that issue earlier but couldn't see how it could be a threading issue in my case. After a second look though, I think you're right. Many thanks.

  2. Log in to comment