commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1382165 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java
Date Fri, 07 Sep 2012 20:37:12 GMT
Author: tn
Date: Fri Sep  7 20:37:11 2012
New Revision: 1382165

URL: http://svn.apache.org/viewvc?rev=1382165&view=rev
Log:
Fixed TODO wrt argument checks.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java?rev=1382165&r1=1382164&r2=1382165&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/DefaultedMap.java
Fri Sep  7 20:37:11 2012
@@ -136,9 +136,8 @@ public class DefaultedMap<K, V> extends 
     }
 
     /**
-     * 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 
      * @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;
     }
 



Mime
View raw message