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:
Thomas Neidhart 2012-09-07 20:37:11 +00:00
parent ce4113cb92
commit 02fadfb568
1 changed files with 5 additions and 4 deletions

View File

@ -136,9 +136,8 @@ public class DefaultedMap<K, V> extends AbstractMapDecorator<K, V> implements Se
}
/**
* Constructs a new empty <code>DefaultedMap</code> that decorates
* a <code>HashMap</code>.
* <p>
* Constructs a new empty <code>DefaultedMap</code> that decorates a <code>HashMap</code>.
*
* @param defaultValueTransformer transformer to use to generate missing values.
*/
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 defaultValueTransformer the value transformer to use
* @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) {
super(map);
if (defaultValueTransformer == null) {
throw new IllegalArgumentException("transformer must not be null");
}
this.value = defaultValueTransformer;
}