< prev index next >

test/jdk/java/util/Spliterator/SpliteratorLateBindingFailFastHelper.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 180,30 ***
                      () -> new MapSource<>(m -> m.entrySet(), e.getValue()));
              }
          }
      }
  
!     static class AbstractRandomAccessListImpl extends AbstractList<Integer> implements RandomAccess {
!         List<Integer> l;
  
!         AbstractRandomAccessListImpl(Collection<Integer> c) {
              this.l = new ArrayList<>(c);
          }
  
          @Override
!         public boolean add(Integer integer) {
              modCount++;
!             return l.add(integer);
          }
  
          @Override
!         public Iterator<Integer> iterator() {
              return l.iterator();
          }
  
          @Override
!         public Integer get(int index) {
              return l.get(index);
          }
  
          @Override
          public boolean remove(Object o) {
--- 180,30 ---
                      () -> new MapSource<>(m -> m.entrySet(), e.getValue()));
              }
          }
      }
  
!     static class AbstractRandomAccessListImpl<T> extends AbstractList<T> implements RandomAccess {
!         List<T> l;
  
!         AbstractRandomAccessListImpl(Collection<T> c) {
              this.l = new ArrayList<>(c);
          }
  
          @Override
!         public boolean add(T value) {
              modCount++;
!             return l.add(value);
          }
  
          @Override
!         public Iterator<T> iterator() {
              return l.iterator();
          }
  
          @Override
!         public T get(int index) {
              return l.get(index);
          }
  
          @Override
          public boolean remove(Object o) {

*** 215,10 ***
          public int size() {
              return l.size();
          }
  
          @Override
!         public List<Integer> subList(int fromIndex, int toIndex) {
              return l.subList(fromIndex, toIndex);
          }
      }
  }
--- 215,10 ---
          public int size() {
              return l.size();
          }
  
          @Override
!         public List<T> subList(int fromIndex, int toIndex) {
              return l.subList(fromIndex, toIndex);
          }
      }
  }
< prev index next >