-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Summary
The OpenApiContextLocator getInstance() method is not thread safe and could cause a registered OpenApiContext to be lost during configuration.
Component
swagger-integration
Version
2.0.5
Description
The OpenApiContextLocator provides a static singleton instance via its getInstance() method. This method has the potential to create multiple OpenApiContextLocator instances when it is being accessed by more than one thread. This could cause a registered OpenApiContext to be lost during configuration.
Proposed Solution
Change this method so that it is synchronized. If performance is a concern double-checked locking may be used, but this approach is not normally recommended (see http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html)
Metadata
Metadata
Assignees
Labels
No labels