commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1023843 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java
Date Mon, 18 Oct 2010 15:21:40 GMT
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;
                 }



Mime
View raw message