Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the same lock for all methods accessing Validation.GetValidationP…
…roviderListAction#providersPerClassloader `clearCache` was a static method and thus was synchronized on the class, while `getCachedValidationProviders`/`cacheValidationProviders` are instance methods and thus are synchronized on a particular instance. This means it was theoretically possible for `clearCache` and `getCachedValidationProviders`/`cacheValidationProviders` to access the providersPerClassloader map concurrently, which is a problem because WeakHashMap is not thread-safe. This may fix #180, though it's hard to say without a proper thread dump showing what the cause of the deadlock was exactly. In any case, this will prevent synchronization issues for integrators that call Validation#clearDefaultValidationProviderResolverCache concurrently to Validation.DefaultValidationProviderResolver#getValidationProviders.
- Loading branch information