From 02fadfb56855365a2f203644ad5663d2bbfc6307 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Fri, 7 Sep 2012 20:37:11 +0000 Subject: [PATCH] Fixed TODO wrt argument checks. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1382165 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/collections/map/DefaultedMap.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/collections/map/DefaultedMap.java b/src/main/java/org/apache/commons/collections/map/DefaultedMap.java index 6f4a4d793..bf5907c00 100644 --- a/src/main/java/org/apache/commons/collections/map/DefaultedMap.java +++ b/src/main/java/org/apache/commons/collections/map/DefaultedMap.java @@ -136,9 +136,8 @@ public class DefaultedMap extends AbstractMapDecorator implements Se } /** - * Constructs a new empty DefaultedMap that decorates - * a HashMap. - *

+ * Constructs a new empty DefaultedMap that decorates a HashMap. + * * @param defaultValueTransformer transformer to use to generate missing values. */ public DefaultedMap(Transformer defaultValueTransformer) { @@ -151,10 +150,12 @@ public class DefaultedMap extends AbstractMapDecorator 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 map, Transformer defaultValueTransformer) { super(map); + if (defaultValueTransformer == null) { + throw new IllegalArgumentException("transformer must not be null"); + } this.value = defaultValueTransformer; }