Skip to content

Conversation

@guanchengang
Copy link

In ConcurrentBag. getStateCounts(), state was directly used as the index of the array.
In the original code, there were cases where the state was negative.(STATE_REMOVED and STATE_RESERVED)
When an item is in one of these two states, ArrayIndexOutOfBoundsException will be thrown.
So I modified the values of these two fields and added tests.
If negative values are intentional, we may need to consider modifying the implementation of getStateCounts to return a Map (if so, please let me know and I would be happy to suggest another PR to fix it).

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

Successfully merging this pull request may close these issues.

1 participant