question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.util.ConcurrentModificationException in ModelResolver when you have both baseTypes and subTypes

See original GitHub issue

We 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:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arysincommented, Sep 21, 2020

I can confirm this problem is not present in 2.1.4, thanks!

0reactions
frantumacommented, Sep 21, 2020

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found