commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skes...@apache.org
Subject svn commit: r593381 - /commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
Date Fri, 09 Nov 2007 01:35:23 GMT
Author: skestle
Date: Thu Nov  8 17:35:22 2007
New Revision: 593381

URL: http://svn.apache.org/viewvc?rev=593381&view=rev
Log:
Fixed ambiguous method call error due to auto-boxing.  (Seems to be introduced in jdk 1.5.0_07
on Windows)

Modified:
    commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java

Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java?rev=593381&r1=593380&r2=593381&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
(original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
Thu Nov  8 17:35:22 2007
@@ -151,18 +151,18 @@
     @Test
     public void getCardinalityMap() {
         Map<Number, Integer> freqA = CollectionUtils.<Number, Integer>getCardinalityMap(iterableA);
-        assertEquals(1, freqA.get(1));
-        assertEquals(2, freqA.get(2));
-        assertEquals(3, freqA.get(3));
-        assertEquals(4, freqA.get(4));
+        assertEquals(1, (int) freqA.get(1));
+        assertEquals(2, (int) freqA.get(2));
+        assertEquals(3, (int) freqA.get(3));
+        assertEquals(4, (int) freqA.get(4));
         assertNull(freqA.get(5));
 
         Map<Long, Integer> freqB = CollectionUtils.getCardinalityMap(iterableB);
         assertNull(freqB.get(1L));
-        assertEquals(4, freqB.get(2L));
-        assertEquals(3, freqB.get(3L));
-        assertEquals(2, freqB.get(4L));
-        assertEquals(1, freqB.get(5L));
+        assertEquals(4, (int) freqB.get(2L));
+        assertEquals(3, (int) freqB.get(3L));
+        assertEquals(2, (int) freqB.get(4L));
+        assertEquals(1, (int) freqB.get(5L));
     }
 
     @Test
@@ -585,9 +585,9 @@
     public void getFromIterator() throws Exception {
         // Iterator, entry exists
         Iterator<Integer> iterator = iterableA.iterator();
-        assertEquals(1, CollectionUtils.get(iterator, 0));
+        assertEquals(1, (int) CollectionUtils.get(iterator, 0));
         iterator = iterableA.iterator();
-        assertEquals(2, CollectionUtils.get(iterator, 1));
+        assertEquals(2, (int) CollectionUtils.get(iterator, 1));
 
         // Iterator, non-existent entry
         try {
@@ -873,7 +873,8 @@
     };
 
 //Up to here
-    @Test
+    @SuppressWarnings("cast")
+	@Test
     public void filter() {
         List<Integer> ints = new ArrayList<Integer>();
         ints.add(1);
@@ -882,8 +883,8 @@
         ints.add(3);
         Iterable<Integer> iterable = ints;
         CollectionUtils.filter(iterable, EQUALS_TWO);
-        assertEquals(1, ints.size());
-        assertEquals(2, ints.get(0));
+        assertEquals(1, (int) ints.size());
+        assertEquals(2, (int) ints.get(0));
     }
     
     @Test



Mime
View raw message