ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/VectorTest.java
(Generate patch)

Comparing jsr166/src/test/tck/VectorTest.java (file contents):
Revision 1.7 by jsr166, Tue Apr 3 00:59:22 2018 UTC vs.
Revision 1.10 by jsr166, Fri Feb 22 19:27:47 2019 UTC

# Line 5 | Line 5
5   * http://creativecommons.org/publicdomain/zero/1.0/
6   */
7  
8 import java.util.ArrayList;
8   import java.util.Arrays;
9   import java.util.Collection;
10   import java.util.Collections;
# Line 30 | Line 29 | public class VectorTest extends JSR166Te
29          }
30          class SubListImplementation extends Implementation {
31              public List emptyCollection() {
32 <                return super.emptyCollection().subList(0, 0);
32 >                List list = super.emptyCollection();
33 >                ThreadLocalRandom rnd = ThreadLocalRandom.current();
34 >                if (rnd.nextBoolean())
35 >                    list.add(makeElement(rnd.nextInt()));
36 >                int i = rnd.nextInt(list.size() + 1);
37 >                return list.subList(i, i);
38              }
39          }
40          return newTestSuite(
# Line 436 | Line 440 | public class VectorTest extends JSR166Te
440              assertEquals(n, v.size());
441              assertNull(v.get(0));
442              assertNull(v.get(n - 1));
443 <            assertThrows(
444 <                    ArrayIndexOutOfBoundsException.class,
441 <                    new Runnable() { public void run() { v.setSize(-1); }});
443 >            assertThrows(ArrayIndexOutOfBoundsException.class,
444 >                () -> v.setSize(-1));
445              assertEquals(n, v.size());
446              assertNull(v.get(0));
447              assertNull(v.get(n - 1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines