Fixed TODO wrt argument checks.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1382165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce4113cb92
commit
02fadfb568
|
@ -136,9 +136,8 @@ public class DefaultedMap<K, V> extends AbstractMapDecorator<K, V> implements Se
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new empty <code>DefaultedMap</code> that decorates
|
* Constructs a new empty <code>DefaultedMap</code> that decorates a <code>HashMap</code>.
|
||||||
* a <code>HashMap</code>.
|
*
|
||||||
* <p>
|
|
||||||
* @param defaultValueTransformer transformer to use to generate missing values.
|
* @param defaultValueTransformer transformer to use to generate missing values.
|
||||||
*/
|
*/
|
||||||
public DefaultedMap(Transformer<? super K, ? extends V> defaultValueTransformer) {
|
public DefaultedMap(Transformer<? super K, ? extends V> defaultValueTransformer) {
|
||||||
|
@ -151,10 +150,12 @@ public class DefaultedMap<K, V> extends AbstractMapDecorator<K, V> implements Se
|
||||||
* @param map the map to decorate, must not be null
|
* @param map the map to decorate, must not be null
|
||||||
* @param defaultValueTransformer the value transformer to use
|
* @param defaultValueTransformer the value transformer to use
|
||||||
* @throws IllegalArgumentException if map or transformer is null
|
* @throws IllegalArgumentException if map or transformer is null
|
||||||
* TODO does not check for null transformer: fix code or Javadoc
|
|
||||||
*/
|
*/
|
||||||
protected DefaultedMap(Map<K, V> map, Transformer<? super K, ? extends V> defaultValueTransformer) {
|
protected DefaultedMap(Map<K, V> map, Transformer<? super K, ? extends V> defaultValueTransformer) {
|
||||||
super(map);
|
super(map);
|
||||||
|
if (defaultValueTransformer == null) {
|
||||||
|
throw new IllegalArgumentException("transformer must not be null");
|
||||||
|
}
|
||||||
this.value = defaultValueTransformer;
|
this.value = defaultValueTransformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue