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 #425

Closed
per-neiderud opened this Issue Jun 19, 2017 · 2 comments

Comments

2 participants
@per-neiderud

per-neiderud commented Jun 19, 2017

Hi,

This is a follow-up of #270, and I'm just re-posting my comments there to make sure that it gets into the pipeline. My apologies if this means I'm causing a duplicate.

Using version 1.31, with Java 8u45 on Jenkins, I run into the same problem as in #270.
From time to time, I get an java.util.ConcurrentModificationException.
Unfortunately, I also haven't been able to create a useful test case that reproduces the problem each time it runs.

However, I have spotted the problem in the code :)

It seems that in MockFixture, an item can in some cases be removed from an iterator while iterating over the elements of that same iterator. This is very likely what causes the ConcurrentModificationException.

The problem is in this method, the 3rd line from the bottom,
"itr.remove();"

Could you please have a look?

Thanks,
Per

@rliesenfeld

This comment has been minimized.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Jun 19, 2017

Member

Ok, it seems MockFixture#addRedefinedClass(...) is getting called concurrently, in some unknown situation.
Will make the map a concurrent map then.

Member

rliesenfeld commented Jun 19, 2017

Ok, it seems MockFixture#addRedefinedClass(...) is getting called concurrently, in some unknown situation.
Will make the map a concurrent map then.

@rliesenfeld rliesenfeld self-assigned this Jun 19, 2017

@rliesenfeld rliesenfeld added the other label Jun 19, 2017

@per-neiderud

This comment has been minimized.

Show comment
Hide comment
@per-neiderud

per-neiderud Jun 19, 2017

Great, thanks a lot!

/ Per

Great, thanks a lot!

/ Per

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