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(TLongHash.java:297) at gnu.trove.impl.hash.TLongHash.insertKey(TLongHash.java:275) at gnu.trove.set.hash.TLongHashSet.rehash(TLongHashSet.java:416) at gnu.trove.impl.hash.THash.postInsertHook(THash.java:388) at gnu.trove.set.hash.TLongHashSet.add(TLongHashSet.java:200)

It looks to be a recurrence of the issue reported here: http://sourceforge.net/p/trove4j/mailman/message/28141904/

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