mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-161 eliminated inconsistency between VanillaChronicleMap and DirectBytesBuffer serializers
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user