commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1187624 - in /commons/proper/functor/trunk/src/test/java/org/apache/commons/functor: core/comparator/TestComparatorFunction.java example/kata/four/NthColumn.java
Date Sat, 22 Oct 2011 01:25:48 GMT
Author: sebb
Date: Sat Oct 22 01:25:48 2011
New Revision: 1187624

URL: http://svn.apache.org/viewvc?rev=1187624&view=rev
Log:
Unnecessary casts

Modified:
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/four/NthColumn.java

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java?rev=1187624&r1=1187623&r2=1187624&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java
Sat Oct 22 01:25:48 2011
@@ -44,35 +44,35 @@ public class TestComparatorFunction exte
     public void testEvaluate() {
         ComparatorFunction<Integer> f = ComparatorFunction.<Integer>instance();
 
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(Integer.MAX_VALUE)))).intValue()
== 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(1)))).intValue()
> 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(0)))).intValue()
> 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(-1)))).intValue()
> 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(Integer.MIN_VALUE)))).intValue()
> 0);
-
-        assertTrue(((Integer)(f.evaluate(new Integer(1),new Integer(Integer.MAX_VALUE)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(1),new Integer(1)))).intValue() == 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(1),new Integer(0)))).intValue() >
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(1),new Integer(-1)))).intValue() >
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(1),new Integer(Integer.MIN_VALUE)))).intValue()
> 0);
-
-        assertTrue(((Integer)(f.evaluate(new Integer(0),new Integer(Integer.MAX_VALUE)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(0),new Integer(1)))).intValue() <
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(0),new Integer(0)))).intValue() == 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(0),new Integer(-1)))).intValue() >
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(0),new Integer(Integer.MIN_VALUE)))).intValue()
> 0);
-
-        assertTrue(((Integer)(f.evaluate(new Integer(-1),new Integer(Integer.MAX_VALUE)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(-1),new Integer(1)))).intValue() <
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(-1),new Integer(0)))).intValue() <
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(-1),new Integer(-1)))).intValue() ==
0);
-        assertTrue(((Integer)(f.evaluate(new Integer(-1),new Integer(Integer.MIN_VALUE)))).intValue()
> 0);
-
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(Integer.MAX_VALUE)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(1)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(0)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(-1)))).intValue()
< 0);
-        assertTrue(((Integer)(f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(Integer.MIN_VALUE)))).intValue()
== 0);
+        assertTrue((f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(Integer.MAX_VALUE))).intValue()
== 0);
+        assertTrue((f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(1))).intValue()
> 0);
+        assertTrue((f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(0))).intValue()
> 0);
+        assertTrue((f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(-1))).intValue()
> 0);
+        assertTrue((f.evaluate(new Integer(Integer.MAX_VALUE),new Integer(Integer.MIN_VALUE))).intValue()
> 0);
+
+        assertTrue((f.evaluate(new Integer(1),new Integer(Integer.MAX_VALUE))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(1),new Integer(1))).intValue() == 0);
+        assertTrue((f.evaluate(new Integer(1),new Integer(0))).intValue() > 0);
+        assertTrue((f.evaluate(new Integer(1),new Integer(-1))).intValue() > 0);
+        assertTrue((f.evaluate(new Integer(1),new Integer(Integer.MIN_VALUE))).intValue()
> 0);
+
+        assertTrue((f.evaluate(new Integer(0),new Integer(Integer.MAX_VALUE))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(0),new Integer(1))).intValue() < 0);
+        assertTrue((f.evaluate(new Integer(0),new Integer(0))).intValue() == 0);
+        assertTrue((f.evaluate(new Integer(0),new Integer(-1))).intValue() > 0);
+        assertTrue((f.evaluate(new Integer(0),new Integer(Integer.MIN_VALUE))).intValue()
> 0);
+
+        assertTrue((f.evaluate(new Integer(-1),new Integer(Integer.MAX_VALUE))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(-1),new Integer(1))).intValue() < 0);
+        assertTrue((f.evaluate(new Integer(-1),new Integer(0))).intValue() < 0);
+        assertTrue((f.evaluate(new Integer(-1),new Integer(-1))).intValue() == 0);
+        assertTrue((f.evaluate(new Integer(-1),new Integer(Integer.MIN_VALUE))).intValue()
> 0);
+
+        assertTrue((f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(Integer.MAX_VALUE))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(1))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(0))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(-1))).intValue()
< 0);
+        assertTrue((f.evaluate(new Integer(Integer.MIN_VALUE),new Integer(Integer.MIN_VALUE))).intValue()
== 0);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/four/NthColumn.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/four/NthColumn.java?rev=1187624&r1=1187623&r2=1187624&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/four/NthColumn.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/four/NthColumn.java
Sat Oct 22 01:25:48 2011
@@ -33,7 +33,7 @@ public final class NthColumn implements 
     }
 
     public String evaluate(String obj) {
-        StringTokenizer toker = new StringTokenizer((String) obj);
+        StringTokenizer toker = new StringTokenizer(obj);
         for (int count = 0; count < n && toker.hasMoreTokens();count++) {
             toker.nextToken();
         }



Mime
View raw message