commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections MapUtils.java
Date Sat, 26 Apr 2003 14:28:31 GMT
scolebourne    2003/04/26 07:28:31

  Modified:    collections/src/java/org/apache/commons/collections
                        MapUtils.java
  Log:
  Document null behaviour
  
  Revision  Changes    Path
  1.22      +10 -6     jakarta-commons/collections/src/java/org/apache/commons/collections/MapUtils.java
  
  Index: MapUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/MapUtils.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- MapUtils.java	26 Apr 2003 14:24:48 -0000	1.21
  +++ MapUtils.java	26 Apr 2003 14:28:31 -0000	1.22
  @@ -621,8 +621,9 @@
        * Gets a new Properties object initialised with the values from a Map.
        * A null input will return an empty properties object.
        * 
  -     * @param map  the map to convert to a Properties object
  +     * @param map  the map to convert to a Properties object, may not be null
        * @return the properties object
  +     * @throws NullPointerException if the map is null
        */
       public static Properties toProperties(Map map) {
           Properties answer = new Properties();
  @@ -640,8 +641,9 @@
       /**
        * Creates a new HashMap using data copied from a ResourceBundle.
        * 
  -     * @param resourceBundle  the resource bundle to convert
  +     * @param resourceBundle  the resource bundle to convert, may not be null
        * @return the hashmap containing the data
  +     * @throws NullPointerException if the bundle is null
        */
       public static Map toMap(ResourceBundle resourceBundle) {
           Enumeration enum = resourceBundle.getKeys();
  @@ -763,8 +765,9 @@
        * value, but the exact key which will be mapped is undefined.
        * 
        * @see DoubleOrderedMap
  -     * @param map  the map to invert
  +     * @param map  the map to invert, may not be null
        * @return a new HashMap containing the inverted data
  +     * @throws NullPointerException if the map is null
        */
       public static Map invertMap(Map map) {
           Map out = new HashMap(map.size());
  @@ -784,9 +787,10 @@
        * We will still throw a NPE if the key is null cause that should
        * never happen.
        * 
  -     * @param map  the map to add to
  +     * @param map  the map to add to, may not be null
        * @param key  the key
        * @param value  the value
  +     * @throws NullPointerException if the map is null
        */
       public static void safeAddToMap(Map map, Object key, Object value) throws NullPointerException
{
           if (value == null) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message