commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1554554 - in /commons/proper/collections/trunk/src: changes/changes.xml main/java/org/apache/commons/collections4/CollectionUtils.java
Date Tue, 31 Dec 2013 16:24:45 GMT
Author: tn
Date: Tue Dec 31 16:24:45 2013
New Revision: 1554554

URL: http://svn.apache.org/r1554554
Log:
[COLLECTIONS-506] Added clarification to CollectionUtils wrt general contract of Object#equals
and hashCode.

Modified:
    commons/proper/collections/trunk/src/changes/changes.xml
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java

Modified: commons/proper/collections/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/changes/changes.xml?rev=1554554&r1=1554553&r2=1554554&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/changes/changes.xml (original)
+++ commons/proper/collections/trunk/src/changes/changes.xml Tue Dec 31 16:24:45 2013
@@ -22,6 +22,11 @@
   <body>
 
   <release version="4.0.1" date="TBD" description="">
+    <action issue="COLLECTIONS-506" dev="tn" type="fix" due-to="Anthony Communier">
+      Added javadoc clarification to class "CollectionUtils" that input objects which
+      override "Object#equals(Object)" must also maintain the general contract of
+      "Object#hashCode()" as various utility methods take advantage of sets/maps/bags.
+    </action>
     <action issue="COLLECTIONS-503" dev="tn" type="add" due-to="Josh Cain">
       Added new transformer "IfTransformer" and factory methods "TransformerUtils#ifTransformer(...)"
       which replace "TransformerUtils#switchTransformer(Predicate, Transformer, Transformer)".

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java?rev=1554554&r1=1554553&r2=1554554&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java
Tue Dec 31 16:24:45 2013
@@ -43,6 +43,10 @@ import org.apache.commons.collections4.i
 /**
  * Provides utility methods and decorators for {@link Collection} instances.
  * <p>
+ * Various utility methods might put the input objects into a Set/Map/Bag. In case
+ * the input objects override {@link Object#equals(Object)}, it is mandatory that
+ * the general contract of the {@link Object#hashCode()} method is maintained.
+ * <p>
  * NOTE: From 4.0, method parameters will take {@link Iterable} objects when possible.
  *
  * @since 1.0



Mime
View raw message