Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnifiedSet java.lang.ArrayIndexOutOfBoundsException while iterating #701

Closed
arebgun opened this issue Feb 25, 2019 · 4 comments
Closed

UnifiedSet java.lang.ArrayIndexOutOfBoundsException while iterating #701

arebgun opened this issue Feb 25, 2019 · 4 comments

Comments

@arebgun
Copy link

arebgun commented Feb 25, 2019

I trying out Eclipse Collections for my project, using the latest available version - 9.2.0. Sometimes I am getting exceptions while iterating over a set (both while using UnifiedSet and UnifiedSetWithHashingStrategy):

Error: java.lang.ArrayIndexOutOfBoundsException: Index 256 out of bounds for length 256 java.lang.ArrayIndexOutOfBoundsException: Index 256 out of bounds for length 256 at org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy$PositionalIterator.next(UnifiedSetWithHashingStrategy.java:1834)

the index can be different, I have seen 256, 512, 1024 and some other powers of 2. It doesn't look like I am doing anything special here.

Could be similar or related to #481?

@nikhilnanivadekar
Copy link
Contributor

Thanks for trying out Eclipse Collections. Can you please share a test case or code which we can use to analyze?

@arebgun
Copy link
Author

arebgun commented Feb 25, 2019

I don't have a test case that I can share right now. So far I just tried to use UnifiedSet a drop-in replacement for JDK's HashSet in a bigger project. I will try to distill a test case, although I have been unsuccessful so far.

@victornoel
Copy link
Contributor

@arebgun are you sure that:

  • you aren't using it in a concurrent context?
  • you are not modifying it while iterating over it?

@arebgun
Copy link
Author

arebgun commented Mar 9, 2019

@victornoel thanks for the ideas. It does look like the set is being added to while being iterated over.

@arebgun arebgun closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants