HCOLL-161 eliminated inconsistency between VanillaChronicleMap and DirectBytesBuffer serializers

This commit is contained in:
leventov
2014-10-07 20:11:39 +04:00
parent 593f0fe7b8
commit 4913062481
3 changed files with 6 additions and 5 deletions
@@ -823,7 +823,8 @@ public class ChronicleMapBuilder<K, V> implements Cloneable {
public ChronicleMap<K, V> create() throws IOException {
VanillaChronicleMap<K, ?, ?, V, ?, ?> 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);
}
@@ -200,7 +200,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, KI>,
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 {
@@ -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<Integer, Boolean> map = ChronicleMapBuilder.of(Integer.class, Boolean.class).create();
ChronicleMap<Integer, Boolean> map =
ChronicleMapBuilder.of(Integer.class, Boolean.class).create();
map.put(7, true);
Boolean currentValue = map.get(7); // IllegalStateException here
}