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

Comparing jsr166/src/main/java/util/Vector.java (file contents):
Revision 1.42 by jsr166, Wed Dec 21 05:14:01 2016 UTC vs.
Revision 1.46 by jsr166, Sat May 6 06:49:46 2017 UTC

# Line 70 | Line 70 | import java.util.function.UnaryOperator;
70   *
71   * <p>As of the Java 2 platform v1.2, this class was retrofitted to
72   * implement the {@link List} interface, making it a member of the
73 < * <a href="{@docRoot}/../technotes/guides/collections/index.html">
73 > * <a href="{@docRoot}/java/util/package-summary.html#CollectionsFramework">
74   * Java Collections Framework</a>.  Unlike the new collection
75   * implementations, {@code Vector} is synchronized.  If a thread-safe
76   * implementation is not needed, it is recommended to use {@link
# Line 307 | Line 307 | public class Vector<E>
307          if (newSize > elementData.length)
308              grow(newSize);
309          final Object[] es = elementData;
310 <        for (int to = elementCount, i = elementCount = newSize; i < to; i++)
310 >        for (int to = elementCount, i = newSize; i < to; i++)
311              es[i] = null;
312 +        elementCount = newSize;
313      }
314  
315      /**
# Line 1425 | Line 1426 | public class Vector<E>
1426          private int fence; // -1 until used; then one past last index
1427          private int expectedModCount; // initialized when fence set
1428  
1429 <        /** Creates new spliterator covering the given range */
1429 >        /** Creates new spliterator covering the given range. */
1430          VectorSpliterator(Object[] array, int origin, int fence,
1431                            int expectedModCount) {
1432              this.array = array;
# Line 1454 | Line 1455 | public class Vector<E>
1455  
1456          @SuppressWarnings("unchecked")
1457          public boolean tryAdvance(Consumer<? super E> action) {
1458 +            Objects.requireNonNull(action);
1459              int i;
1458            if (action == null)
1459                throw new NullPointerException();
1460              if (getFence() > (i = index)) {
1461                  index = i + 1;
1462                  action.accept((E)array[i]);
# Line 1469 | Line 1469 | public class Vector<E>
1469  
1470          @SuppressWarnings("unchecked")
1471          public void forEachRemaining(Consumer<? super E> action) {
1472 <            if (action == null)
1473 <                throw new NullPointerException();
1472 >            Objects.requireNonNull(action);
1473              final int hi = getFence();
1474              final Object[] a = array;
1475              int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines