mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
ChronicleMapBuilder.defaultValue() shouldn't be null because ChronicleMap generally doesn't support neither null key nor null values
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user