Fix a bug in VanillaChronicleMap.putValue() -- avoid allocation of overlapping areas

This commit is contained in:
leventov
2015-12-14 16:14:29 +03:00
parent 5d92a8babe
commit e928cbfe90
2 changed files with 7 additions and 6 deletions
@@ -1476,9 +1476,8 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
// key is found
entry.skip(keySize);
long timestampPos = entry.position();
long replacedTimestamp = entry.readLong();
byte replacedIdentifier = entry.readByte();
entry.position(timestampPos);
long replacedTimestamp = entry.readLong(timestampPos);
byte replacedIdentifier = entry.readByte(timestampPos + 8);
if (shouldIgnore(entry, timestamp, identifier)) {
// the following assert should be enabled, but TimeBasedReplicationTest
// intentionally violates the explained invariant, => assertion fails.