commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1592874 - in /commons/proper/collections/trunk/src: changes/changes.xml main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
Date Tue, 06 May 2014 20:42:25 GMT
Author: tn
Date: Tue May  6 20:42:24 2014
New Revision: 1592874

URL: http://svn.apache.org/r1592874
Log:
[COLLECTIONS-512] Fix equals method of FixedOrderComparator.

Modified:
    commons/proper/collections/trunk/src/changes/changes.xml
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.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=1592874&r1=1592873&r2=1592874&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/changes/changes.xml (original)
+++ commons/proper/collections/trunk/src/changes/changes.xml Tue May  6 20:42:24 2014
@@ -23,7 +23,8 @@
 
   <release version="4.1" date="TBD" description="">
     <action issue="COLLECTIONS-512" dev="tn" type="fix" due-to="Cyrille Artho">
-      "TransformingComparator" did not comply with the contract of Object#equals.
+      "TransformingComparator" and "FixedOrderComparator" did not comply with
+      the contract of "Object#equals".
     </action>
     <action issue="COLLECTIONS-510" dev="tn" type="fix" due-to="Hollis Waite">
       Fix compilation errors when using source level 1.8 and a recent java 8 compiler.

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java?rev=1592874&r1=1592873&r2=1592874&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
Tue May  6 20:42:24 2014
@@ -285,12 +285,12 @@ public class FixedOrderComparator<T> imp
         }
         if (object.getClass().equals(this.getClass())) {
             final FixedOrderComparator<?> comp = (FixedOrderComparator<?>) object;
-            return null == map ? null == comp.map : map.equals(comp.map) &&
-                    null == unknownObjectBehavior ? null == comp.unknownObjectBehavior :
+            return (null == map ? null == comp.map : map.equals(comp.map)) &&
+                   (null == unknownObjectBehavior ? null == comp.unknownObjectBehavior :
                         unknownObjectBehavior == comp.unknownObjectBehavior &&
-                    counter == comp.counter &&
-                    isLocked == comp.isLocked &&
-                    unknownObjectBehavior == comp.unknownObjectBehavior;
+                        counter == comp.counter &&
+                        isLocked == comp.isLocked &&
+                        unknownObjectBehavior == comp.unknownObjectBehavior);
         }
         return false;
     }



Mime
View raw message