Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix thread safety in Json.mapper() #4710

Conversation

vuriaval
Copy link

Closes #4672

Instead of following the suggested approach in the issue, a more elegant method was used, where the initialization is delegated to the JVM code for static initialization.

See https://stackoverflow.com/questions/8297705/how-to-implement-thread-safe-lazy-initialization for a thread about this implementation.
See also https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom for the chosen pattern.

@frantuma frantuma merged commit 9b0326b into swagger-api:master Sep 23, 2024
5 checks passed
@frantuma
Copy link
Member

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

io.swagger.v3.core.util.Json public static method mapper() is not thread safe
2 participants