commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1443606 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/map/AbstractHashedMap.java
Date Thu, 07 Feb 2013 17:15:24 GMT
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();
         }
     }
 



Mime
View raw message