diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 42fee820f..f7e15d939 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -93,7 +93,7 @@ public class VanillaChronicleMap methods; public transient DefaultValueProvider defaultValueProvider; - transient ThreadLocal cxt = new ThreadLocal<>(); + transient ThreadLocal cxt; public VanillaChronicleMap(ChronicleMapBuilder builder) throws IOException { @@ -162,6 +162,7 @@ public class VanillaChronicleMap valueReader = valueReaderProvider.get(copies, originalValueReader); constantValueProvider.initTransients(valueReader); } + cxt = new ThreadLocal<>(); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {