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

OffHeapHashMap.expandTable() can fail to throw the table expand exception. #26

Open
cschanck opened this issue Mar 3, 2016 · 1 comment

Comments

@cschanck
Copy link
Contributor

cschanck commented Mar 3, 2016

In OffHeaphashMap.expandTable(), the table size is increased by double the current size. There is a check to see if it goes negative, but this is insufficient. The newLimit size calculated here is later increased in allocateTable(), and this can cause the end result size to be negative, resulting in a IllegalArgumentException from ByteBuffer.allocateTable().

Not a big deal, but it would be nice to have the right exception thrown.

@cschanck cschanck closed this as completed Mar 3, 2016
@cschanck cschanck reopened this Mar 3, 2016
@cschanck
Copy link
Contributor Author

cschanck commented Mar 3, 2016

God. double click closed it by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants