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

ConcurrentModificationException #47

Closed
markini opened this issue Mar 4, 2020 · 1 comment
Closed

ConcurrentModificationException #47

markini opened this issue Mar 4, 2020 · 1 comment

Comments

@markini
Copy link

markini commented Mar 4, 2020

Caused by java.util.ConcurrentModificationException
java.util.ArrayList$Itr.next (ArrayList.java:860)
jonathanfinerty.once.Once.beenDone (Once.java:254)
jonathanfinerty.once.Once.beenDone (Once.java:219)
jonathanfinerty.once.Once.beenDone (Once.java:204)
...

"Culprit" is the list inside the map in PersistedMap.java
https://github.com/jonfinerty/Once/blob/master/once/src/main/java/jonathanfinerty/once/PersistedMap.java#L18

Synchronizing access to the list at it is now, could be a little bit of a pain.

Might consider annotating every public static function in Once.java with synchronized. I think this step would at worst cost only a few milliseconds.

@jonfinerty
Copy link
Owner

More than a year later, I think this is fixed in the 1.3.1 version, if not feel free to reopen

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