ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/extra/ReadMostlyVector.java
(Generate patch)

Comparing jsr166/src/jsr166e/extra/ReadMostlyVector.java (file contents):
Revision 1.29 by jsr166, Fri Oct 12 16:23:28 2012 UTC vs.
Revision 1.33 by jsr166, Wed Jan 2 04:35:20 2013 UTC

# Line 14 | Line 14 | import java.util.*;
14   * throughput when invocations of read-only methods by multiple
15   * threads are most common.
16   *
17 < * <p> The iterators returned by this class's {@link #iterator()
17 > * <p>The iterators returned by this class's {@link #iterator()
18   * iterator} and {@link #listIterator(int) listIterator} methods are
19   * best-effort in the presence of concurrent modifications, and do
20   * <em>NOT</em> throw {@link ConcurrentModificationException}.  An
# Line 93 | Line 93 | public class ReadMostlyVector<E>
93       * Creates an empty vector with the given initial capacity.
94       *
95       * @param initialCapacity the initial capacity of the underlying array
96     *
96       * @throws IllegalArgumentException if initial capacity is negative
97       */
98      public ReadMostlyVector(int initialCapacity) {
# Line 172 | Line 171 | public class ReadMostlyVector<E>
171      static int findFirstIndex(Object[] items, Object x, int index, int fence) {
172          int len;
173          if (items != null && (len = items.length) > 0) {
174 <            int start = (index < 0)? 0 : index;
174 >            int start = (index < 0) ? 0 : index;
175              int bound = (fence < len) ? fence : len;
176              for (int i = start; i < bound; ++i) {
177                  Object e = items[i];
# Line 406 | Line 405 | public class ReadMostlyVector<E>
405                  sb.append('[');
406                  for (;;) {
407                      Object e = items[i];
408 <                    sb.append((e == this)? "(this Collection)" : e.toString());
408 >                    sb.append((e == this) ? "(this Collection)" : e.toString());
409                      if (++i < fence)
410                          sb.append(',').append(' ');
411                      else
# Line 1039 | Line 1038 | public class ReadMostlyVector<E>
1038              long stamp = lock.writeLock();
1039              try {
1040                  Object[] items = array;
1041 <                int cap = (items == null)? 0 : items.length;
1041 >                int cap = (items == null) ? 0 : items.length;
1042                  if (minCapacity - cap > 0)
1043                      grow(minCapacity);
1044              } finally {
# Line 1248 | Line 1247 | public class ReadMostlyVector<E>
1247  
1248      static final class ReadMostlyVectorSublist<E>
1249              implements List<E>, RandomAccess, java.io.Serializable {
1250 <        static final long serialVersionUID = 3041673470172026059L;
1250 >        private static final long serialVersionUID = 3041673470172026059L;
1251  
1252          final ReadMostlyVector<E> list;
1253          final int offset;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines