-
Notifications
You must be signed in to change notification settings - Fork 75
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: Unable to verify subclasses of ArrayList collection #341
Comments
As a workaround you could change your DTO to contain I'll see if I can make EqualsVerifier emit a more helpful error message in this situation. |
It's a good idea to use composition instead of inheritance in new code. Unfortunately, I'm trying to introduce unit testing for some legacy DTOs in the project and that DTO is part of the Hibernate entity that have a lot of saved data in production databases. So I will have to implement additional type adapters for each entity to save the current data format, and this doesn't look like an easy task. So I'm wondering if it is possible to implement special behavior for cloning successors of |
Ah, I see. Instantiating objects isn't the problem, EqualsVerifier can do that just fine. The issue is that EqualsVerifier will use reflection to change fields and see what happens. This is fine for POJO's, but |
Oops, accidentally closed this. I still want to implement a better error message. |
I've released version 3.4.3, which contains a more helpful error message. |
What steps will reproduce the problem?
Verify any class that extends ArrayList collection.
What is the code that triggers this problem?
What error message or stack trace does EqualsVerifier give?
What did you expect?
I expect that my DTO can be verified by EqualsVerifier.
Which version of EqualsVerifier are you using?
Latest version 3.4.2
Please provide any additional information below.
It seems that EqualsVerifier library is trying to duplicate object in some strange way that break ArrayList internals integrity.
The text was updated successfully, but these errors were encountered: