commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r753392 - in /commons/proper/collections/branches/collections_jdk5_branch/src: java/org/apache/commons/collections/IteratorUtils.java test/org/apache/commons/collections/TestIteratorUtils.java
Date Fri, 13 Mar 2009 20:40:05 GMT
Author: mbenson
Date: Fri Mar 13 20:39:53 2009
New Revision: 753392

URL: http://svn.apache.org/viewvc?rev=753392&view=rev
Log:
revert IteratorUtils stuff; toList() works fine for this--duh

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

Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/IteratorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/IteratorUtils.java?rev=753392&r1=753391&r2=753392&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/IteratorUtils.java
(original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/IteratorUtils.java
Fri Mar 13 20:39:53 2009
@@ -916,20 +916,4 @@
         return singletonIterator(obj);
     }
 
-    /**
-     * Return an {@link Iterable} so that any {@link Iterator} can be used
-     * with the "foreach" statement.
-     * @param <T> element type
-     * @param iterator to wrap
-     * @return Iterable<T>
-     * @since Commons Collections 5
-     * @TODO fix version
-     */
-    public static <T> Iterable<T> iterable(final Iterator<T> iterator)
{
-        return new Iterable<T>() {
-            public Iterator<T> iterator() {
-                return iterator;
-            }
-        };
-    }
 }

Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java?rev=753392&r1=753391&r2=753392&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java
(original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java
Fri Mar 13 20:39:53 2009
@@ -725,17 +725,4 @@
         }
     }
 
-    public void testIterable() throws Exception {
-        Integer[] array = new Integer[10];
-        for (int i = 0; i < array.length; i++) {
-            array[i] = i;
-        }
-        Iterator<Integer> it = Arrays.asList(array).iterator();
-        int i = 0;
-        for (Integer o : IteratorUtils.iterable(it)) {
-            assertEquals(i, o.intValue());
-            i++;
-        }
-        assertEquals(i, array.length);
-    }
 }



Mime
View raw message