From b9084b1918bdf5b2cce2aabf671e5602b9e42661 Mon Sep 17 00:00:00 2001 From: leventov Date: Mon, 28 Sep 2015 22:40:22 +0300 Subject: [PATCH] Init transient field cxt in VanillaChronicleMap in initOwnTransients() rather than on declaration site --- .../java/net/openhft/chronicle/map/VanillaChronicleMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {