Skip to content

Commit 28e541e

Browse files
authored
use ConcurrentHashMap in TypeUtils (#93)
1 parent 9e5d9fb commit 28e541e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/aerospike/mapper/tools/utils/TypeUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
import java.lang.reflect.Type;
2727
import java.time.Instant;
2828
import java.util.Date;
29-
import java.util.HashMap;
3029
import java.util.List;
3130
import java.util.Map;
31+
import java.util.concurrent.ConcurrentHashMap;
3232

3333
public class TypeUtils {
34-
private static final Map<Class<?>, TypeMapper> mappers = new HashMap<>();
34+
private static final Map<Class<?>, TypeMapper> mappers = new ConcurrentHashMap<>();
3535

3636
public static class AnnotatedType {
3737

@@ -79,6 +79,7 @@ public boolean isParameterizedType() {
7979
return parameterizedType != null;
8080
}
8181

82+
@SuppressWarnings("unchecked")
8283
public <T> T getAnnotation(Class<T> clazz) {
8384
if (this.annotations == null) {
8485
return null;

0 commit comments

Comments
 (0)