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

ArrayIndexOutOfBoundsException while iterating over UnifiedMap #24

Closed
yeison opened this issue May 13, 2015 · 3 comments
Closed

ArrayIndexOutOfBoundsException while iterating over UnifiedMap #24

yeison opened this issue May 13, 2015 · 3 comments

Comments

@yeison
Copy link

yeison commented May 13, 2015

I was iterating over a unifiedMap using values view and hit an ArrayIndexOutOfBoundsException

for (Object o : unifiedMap.valuesView()) 

|
|

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1048576
    at com.gs.collections.impl.map.mutable.UnifiedMap$ValuesIterator.next(UnifiedMap.java:2564)
    at com.gs.collections.impl.UnmodifiableIteratorAdapter.next(UnmodifiableIteratorAdapter.java:42)
    at com.gs.futures.lexicon.product.client.components.InstrumentCache.unionOfChildMapsAsInstrumentList(InstrumentCache.java:471)
@yeison
Copy link
Author

yeison commented May 13, 2015

If I just use values() instead of valuesView() I'm able to avoid the error

@motlin
Copy link
Collaborator

motlin commented May 13, 2015

Do you mutate the UnifiedMap inside the loop? Do you have any additional information that would help reproduce the exception?

@yeison
Copy link
Author

yeison commented May 13, 2015

Perhaps I am mutating my map somewhere else concurrently. When I add a lock the issue goes away and I can still use valuesView(). I'll close this ticket and continue to look into it. If I can reproduce it with the lock I'll let you know.

@yeison yeison closed this as completed May 13, 2015
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

2 participants