ChronicleMapBuilder.defaultValue() shouldn't be null because ChronicleMap generally doesn't support neither null key nor null values

This commit is contained in:
leventov
2014-12-15 22:49:53 +07:00
parent afb223be67
commit 4a54633577
2 changed files with 2 additions and 30 deletions
@@ -940,10 +940,10 @@ public final class ChronicleMapBuilder<K, V> implements Cloneable,
* @see #prepareDefaultValueBytes(PrepareValueBytes)
*/
public ChronicleMapBuilder<K, V> defaultValue(V defaultValue) {
if (defaultValue == null)
throw new IllegalArgumentException("default ChronicleMap value couldn't be null");
this.defaultValue = defaultValue;
this.defaultValueProvider = null;
if (defaultValue == null)
defaultValueProvider = NullValueProvider.INSTANCE;
this.prepareValueBytes = null;
return this;
}