Make replace() returns on absent entry consistent

This commit is contained in:
leventov
2015-08-17 23:09:00 +03:00
parent 39915db127
commit 2f32764082
2 changed files with 2 additions and 2 deletions
@@ -1435,7 +1435,7 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
return result;
}
// key is not found
return readValue.readNull();
return expectedValue == null ? readValue.readNull() : Boolean.FALSE;
} finally {
segmentState.close();
writeUnlock();
@@ -2603,7 +2603,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
readValue, toValue, pos, offset, entry, hashLookup);
}
// key is not found
return expectedValue == null ? null : Boolean.FALSE;
return expectedValue == null ? readValue.readNull() : Boolean.FALSE;
} finally {
segmentState.close();
writeUnlock();