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.40 by jsr166, Mon Dec 5 00:08:01 2016 UTC vs.
Revision 1.45 by jsr166, Wed Feb 1 20:13:47 2017 UTC

# 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 985 | Line 986 | public class Vector<E>
986          return bulkRemove(e -> !c.contains(e));
987      }
988  
989 +    /**
990 +     * @throws NullPointerException {@inheritDoc}
991 +     */
992      @Override
993      public boolean removeIf(Predicate<? super E> filter) {
994          Objects.requireNonNull(filter);
# Line 1353 | Line 1357 | public class Vector<E>
1357          }
1358      }
1359  
1360 +    /**
1361 +     * @throws NullPointerException {@inheritDoc}
1362 +     */
1363      @Override
1364      public synchronized void forEach(Consumer<? super E> action) {
1365          Objects.requireNonNull(action);
# Line 1366 | Line 1373 | public class Vector<E>
1373          // checkInvariants();
1374      }
1375  
1376 +    /**
1377 +     * @throws NullPointerException {@inheritDoc}
1378 +     */
1379      @Override
1380      public synchronized void replaceAll(UnaryOperator<E> operator) {
1381          Objects.requireNonNull(operator);
# Line 1416 | 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 <        /** Create 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 1445 | 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;
1449            if (action == null)
1450                throw new NullPointerException();
1460              if (getFence() > (i = index)) {
1461                  index = i + 1;
1462                  action.accept((E)array[i]);
# Line 1460 | Line 1469 | public class Vector<E>
1469  
1470          @SuppressWarnings("unchecked")
1471          public void forEachRemaining(Consumer<? super E> action) {
1472 <            if (action == null)
1464 <                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