You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/02/07 18:15:24 UTC

svn commit: r1443606 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java

Author: tn
Date: Thu Feb  7 17:15:24 2013
New Revision: 1443606

URL: http://svn.apache.org/viewvc?rev=1443606&view=rev
Log:
[COLLECTIONS-441] throw an internal error when clone failed instead of returning null, which is against the contract of clone, also fixes a findbug error.

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

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java?rev=1443606&r1=1443605&r2=1443606&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java Thu Feb  7 17:15:24 2013
@@ -1278,6 +1278,7 @@ public class AbstractHashedMap<K, V> ext
      * <code>Cloneable</code> interface and make this method public.
      *
      * @return a shallow clone
+     * @throws java.lang.InternalError if {@link super#clone()} failed
      */
     @Override
     @SuppressWarnings("unchecked")
@@ -1294,7 +1295,7 @@ public class AbstractHashedMap<K, V> ext
             cloned.putAll(this);
             return cloned;
         } catch (final CloneNotSupportedException ex) {
-            return null;  // should never happen
+            throw new InternalError();
         }
     }