ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/AbstractList.java
(Generate patch)

Comparing jsr166/src/main/java/util/AbstractList.java (file contents):
Revision 1.21 by jsr166, Tue Sep 1 22:28:19 2009 UTC vs.
Revision 1.23 by jsr166, Wed Sep 1 20:12:39 2010 UTC

# Line 175 | Line 175 | public abstract class AbstractList<E> ex
175       * @throws NullPointerException {@inheritDoc}
176       */
177      public int indexOf(Object o) {
178 <        ListIterator<E> e = listIterator();
178 >        ListIterator<E> it = listIterator();
179          if (o==null) {
180 <            while (e.hasNext())
181 <                if (e.next()==null)
182 <                    return e.previousIndex();
180 >            while (it.hasNext())
181 >                if (it.next()==null)
182 >                    return it.previousIndex();
183          } else {
184 <            while (e.hasNext())
185 <                if (o.equals(e.next()))
186 <                    return e.previousIndex();
184 >            while (it.hasNext())
185 >                if (o.equals(it.next()))
186 >                    return it.previousIndex();
187          }
188          return -1;
189      }
# Line 200 | Line 200 | public abstract class AbstractList<E> ex
200       * @throws NullPointerException {@inheritDoc}
201       */
202      public int lastIndexOf(Object o) {
203 <        ListIterator<E> e = listIterator(size());
203 >        ListIterator<E> it = listIterator(size());
204          if (o==null) {
205 <            while (e.hasPrevious())
206 <                if (e.previous()==null)
207 <                    return e.nextIndex();
205 >            while (it.hasPrevious())
206 >                if (it.previous()==null)
207 >                    return it.nextIndex();
208          } else {
209 <            while (e.hasPrevious())
210 <                if (o.equals(e.previous()))
211 <                    return e.nextIndex();
209 >            while (it.hasPrevious())
210 >                if (o.equals(it.previous()))
211 >                    return it.nextIndex();
212          }
213          return -1;
214      }
# Line 517 | Line 517 | public abstract class AbstractList<E> ex
517  
518          ListIterator<E> e1 = listIterator();
519          ListIterator e2 = ((List) o).listIterator();
520 <        while(e1.hasNext() && e2.hasNext()) {
520 >        while (e1.hasNext() && e2.hasNext()) {
521              E o1 = e1.next();
522              Object o2 = e2.next();
523              if (!(o1==null ? o2==null : o1.equals(o2)))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines