[cvs] / jsr166 / src / main / java / util / Vector.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/Vector.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37, Wed Nov 30 03:31:47 2016 UTC revision 1.38, Thu Dec 1 00:35:21 2016 UTC
# Line 1452  Line 1452 
1452    
1453          @SuppressWarnings("unchecked")          @SuppressWarnings("unchecked")
1454          public void forEachRemaining(Consumer<? super E> action) {          public void forEachRemaining(Consumer<? super E> action) {
             int i, hi; // hoist accesses and checks from loop  
             Object[] a;  
1455              if (action == null)              if (action == null)
1456                  throw new NullPointerException();                  throw new NullPointerException();
1457              if ((hi = fence) < 0) {              final int hi = getFence();
1458                  synchronized (Vector.this) {              final Object[] a = array;
1459                      expectedModCount = modCount;              int i;
1460                      a = array = elementData;              for (i = index, index = hi; i < hi; i++)
1461                      hi = fence = elementCount;                  action.accept((E) a[i]);
1462                  }              if (modCount != expectedModCount)
             }  
             else  
                 a = array;  
             if (a != null && (i = index) >= 0 && (index = hi) <= a.length) {  
                 while (i < hi)  
                     action.accept((E) a[i++]);  
                 if (modCount == expectedModCount)  
                     return;  
             }  
1463              throw new ConcurrentModificationException();              throw new ConcurrentModificationException();
1464          }          }
1465    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8