Skip to content

Commit

Permalink
Changed CONVERSION_DB from ConcurrentHashMap to HashMap because it is…
Browse files Browse the repository at this point in the history
… read-only once the static initializer is finished. Class initialization is thread safe - no other class can access static content until the static initializers are completed.
  • Loading branch information
jdereg committed Apr 17, 2024
1 parent b662db3 commit c8bf5f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/cedarsoftware/util/convert/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.AbstractMap;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -79,7 +80,7 @@ public final class Converter {
private static final Convert<?> UNSUPPORTED = Converter::unsupported;
static final String VALUE = "_v";
private static final Map<Class<?>, Set<ClassLevel>> cacheParentTypes = new ConcurrentHashMap<>();
private static final Map<Map.Entry<Class<?>, Class<?>>, Convert<?>> CONVERSION_DB = new ConcurrentHashMap<>(860, .8f); // =~680/0.8
private static final Map<Map.Entry<Class<?>, Class<?>>, Convert<?>> CONVERSION_DB = new HashMap<>(860, .8f); // =~680/0.8
private final Map<Map.Entry<Class<?>, Class<?>>, Convert<?>> USER_DB = new ConcurrentHashMap<>();
private final ConverterOptions options;

Expand Down

0 comments on commit c8bf5f2

Please sign in to comment.