diff --git a/classpath/java/util/AbstractList.java b/classpath/java/util/AbstractList.java index e1d4f3c307..fb9ccdccfd 100644 --- a/classpath/java/util/AbstractList.java +++ b/classpath/java/util/AbstractList.java @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, Avian Contributors +/* Copyright (c) 2009-2011, Avian Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided @@ -22,4 +22,20 @@ public abstract class AbstractList extends AbstractCollection public ListIterator listIterator() { return new Collections.ArrayListIterator(this); } + + public int indexOf(Object o) { + int i = 0; + for (T v: this) { + if (o == null) { + if (v == null) { + return i; + } + } else if (o.equals(v)) { + return i; + } + + ++ i; + } + return -1; + } }