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

clear() throws java.lang.UnsupportedOperationException: remove #173

Open
maxim5 opened this issue Sep 4, 2021 · 1 comment
Open

clear() throws java.lang.UnsupportedOperationException: remove #173

maxim5 opened this issue Sep 4, 2021 · 1 comment

Comments

@maxim5
Copy link

maxim5 commented Sep 4, 2021

Create a map and call .clear():

java.lang.UnsupportedOperationException: remove

	at java.base/java.util.Iterator.remove(Iterator.java:102)
	at java.base/java.util.AbstractCollection.clear(AbstractCollection.java:431)
	at java.base/java.util.AbstractMap.clear(AbstractMap.java:297)
@sanastas
Copy link
Contributor

sanastas commented Sep 5, 2021

Indeed those optional APIs are not yet implemented. They are on the TODO list. Meanwhile instead of Iterator.remove() it is possible to use an iterator and invoke remove() on relevant key-value mapping. For clear() there is no good alternative. Using close() and building again will release the entire off-heap memory and allocate again.

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