commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1476868 - /commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java
Date Sun, 28 Apr 2013 23:57:35 GMT
Author: sebb
Date: Sun Apr 28 23:57:35 2013
New Revision: 1476868

URL: http://svn.apache.org/r1476868
Log:
Ensure oddness check works even for negative numbers

Modified:
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java?rev=1476868&r1=1476867&r2=1476868&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java
(original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java
Sun Apr 28 23:57:35 2013
@@ -65,7 +65,7 @@ public class FilterListIteratorTest exte
         for (int i = 0; i < 20; i++) {
             list.add(Integer.valueOf(i));
             if (i % 2 == 0) { evens.add(Integer.valueOf(i)); }
-            if (i % 2 == 1) { odds.add(Integer.valueOf(i)); }
+            if (i % 2 != 0) { odds.add(Integer.valueOf(i)); }
             if (i % 3 == 0) { threes.add(Integer.valueOf(i)); }
             if (i % 4 == 0) { fours.add(Integer.valueOf(i)); }
             if (i % 6 == 0) { sixes.add(Integer.valueOf(i)); }
@@ -91,7 +91,7 @@ public class FilterListIteratorTest exte
 
         oddPred = new Predicate<Integer>() {
             public boolean evaluate(final Integer x) { 
-                return x % 2 == 1;
+                return x % 2 != 0; //works for all numbers, not just >= 0 as is the case
for "x % 2 == 1"
             }
         };
 



Mime
View raw message