You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/10/18 17:21:40 UTC

svn commit: r1023843 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java

Author: sebb
Date: Mon Oct 18 15:21:39 2010
New Revision: 1023843

URL: http://svn.apache.org/viewvc?rev=1023843&view=rev
Log:
Make indexOf generic like the other methods

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java?rev=1023843&r1=1023842&r2=1023843&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java (original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java Mon Oct 18 15:21:39 2010
@@ -412,10 +412,10 @@ public class ListUtils {
      * @param predicate  the predicate to use, may be null
      * @return the first index of an Object in the List which matches the predicate or -1 if none could be found
      */
-    public static int indexOf(List list, Predicate predicate) {
+    public static <E> int indexOf(List<E> list, Predicate<E> predicate) {
         if (list != null && predicate != null) {
             for (int i = 0; i < list.size(); i++) {
-                Object item = list.get(i);
+                E item = list.get(i);
                 if (predicate.evaluate(item)) {
                     return i;
                 }