java.util.ConcurrentModificationException in ModelResolver when you have both baseTypes and subTypes
See original GitHub issueWe were migrating our swagger version from 1.5.9 to 1.5.12 and observed we are getting a ConcurrentModificationException for our classes which has both JsonType and JsonSubtypes defined.
The annotations are like:
@JsonTypeInfo( use = JsonTypeInfo.Id.NAME,
property = "version",
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = Blah.class,
visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Blah.class),
@JsonSubTypes.Type(value = BlahBlah.class)
})
The issue is in the same loop while iterating over the same map and elements are getting resumed. I have marked the code segment which is causing this issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
java.util.ConcurrentModificationException - DigitalOcean
Concurrent modification exception can come in the case of multithreaded as well as a single-threaded Java programming environment. java.util.
Read more >How to avoid java.util.ConcurrentModificationException when ...
Two options: Create a list of values you wish to remove, adding to that list within the loop, then call originalList.removeAll(valuesToRemove) at the...
Read more >ConcurrentModificationException (Java Platform SE 8 )
This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.
Read more >How to Avoid the Concurrent Modification Exception in Java
The ConcurrentModificationException in Java occurs when an object is attempted to be modified concurrently without permission.
Read more >Fix the ConcurrentModificationException | TechTarget
Has the ConcurrentModificationException been thrown in you Java app? ... In the following Java code, the commented line will trigger the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm this problem is not present in 2.1.4, thanks!
@arysin this seems not to be reproducible with latest swagger-core 2.x version, if you’re still experiencing the issue, please provide a complete scenario