From 4913062481bbb8b4a14149259bd7d32be2ee36b3 Mon Sep 17 00:00:00 2001 From: leventov Date: Tue, 7 Oct 2014 20:10:27 +0400 Subject: [PATCH] HCOLL-161 eliminated inconsistency between VanillaChronicleMap and DirectBytesBuffer serializers --- .../java/net/openhft/chronicle/map/ChronicleMapBuilder.java | 3 ++- .../java/net/openhft/chronicle/map/VanillaChronicleMap.java | 2 +- .../java/net/openhft/chronicle/map/TestBooleanValues.java | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index b7aa0831b..cf20ec795 100644 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -823,7 +823,8 @@ public class ChronicleMapBuilder implements Cloneable { public ChronicleMap create() throws IOException { VanillaChronicleMap map = newMap(); - BytesStore bytesStore = new DirectStore(objectSerializer(), map.sizeInBytes(), true); + BytesStore bytesStore = new DirectStore(JDKObjectSerializer.INSTANCE, + map.sizeInBytes(), true); map.createMappedStoreAndSegments(bytesStore); return establishReplication(map); } diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 13f445976..8718a0d38 100644 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -200,7 +200,7 @@ class VanillaChronicleMap, long createMappedStoreAndSegments(File file) throws IOException { return createMappedStoreAndSegments(new MappedStore(file, FileChannel.MapMode.READ_WRITE, - sizeInBytes(), objectSerializer)); + sizeInBytes(), JDKObjectSerializer.INSTANCE)); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { diff --git a/src/test/java/net/openhft/chronicle/map/TestBooleanValues.java b/src/test/java/net/openhft/chronicle/map/TestBooleanValues.java index b6d33e2ed..7306e153f 100644 --- a/src/test/java/net/openhft/chronicle/map/TestBooleanValues.java +++ b/src/test/java/net/openhft/chronicle/map/TestBooleanValues.java @@ -11,13 +11,13 @@ import java.io.IOException; */ public class TestBooleanValues { - @Test - @Ignore /** * see issue http://stackoverflow.com/questions/26219313/strange-npe-from-chronicle-map-toy-code */ + @Test public void testTestBooleanValues() throws IOException, InterruptedException { - ChronicleMap map = ChronicleMapBuilder.of(Integer.class, Boolean.class).create(); + ChronicleMap map = + ChronicleMapBuilder.of(Integer.class, Boolean.class).create(); map.put(7, true); Boolean currentValue = map.get(7); // IllegalStateException here }