Skip to content

Commit

Permalink
Merge pull request #182 from yrodiere/clearcache-synchronization
Browse files Browse the repository at this point in the history
Use the same lock for all methods accessing Validation.GetValidationProviderListAction#providersPerClassloader
  • Loading branch information
gsmet authored Aug 2, 2022
2 parents 33481c4 + 1aac339 commit b9c774c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/jakarta/validation/Validation.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ProviderSpecificBootstrap<T> byProvider(Class<U> providerType) {
*/
@SuppressWarnings("unused")
private static void clearDefaultValidationProviderResolverCache() {
GetValidationProviderListAction.clearCache();
GetValidationProviderListAction.INSTANCE.clearCache();
}

//private class, not exposed
Expand Down Expand Up @@ -339,8 +339,8 @@ public static synchronized List<ValidationProvider<?>> getValidationProviderList
}
}

public static synchronized void clearCache() {
INSTANCE.providersPerClassloader.clear();
public synchronized void clearCache() {
providersPerClassloader.clear();
}

@Override
Expand Down

0 comments on commit b9c774c

Please sign in to comment.