Skip to content

Commit 954101a

Browse files
committed
Use Thread-Safe Map
Issue gh-15906
1 parent d7f5fd9 commit 954101a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/main/java/org/springframework/security/core/annotation/SecurityAnnotationScanners.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import java.lang.annotation.Annotation;
2020
import java.lang.reflect.AnnotatedElement;
2121
import java.util.ArrayList;
22-
import java.util.HashMap;
2322
import java.util.List;
2423
import java.util.Map;
24+
import java.util.concurrent.ConcurrentHashMap;
2525

2626
/**
2727
* Factory for creating {@link SecurityAnnotationScanner} instances.
@@ -31,11 +31,11 @@
3131
*/
3232
public final class SecurityAnnotationScanners {
3333

34-
private static final Map<Class<? extends Annotation>, SecurityAnnotationScanner<? extends Annotation>> uniqueScanners = new HashMap<>();
34+
private static final Map<Class<? extends Annotation>, SecurityAnnotationScanner<? extends Annotation>> uniqueScanners = new ConcurrentHashMap<>();
3535

36-
private static final Map<Class<? extends Annotation>, SecurityAnnotationScanner<? extends Annotation>> uniqueTemplateScanners = new HashMap<>();
36+
private static final Map<Class<? extends Annotation>, SecurityAnnotationScanner<? extends Annotation>> uniqueTemplateScanners = new ConcurrentHashMap<>();
3737

38-
private static final Map<List<Class<? extends Annotation>>, SecurityAnnotationScanner<? extends Annotation>> uniqueTypesScanners = new HashMap<>();
38+
private static final Map<List<Class<? extends Annotation>>, SecurityAnnotationScanner<? extends Annotation>> uniqueTypesScanners = new ConcurrentHashMap<>();
3939

4040
private SecurityAnnotationScanners() {
4141
}

0 commit comments

Comments
 (0)