diff --git a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java index a1345c874..dec6ed9c3 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java @@ -382,7 +382,7 @@ public abstract class VanillaChronicleHash implements return headerBuffer; } - private IOException throwRecoveryOrReturnIOException(String message, boolean recover) { - if (recover) { - throw new ChronicleHashRecoveryFailedException(message); - } else { - return new IOException(message); - } - } - private static long headerChecksum(ByteBuffer headerBuffer, int headerSize) { return LongHashFunction.xx_r39().hashBytes(headerBuffer, SIZE_WORD_OFFSET, headerSize + 4); } @@ -1569,7 +1562,7 @@ public final class ChronicleMapBuilder implements VanillaChronicleMap map, File file, RandomAccessFile raf, ByteBuffer headerBuffer, int headerSize) throws IOException { FileChannel fileChannel = raf.getChannel(); - map.initBeforeMapping(file, fileChannel, headerBuffer.limit()); + map.initBeforeMapping(file, fileChannel, headerBuffer.limit(), false); map.createMappedStoreAndSegments(file, raf); commitChronicleMapReady(map, raf, headerBuffer, headerSize); establishReplication(map); @@ -1597,7 +1590,7 @@ public final class ChronicleMapBuilder implements Wire wire = new TextWire(headerBytes); VanillaChronicleMap map = wire.getValueIn().typedMarshallable(); assert map != null; - map.initBeforeMapping(file, fileChannel, headerBuffer.limit()); + map.initBeforeMapping(file, fileChannel, headerBuffer.limit(), recover); long expectedFileLength = map.expectedFileSize(); if (!recover && expectedFileLength != file.length()) { throw new IOException("The file " + file + " the map is serialized from " +