--- jsr166/src/jsr166e/extra/ReadMostlyVector.java 2011/12/04 01:25:16 1.14 +++ jsr166/src/jsr166e/extra/ReadMostlyVector.java 2011/12/31 05:38:24 1.17 @@ -667,28 +667,7 @@ public class ReadMostlyVector } public int indexOf(Object o) { - final SequenceLock lock = this.lock; - for (;;) { - long seq = lock.awaitAvailability(); - Object[] items = array; - int n = count; - if (n <= items.length) { - for (int i = 0; i < n; ++i) { - Object e = items[i]; - if (lock.getSequence() != seq) { - lock.lock(); - try { - return rawIndexOf(o, 0, count); - } finally { - lock.unlock(); - } - } - else if ((o == null) ? e == null : o.equals(e)) - return i; - } - return -1; - } - } + return indexOf(o, 0); } public boolean isEmpty() { @@ -954,7 +933,7 @@ public class ReadMostlyVector if (index < 0) ex = true; else - idx = rawIndexOf(o, 0, count); + idx = rawIndexOf(o, index, count); } finally { lock.unlock(); } @@ -1136,7 +1115,7 @@ public class ReadMostlyVector } } - static final class Itr implements ListIterator, Enumeration { + static final class Itr implements ListIterator, Enumeration { final ReadMostlyVector list; final SequenceLock lock; Object[] items;